Last active
July 18, 2018 06:43
-
-
Save dogukancagatay/0dfcb4ccacdd702df4d0304e33f0a26e to your computer and use it in GitHub Desktop.
Downloads JAR dependencies with Gradle and saves them on `lib` path.
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
apply plugin: 'groovy' | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7' | |
compile 'org.apache.commons:commons-io:1.3.2' | |
} | |
task downloadDeps() { | |
project.configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { config -> | |
println "Processing ${config.getModuleName()} (${config.module})" | |
def moduleFile = project.configurations.compile.find { it.name.startsWith(config.getModuleName()) } | |
def libDir = new java.io.File("lib") | |
libDir.mkdir() | |
moduleFile.renameTo(new java.io.File(libDir, moduleFile.getName())) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment