From f28dbb7c4044fdbb90f3d3d55ef4169eae606057 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 10 Aug 2021 12:14:28 +0200 Subject: [PATCH] Automatically build uber-jar --- .github/workflows/gradle.yml | 13 +++++++-- d2j-all/build.gradle | 51 ++++++++++++++++++++++++++++++++++++ settings.gradle | 2 +- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 d2j-all/build.gradle diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4589ef61f..410150670 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -23,7 +23,9 @@ jobs: java-version: 1.8 - name: Grant execute permission for gradlew run: chmod +x gradlew - - name: Build with Gradle + - name: Build library with Gradle + run: ./gradlew build --exclude-task test + - name: Build dex-tools with Gradle run: ./gradlew distZip - name: Create Release @@ -48,9 +50,16 @@ jobs: asset_name: dex-tools-2.1-SNAPSHOT.zip asset_content_type: application/zip - - name: Archive artifacts + - name: Archive dex tools uses: actions/upload-artifact@v2 if: success() with: name: dex-tools-2.1-SNAPSHOT path: dex-tools/build/distributions/dex-tools-2.1-SNAPSHOT.zip + + - name: Archive uber-jar + uses: actions/upload-artifact@v2 + if: success() + with: + name: d2j-all-2.1-SNAPSHOT-all + path: d2j-all/build/libs/d2j-all-2.1-SNAPSHOT-all.jar diff --git a/d2j-all/build.gradle b/d2j-all/build.gradle new file mode 100644 index 000000000..44df47103 --- /dev/null +++ b/d2j-all/build.gradle @@ -0,0 +1,51 @@ +plugins { + id "java" + id "com.github.johnrengelman.shadow" version "7.0.0" +} + +apply plugin: 'com.github.johnrengelman.shadow' + +description = 'Module for creating a uber-jar' +group 'com.googlecode.d2j' +version '2.1-SNAPSHOT' + +repositories { + mavenCentral() +} + +dependencies { + implementation(project(":d2j-base-cmd")) { + transitive = false + } + implementation(project(":d2j-j6")) { + transitive = false + } + implementation(project(":d2j-jasmin")) { + transitive = false + } + implementation(project(":d2j-smali")) { + transitive = false + } + implementation(project(":dex-ir")) { + transitive = false + } + implementation(project(":dex-reader")) { + transitive = false + } + implementation(project(":dex-reader-api")) { + transitive = false + } + implementation(project(":dex-tools")) { + transitive = false + } + implementation(project(":dex-translator")) { + transitive = false + } + implementation(project(":dex-writer")) { + transitive = false + } +} + +tasks.packageSources.enabled = false // Don't build sources jar +tasks.jar.enabled = false // Don't build normal jar +tasks.assemble.dependsOn tasks.shadowJar // Build uber-jar on build task diff --git a/settings.gradle b/settings.gradle index c29b0659d..be346c955 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', ':d2j-j6' +include ':d2j-all', ':dex-reader-api',':dex-reader', ':dex-writer', ':dex-translator', ':dex-ir', ':dex-tools', ':d2j-smali', ':d2j-base-cmd', ':d2j-jasmin', ':d2j-j6'