Created
December 31, 2020 15:08
-
-
Save kibotu/61383ae184d8f21d20962fbcbe3b174d to your computer and use it in GitHub Desktop.
bundle into asset folder android dependencies
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
android.applicationVariants.all { variant -> | |
task "listDependencies${variant.name.capitalize()}"() { | |
outputs.upToDateWhen { false } | |
doLast { | |
println "Depdencies for ${variant.name.capitalize()}\n" | |
final String filePath = "${project.rootDir}/app/src/main/assets/dependencies.txt" | |
def assetFolder = new File("${project.rootDir}/app/src/main/assets/") | |
if (!assetFolder.exists()) | |
assetFolder.mkdirs() | |
final def output = new File(filePath) | |
output.write("") | |
configurations.getByName("${variant.name}RuntimeClasspath").getResolvedConfiguration().getFirstLevelModuleDependencies().each { | |
println "${it.moduleGroup}:${it.moduleName} -> ${it.moduleVersion}" | |
output.append("${it.moduleGroup}:${it.moduleName}:${it.moduleVersion}\n") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./gradlew listDependenciesDebug listDependenciesRelease