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 // Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+' compile 'com.google.protobuf:protobuf-java:3.+'
// Command-line option parsing:
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
// Json configuraiton parsing // Json configuraiton parsing
compile group: 'org.json', name: 'json', version: '20160810' compile group: 'org.json', name: 'json', version: '20160810'
@ -132,7 +135,10 @@ idea {
/*=================================== /*===================================
* "Fat" Build targets * "Fat" Build targets
*===================================*/ *===================================*/
task printProps << {
println fatmain
}
if (project.hasProperty('mainClassName') && (mainClassName != null)) { if (project.hasProperty('mainClassName') && (mainClassName != null)) {
@ -147,17 +153,19 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) {
destinationDir = buildDir 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 applicationClass fatMain
def testJar = hasProperty('test') def testJar = this.hasProperty('test')
if (hasProperty('fatmain')) {
appendix = "fat-${fatMain}"
} else {
appendix = "fat"
}
if (testJar) { if (testJar) {
from sourceSets.test.output from sourceSets.test.output