Added JOpt.simple dependency for command-line parsing; fixed bug in build.gradle to support alternative fatmain

android-scanner
Tal Moran 2016-11-05 23:56:19 +02:00
parent d6ea9412e3
commit f5e71dec2f
1 changed files with 17 additions and 9 deletions

View File

@ -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