Interface ImportClassesSpec
-
- All Implemented Interfaces:
-
org.gradle.api.Named
public interface ImportClassesSpec implements Named
-
-
Method Summary
Modifier and Type Method Description abstract ImportClassesSpecdependencies(Object dependencies)The dependencies from where to import classes from. abstract ImportClassesSpeclibraries(Object dependencies)Extra dependencies to be mapped to Proguard's -libraryjarsoption.abstract ImportClassesSpecrepackageTo(String repackageTo)Sets the target package to repackage the classes to. abstract ImportClassesSpeckeep(String className)Targets the given className for being imported. abstract ImportClassesSpeckeep(String className, String renameTo)Targets the given className for being imported and renamed to the given renameTo ( nullfor keep the original name).abstract ImportClassesSpecinclude(String pattern)Adds a positive pattern to the filters. abstract ImportClassesSpecexclude(String pattern)Adds a negative ( !prefixed) pattern to the filters.abstract ImportClassesSpecoption(String option)Adds a custom option (Proguard` rule) to the extraOptions. abstract Property<String>getIntoSourceSet()The org.gradle.api.tasks.SourceSet (or Android's com.android.build.api.variant) to bind the imported classes to. abstract Property<String>getRepackageTo()Optional. abstract MapProperty<String, String>getKeepsAndRenames()The -keeprules to apply to the classes.abstract SetProperty<String>getFilters()Controls what classes and resources gets imported into the target SourceSet.abstract ListProperty<String>getExtraOptions()Allows to add any custom extra rule to Proguard's configurationabstract Property<JavaLanguageVersion>getJavaRuntimeLanguageVersion()If set, a org.gradle.jvm.toolchain.JavaToolchainSpec runtime will be appended to -libraryjars.-
-
Method Detail
-
dependencies
abstract ImportClassesSpec dependencies(Object dependencies)
The dependencies from where to import classes from.
For instance:
importClasses { dependencies("org.example:library:1.0") } ```. It's a shorthand for project's `dependencies` block: ```kotlin dependencies { importClasses("org.example:library:1.0") }
-
libraries
abstract ImportClassesSpec libraries(Object dependencies)
Extra dependencies to be mapped to Proguard's
-libraryjarsoption.For instance:
importClasses { libraries("org.example:library:1.0") } ```. It's a shorthand for project's `dependencies` block: ```kotlin dependencies { importClassesLibraries("org.example:library:1.0") }
-
repackageTo
abstract ImportClassesSpec repackageTo(String repackageTo)
Sets the target package to repackage the classes to.
-
keep
abstract ImportClassesSpec keep(String className)
Targets the given className for being imported.
-
keep
abstract ImportClassesSpec keep(String className, String renameTo)
Targets the given className for being imported and renamed to the given renameTo (
nullfor keep the original name).
-
include
abstract ImportClassesSpec include(String pattern)
Adds a positive pattern to the filters.
-
exclude
abstract ImportClassesSpec exclude(String pattern)
Adds a negative (
!prefixed) pattern to the filters.
-
option
abstract ImportClassesSpec option(String option)
Adds a custom option (Proguard` rule) to the extraOptions.
-
getIntoSourceSet
abstract Property<String> getIntoSourceSet()
The org.gradle.api.tasks.SourceSet (or Android's com.android.build.api.variant) to bind the imported classes to.
Defaults to this spec's name.
-
getRepackageTo
abstract Property<String> getRepackageTo()
Optional. The target package to repackage the classes to.
-
getKeepsAndRenames
abstract MapProperty<String, String> getKeepsAndRenames()
The
-keeprules to apply to the classes. If the value is not blank, the class will be renamed to the given class name.
-
getFilters
abstract SetProperty<String> getFilters()
Controls what classes and resources gets imported into the target
SourceSet.The patterns are matched against the relative path of the class file inside the jar, and order matters.
There is no default, but a good standard should be:
exclude("META-INF/**/module-info.class") include("**.class") exclude("**.*")
-
getExtraOptions
abstract ListProperty<String> getExtraOptions()
Allows to add any custom extra rule to
Proguard's configuration
-
getJavaRuntimeLanguageVersion
abstract Property<JavaLanguageVersion> getJavaRuntimeLanguageVersion()
If set, a org.gradle.jvm.toolchain.JavaToolchainSpec runtime will be appended to
-libraryjars.Defaults to
java.toolchain.languageVersion.
-
-
-
-