From 7f991a0e9bf70764ea388ec3fa0a7339d77fa511 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Sat, 21 Aug 2021 12:29:54 +0200 Subject: [PATCH] Add external libraries --- build.gradle | 16 ++++++++++++---- d2j-external/build.gradle | 16 ++++++++++++++++ settings.gradle | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 d2j-external/build.gradle diff --git a/build.gradle b/build.gradle index 83f134d6e..8069ea8fe 100644 --- a/build.gradle +++ b/build.gradle @@ -25,11 +25,19 @@ subprojects { [compileJava, compileTestJava]*.options.collect { options -> options.encoding = 'UTF-8' } + // Cache list of tasks + project.getAllTasks(true) + publishing { publications { - mavenJava(MavenPublication) { - from components.java - } + if (tasks.findByName("shadowJar") == null) + mavenJava(MavenPublication) { + from(components.java) + } + else + mavenJava(MavenPublication) { + artifact(tasks.findByName("shadowJar")) + } } } } @@ -41,6 +49,7 @@ dependencies { implementation(project(":d2j-base-cmd")) { transitive = false } + implementation(project(":d2j-external")) // Transitive please implementation(project(":d2j-jasmin")) { transitive = false } @@ -65,7 +74,6 @@ dependencies { implementation(project(":dex-writer")) { transitive = false } - implementation fileTree(dir: 'libs', include: '*.jar') } tasks.jar.enabled = false // Don't build normal jar diff --git a/d2j-external/build.gradle b/d2j-external/build.gradle new file mode 100644 index 000000000..1ee777314 --- /dev/null +++ b/d2j-external/build.gradle @@ -0,0 +1,16 @@ +apply plugin: 'com.github.johnrengelman.shadow' + +description = 'Module for including external libraries' +group 'com.googlecode.d2j' +version '2.1-SNAPSHOT' + +dependencies { + implementation fileTree(dir: '../libs', include: '*.jar') +} + +tasks.jar.enabled = false // Don't build normal jar +tasks.assemble.dependsOn tasks.shadowJar // Build uber-jar on build task + +shadowJar { + archiveClassifier.set(null) +} diff --git a/settings.gradle b/settings.gradle index c53ffcb41..0cef3ace2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name = 'dex2jar' -include ':dex-reader-api', ':dex-reader', ':dex-writer', ':dex-translator', ':dex-ir', ':dex-tools', ':d2j-smali', ':d2j-base-cmd', ':d2j-jasmin' +include ':d2j-external', ':dex-reader-api', ':dex-reader', ':dex-writer', ':dex-translator', ':dex-ir', ':dex-tools', ':d2j-smali', ':d2j-base-cmd', ':d2j-jasmin'