From f5e71dec2f98d71031d6ccac3be642ed25d5204f Mon Sep 17 00:00:00 2001 From: Tal Moran Date: Sat, 5 Nov 2016 23:56:19 +0200 Subject: [PATCH] Added JOpt.simple dependency for command-line parsing; fixed bug in build.gradle to support alternative fatmain --- voting-booth-gui/build.gradle | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/voting-booth-gui/build.gradle b/voting-booth-gui/build.gradle index 98b5e4e..4ea83dc 100644 --- a/voting-booth-gui/build.gradle +++ b/voting-booth-gui/build.gradle @@ -56,6 +56,9 @@ dependencies { // Google protobufs compile 'com.google.protobuf:protobuf-java:3.+' + // Command-line option parsing: + compile 'net.sf.jopt-simple:jopt-simple:5.0.3' + // Json configuraiton parsing compile group: 'org.json', name: 'json', version: '20160810' @@ -132,7 +135,10 @@ idea { /*=================================== * "Fat" Build targets *===================================*/ - + +task printProps << { + println fatmain +} if (project.hasProperty('mainClassName') && (mainClassName != null)) { @@ -147,17 +153,19 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { destinationDir = buildDir - def fatMain = hasProperty('fatmain') ? fatmain : mainClassName + def fatMain + + if (this.hasProperty('fatmain')) { + fatMain = fatmain + appendix = "fat-${fatMain}" + } else { + fatMain = mainClassName + appendix = "fat" + } applicationClass fatMain - def testJar = hasProperty('test') - - if (hasProperty('fatmain')) { - appendix = "fat-${fatMain}" - } else { - appendix = "fat" - } + def testJar = this.hasProperty('test') if (testJar) { from sourceSets.test.output