Files
Sourcetrail/bin/app/data/java/gradle/init.gradle
T

54 lines
1.4 KiB
Groovy

allprojects { pp ->
task printMainSrcDirs {
doLast {
if (project.hasProperty("sourceSets")) {
if (project.sourceSets.hasProperty("main")) {
project.sourceSets.main.java.srcDirs.each { dir ->
println "${dir}"
}
}
}
}
}
task printTestSrcDirs {
doLast {
if (project.hasProperty("sourceSets")) {
if (project.sourceSets.hasProperty("test")) {
project.sourceSets.test.java.srcDirs.each { dir ->
println "${dir}"
}
}
}
}
}
task copyCompileLibs {
doLast {
File rootDir = pp.getRootDir()
String destination = project.hasProperty('sourcetrail_lib_path') ? project.property('sourcetrail_lib_path').replace("\"", "") : rootDir.getPath() + rootDir.separator + "lib"
println destination;
if (pp.configurations.hasProperty("compile")) {
copy {
into destination
from pp.configurations.compile
eachFile { println "copying file \"" + it.file.name + "\" to \"" + destination + "\"" }
}
}
}
}
task copyTestCompileLibs {
doLast {
File rootDir = pp.getRootDir()
String destination = project.hasProperty('sourcetrail_lib_path') ? project.property('sourcetrail_lib_path') : rootDir.getPath() + rootDir.separator + "lib"
if (pp.configurations.hasProperty("testCompile")) {
copy {
into destination
from pp.configurations.testCompile
eachFile { println "copying file \"" + it.file.name + "\" to \"" + destination + "\"" }
}
}
}
}
}