diff --git a/build.gradle b/build.gradle index 07edf22..c992d98 100644 --- a/build.gradle +++ b/build.gradle @@ -1,46 +1,16 @@ -defaultTasks 'executable' - -repositories { - jcenter() +plugins { + id 'com.github.johnrengelman.shadow' version '2.0.4' + id 'java' } -apply plugin: 'java' +defaultTasks 'shadowJar' -dependencies { - compile 'commons-cli:commons-cli:1.4' - compile 'com.madgag.spongycastle:bcpkix-jdk15on:1.56.0.0' - testCompile group: 'junit', name: 'junit', version: '4.12' -} +repositories { jcenter() } -// Create a single Jar with all dependencies -task fatJar(type: Jar) { - manifest { - attributes ( - 'Main-Class': MAIN_CLASS - ) - } - baseName = project.name + '-all' - from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } - with jar -} - -task executable(dependsOn: ':fatJar') { - doLast { - exec { - commandLine 'sh', '-c', 'cat stub.sh ' + fatJar.archivePath + ' > ' + BINARY_NAME - } - exec { - commandLine 'chmod', '+x', BINARY_NAME - } - println 'Runnable file ' + BINARY_NAME +' created!' - } - clean { - delete BINARY_NAME - } +dependencies { + compile 'commons-cli:commons-cli:1.4' + compile 'com.madgag.spongycastle:bcpkix-jdk15on:1.56.0.0' + testCompile group: 'junit', name: 'junit', version: '4.12' } -test { - afterTest { desc, result -> - println "Test ${desc.name} [${desc.className}] result: ${result.resultType}" - } -} +jar { manifest { attributes ( 'Main-Class': 'net.fornwall.apksigner.Main' ) } } diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 5addd53..0000000 --- a/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -BINARY_NAME=apksigner -MAIN_CLASS=net.fornwall.apksigner.Main