Allow passing system properties from gradle to java tasks (test and run)
parent
32258361a3
commit
5ffc08d07f
|
@ -57,6 +57,15 @@ dependencies {
|
||||||
|
|
||||||
/*==== You probably don't have to edit below this line =======*/
|
/*==== You probably don't have to edit below this line =======*/
|
||||||
|
|
||||||
|
// The run task added by the application plugin
|
||||||
|
// is also of type JavaExec.
|
||||||
|
tasks.withType(JavaExec) {
|
||||||
|
// Assign all Java system properties from
|
||||||
|
// the command line to the JavaExec task.
|
||||||
|
systemProperties System.properties
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protobuf {
|
protobuf {
|
||||||
// Configure the protoc executable
|
// Configure the protoc executable
|
||||||
protoc {
|
protoc {
|
||||||
|
|
|
@ -57,6 +57,16 @@ dependencies {
|
||||||
|
|
||||||
/*==== You probably don't have to edit below this line =======*/
|
/*==== You probably don't have to edit below this line =======*/
|
||||||
|
|
||||||
|
|
||||||
|
// The run task added by the application plugin
|
||||||
|
// is also of type JavaExec.
|
||||||
|
tasks.withType(JavaExec) {
|
||||||
|
// Assign all Java system properties from
|
||||||
|
// the command line to the JavaExec task.
|
||||||
|
systemProperties System.properties
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protobuf {
|
protobuf {
|
||||||
// Configure the protoc executable
|
// Configure the protoc executable
|
||||||
protoc {
|
protoc {
|
||||||
|
@ -91,33 +101,6 @@ idea {
|
||||||
* "Fat" Build targets
|
* "Fat" Build targets
|
||||||
*===================================*/
|
*===================================*/
|
||||||
|
|
||||||
task fatjar(type: Jar) {
|
|
||||||
description = "Generate a single jar containing everything. Use -Pfatmain=... to override main class"
|
|
||||||
|
|
||||||
destinationDir = buildDir
|
|
||||||
|
|
||||||
def fatMain = hasProperty('fatmain') ? fatmain : mainClassName
|
|
||||||
def testJar = hasProperty('test')
|
|
||||||
|
|
||||||
appendix = "${fatMain}-fat"
|
|
||||||
|
|
||||||
if (testJar) {
|
|
||||||
from sourceSets.test.output
|
|
||||||
from configurations.testRuntime.collect { it.isDirectory() ? it : zipTree(it) }
|
|
||||||
}
|
|
||||||
|
|
||||||
from sourceSets.main.output // that's it
|
|
||||||
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
|
|
||||||
|
|
||||||
exclude 'META-INF/MANIFEST.MF'
|
|
||||||
exclude 'META-INF/*.SF'
|
|
||||||
exclude 'META-INF/*.DSA'
|
|
||||||
exclude 'META-INF/*.RSA'
|
|
||||||
|
|
||||||
|
|
||||||
manifest { attributes 'Main-Class': fatMain }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
task mavenCapsule(type: MavenCapsule){
|
task mavenCapsule(type: MavenCapsule){
|
||||||
description = "Generate a capsule jar that automatically downloads and caches dependencies when run."
|
description = "Generate a capsule jar that automatically downloads and caches dependencies when run."
|
||||||
|
|
Loading…
Reference in New Issue