Skip to content

Commit

Permalink
Migrate to libs.versions.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Jul 12, 2024
1 parent bfd23fa commit 09db1cf
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 30 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id "signing"
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
id "dex2jar.build-conventions"
alias libs.plugins.versions
}

description = 'Supermodule for dex2jar'
Expand Down
13 changes: 2 additions & 11 deletions buildSrc/src/main/groovy/dex2jar.build-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ plugins {
id 'signing'
}

ext.antlr3Version = '3.5.3'
ext.antlr4Version = '4.13.1'
ext.asmVersion = '9.7'
ext.baksmaliVersion = '3.0.7'
ext.commonsCompressVersion = '1.26.2'
ext.jUnitVersion = '5.10.3'
ext.jUnitPlatformVersion = '1.10.3'
ext.r8Version = '4.0.63' // Newer versions only for Java 11+

group = 'de.femtopedia.dex2jar'
version = project.findProperty('version')
version = version == null || version == 'unspecified' ? '2.4-SNAPSHOT' : version
Expand Down Expand Up @@ -41,8 +32,8 @@ javadoc {
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:${project.property('jUnitVersion')}"
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${project.property('jUnitPlatformVersion')}")
testImplementation libs.junit.jupiter
testRuntimeOnly libs.junit.platform.launcher
}

[compileJava, compileTestJava]*.options.collect { options ->
Expand Down
10 changes: 5 additions & 5 deletions d2j-jasmin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ plugins {
description = "Jasmin support for dex2jar"

dependencies {
api(group: 'org.antlr', name: 'antlr-runtime', version: project.property('antlr3Version')) {
api(libs.antlr3.runtime) {
exclude(module: 'stringtemplate')
}
api project(path: ':d2j-external', configuration: 'shadow')
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
// api libs.asm // Fixed MethodCodeTooLargeException
api(libs.asm.tree) {
exclude(module: 'asm')
}
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
api(libs.asm.util) {
exclude(module: 'asm')
}
api project(':d2j-base-cmd')
antlr "org.antlr:antlr:${project.property('antlr3Version')}"
antlr libs.antlr3
}

sourceSets.main.antlr.srcDirs = ['src/main/antlr3']
6 changes: 3 additions & 3 deletions d2j-smali/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ plugins {
description = "Smali support for dex2jar"

dependencies {
api "org.antlr:antlr4-runtime:${project.property('antlr4Version')}"
api libs.antlr4.runtime
api project(':dex-reader-api')
api project(':dex-reader')
antlr "org.antlr:antlr4:${project.property('antlr4Version')}"
antlr libs.antlr4
api project(':d2j-base-cmd')
api project(':dex-writer')
testImplementation "com.android.tools.smali:smali-baksmali:${project.property('baksmaliVersion')}"
testImplementation libs.baksmali
}

generateGrammarSource {
Expand Down
2 changes: 1 addition & 1 deletion dex-reader-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = 'Dex/Dalvik reader API for dex2jar'

dependencies {
api project(path: ':d2j-external', configuration: 'shadow')
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
// api libs.asm // Fixed MethodCodeTooLargeException
}
2 changes: 1 addition & 1 deletion dex-reader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ description = 'Dex/Dalvik reader for dex2jar'

dependencies {
api project(':dex-reader-api')
testImplementation(group: 'org.apache.commons', name: 'commons-compress', version: project.property('commonsCompressVersion'))
testImplementation libs.commons.compress
}
10 changes: 5 additions & 5 deletions dex-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ dependencies {
api project(':dex-writer')
api project(':d2j-base-cmd')
api project(path: ':d2j-external', configuration: 'shadow')
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
// api libs.asm // Fixed MethodCodeTooLargeException
api(libs.asm.tree) {
exclude(module: 'asm')
}
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
api(libs.asm.util) {
exclude(module: 'asm')
}
api(group: 'org.ow2.asm', name: 'asm-commons', version: project.property('asmVersion')) {
api(libs.asm.commons) {
exclude(module: 'asm')
}
testImplementation "org.antlr:antlr-runtime:${project.property('antlr3Version')}"
testImplementation libs.antlr3.runtime
}

tasks.register('bin_gen', JavaExec) {
Expand Down
8 changes: 4 additions & 4 deletions dex-translator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ dependencies {
api project(':dex-ir')
api project(':d2j-base-cmd')
api project(path: ':d2j-external', configuration: 'shadow')
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
// api libs.asm // Fixed MethodCodeTooLargeException
api(libs.asm.tree) {
exclude(module: 'asm')
}
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
api(libs.asm.util) {
exclude(module: 'asm')
}
api(group: 'org.ow2.asm', name: 'asm-commons', version: project.property('asmVersion')) {
api(libs.asm.commons) {
exclude(module: 'asm')
}
testImplementation project(':d2j-smali')
Expand Down
27 changes: 27 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[versions]
antlr3 = '3.5.3'
antlr4 = '4.13.1'
asm = '9.7'
smali = '3.0.7'
commons-compress = '1.26.2'
junit = '5.10.3'
junit-platform = '1.10.3'
r8 = '4.0.63' # Newer versions only for Java 11+
versions-plugin = '0.51.0'

[libraries]
antlr3 = { module = "org.antlr:antlr", version.ref = "antlr3" }
antlr3-runtime = { module = "org.antlr:antlr-runtime", version.ref = "antlr3" }
antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr4" }
antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr4" }
asm-commons = { module = "org.ow2.asm:asm-commons", version.ref = "asm" }
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" }
baksmali = { module = "com.android.tools.smali:smali-baksmali", version.ref = "smali" }
commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "commons-compress" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" }
r8 = { module = "com.android.tools:r8", version.ref = "r8" }

[plugins]
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }

0 comments on commit 09db1cf

Please sign in to comment.