Appearance
Common Tasks
List Variants
This Gradle task generates a JSON file containing information about the project's dependency variants and fallback variants.
Steps:
- The task scans the project's tasks for those with names containing the
ExtractDependenciespostfix. - It extracts the relevant variant names and writes them to a
dependency_variants.jsonfile in theplugins-dependenciesdirectory under the app's build directory. - It retrieves missing dimension strategies and their fallback values from the Android product flavors and writes them to a
fallback_variants.jsonfile in the same directory.
Example: dependency_variants.json
json
{
"example-one-plugin": ["debug", "release", "benchmark"],
"example-two-plugin": ["debug", "release", "benchmark"],
"hello-world-plugin": ["debug", "release", "benchmark"],
"sample-app": ["debug", "release", "benchmark"]
}Example: fallback_variants.json
json
{
"australia": "withGooglePay",
"bahrain": "withMauth",
"bangladesh": "withMauth",
"bermuda": "withMauth",
"chiiom": "withMauth",
"china": "withMauth",
"egypt": "withMauth",
"expat": "withMauth",
"hongkong": "withMauth",
"india": "withMauth",
"indonesia": "withMauth",
"macau": "withMauth",
"malaysia": "withMauth",
"malta": "withMauth",
"mexico": "withMauth",
"msb": "withMauth",
"philippines": "withMauth",
"qatar": "withMauth",
"singapore": "withMauth",
"srilanka": "withNone",
"taiwan": "withMauth",
"uae": "withMauth",
"uk": "withMauth",
"us": "withMauth",
"vietnam": "withMauth"
}Output Location
The generated JSON files are located at build/plugins-dependencies under the app module.
Command to Run
Run the task locally using the following command:
shell
./gradlew listVariantsExtract Dependencies
This Gradle task extracts dependencies for a specific variant of the project.
Steps:
- The task uses the
variantNamePropertyto identify the variant and retrieves the associated dependencies. - It copies the extracted
.aarfiles into the directory located atbuild/plugins-dependencies/zipunder the app module.
Example: Schema Structure
The extracted dependencies are organized in a structured location for further use:

Command to Run
Run the task locally using the following command:
shell
./gradlew :<module>:<variantName>ExtractDependenciesRecommendation
Instead of running this standalone task for the app module, it is recommended to run the Extract All Dependencies task.
Extract All Dependencies
This task triggers the Extract Dependencies task for the app module and its submodules that have applied the PH Gradle Plugin.
Command to Run
Run the task locally using the following command:
shell
./gradlew <appVariantName>ExtractAllDependencies:::note
Before running this task, you need to run the List Variants task.
:::