How do I know the properties in applicationVariants of android gradle plugin?
I had a hard time finding it too. Here's the interface incase it moves:It will also have any props you define in your flavor, like the versionName, applicationId etc
public interface ApplicationVariant { String getName() String getDescription() String getDirName() String getBaseName() VariantConfiguration getConfig() boolean getZipAlign() boolean isSigned() boolean getRunProguard() FileCollection getRuntimeClasspath() FileCollection getResourcePackage() Compile getCompileTask() List<String> getRunCommand() String getPackage() AndroidBuilder createBuilder(AndroidBasePlugin androidBasePlugin)}
And to print the props of any object:
def filtered = ['class', 'active']println theObject.properties .sort{it.key} .collect{it} .findAll{!filtered.contains(it.key)} .join('\n')
The link in @CaptRespect's answer is to a specific build. Here are the links to the public API in the master branch:
/gradle/api/ApplicationVariant.java
(derives from)/gradle/api/ApkVariant.java
(derives from)/gradle/api/BaseVariant.java
Here's some documentation on those: