Last active
August 15, 2016 08:09
-
-
Save peacepassion/5a1a8088ed28ffb3c1a43b3f3393e350 to your computer and use it in GitHub Desktop.
Way to get some important information of Android gradle plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.android.applicationVariants.all { ApkVariant variant -> | |
println "variant class: ${variant.getClass()}" | |
ApplicationVariantImpl variant2 = (ApplicationVariantImpl) variant; | |
Field field = ApplicationVariantImpl.class.getDeclaredField("variantData") | |
field.setAccessible(true) | |
ApplicationVariantData data = field.get(variant2) | |
VariantScopeImpl scope = data.getScope(); | |
field = BaseVariantData.class.getDeclaredField('taskManager') | |
field.setAccessible(true) | |
TaskManager taskManager = field.get(data) | |
println 'task manager: ' + taskManager | |
field = TaskManager.class.getDeclaredField('dependencyManager') | |
field.setAccessible(true) | |
DependencyManager dependencyManager = field.get(taskManager) | |
println 'dependency manager: ' + dependencyManager | |
println 'variant dependencies: ' + data.variantDependency | |
println 'variant dependencies library: ' + data.variantDependency.libraries | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment