./gradlew --help
23 mai 2022
./gradlew --help
-D, --system-prop
./gradlew -Dmyprop=myvalue
#ou
./gradlew --system-prop myvalue
-Pmyprop=myvalue
./gradlew -Pmyprop=myvalue
#ou
./gradlew --project-prop myvalue
./gradlew -p ~/src/next_startup
#ou
./gradlew --project-dir ~/src/next_startup
./gradlew -Pparam_component=CUSTOM_VALUE
sourceSets {
getByName("test"){
java.srcDir("src/scripts/groovy")
}
getByName("test"){
java.srcDir("src/scripts/kscript")
}
getByName("test"){
java.srcDir("src/test/javascript")
}
}
android {
sourceSets {
main.java.srcDirs += "src/main/../../../../ceelo/domain/src/main/java/"
test.java.srcDirs += "src/test/../../../../ceelo/domain/src/test/java/"
}
}
gradle build -x :excluded-module:check -x :excluded-module:assemble -x :excluded-module:build
tasks.register("moveWebappNode") {
doLast {
ant.withGroovyBuilder {
"move"(
"webapp/node_modules" to "$rootDir/webapp-src/node_modules",
)
}
}
}
tasks.register<Tar>("tarWebapp") {
dependsOn("moveWebappNpm")
group = WEBAPP
description = "tar webapp"
doLast {
setOf(
"build",
"target",
"node_modules"
).forEach { dir -> exclude { it.name .dir } }
archiveFileName.set("webapp.tar")
destinationDirectory.set(File("${rootDir.absolutePath}$sep$WEBAPP_SRC"))
}
}
tasks.register("printDependencies") {
description = "print project dependencies"
group = WEBAPP
doLast {
println("${project.name} dependencies")
mutableMapOf<String, Map<String, String>>(
"buildDependencies" to buildDependencies,
"domainDeps" to domainDeps,
"domainTestDeps" to domainTestDeps,
).apply { putAll(appModules) }
.forEach { module ->
if (module.value.isNotEmpty()) {
println("${module.key}:")
module.value.forEach { println(dependency(it)) }
println()
}
}
}
}
tasks.register("printWebappSrc") {
description = "print webapp sources"
group = WEBAPP
doLast {
webAppSrc
.reduce { acc, s -> "$acc\n\t$s" }
.run { println("$WEBAPP_SRC: $this\n") }
}
}
.\gradlew.bat -q help --task foo
:
.\gradlew.bat :foo