Skip to content

Commit 09db1cf

Browse files
committed
Migrate to libs.versions.toml
1 parent bfd23fa commit 09db1cf

File tree

9 files changed

+49
-30
lines changed

9 files changed

+49
-30
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id "signing"
44
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
55
id "dex2jar.build-conventions"
6+
alias libs.plugins.versions
67
}
78

89
description = 'Supermodule for dex2jar'

buildSrc/src/main/groovy/dex2jar.build-conventions.gradle

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ plugins {
44
id 'signing'
55
}
66

7-
ext.antlr3Version = '3.5.3'
8-
ext.antlr4Version = '4.13.1'
9-
ext.asmVersion = '9.7'
10-
ext.baksmaliVersion = '3.0.7'
11-
ext.commonsCompressVersion = '1.26.2'
12-
ext.jUnitVersion = '5.10.3'
13-
ext.jUnitPlatformVersion = '1.10.3'
14-
ext.r8Version = '4.0.63' // Newer versions only for Java 11+
15-
167
group = 'de.femtopedia.dex2jar'
178
version = project.findProperty('version')
189
version = version == null || version == 'unspecified' ? '2.4-SNAPSHOT' : version
@@ -41,8 +32,8 @@ javadoc {
4132
}
4233

4334
dependencies {
44-
testImplementation "org.junit.jupiter:junit-jupiter:${project.property('jUnitVersion')}"
45-
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${project.property('jUnitPlatformVersion')}")
35+
testImplementation libs.junit.jupiter
36+
testRuntimeOnly libs.junit.platform.launcher
4637
}
4738

4839
[compileJava, compileTestJava]*.options.collect { options ->

d2j-jasmin/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ plugins {
66
description = "Jasmin support for dex2jar"
77

88
dependencies {
9-
api(group: 'org.antlr', name: 'antlr-runtime', version: project.property('antlr3Version')) {
9+
api(libs.antlr3.runtime) {
1010
exclude(module: 'stringtemplate')
1111
}
1212
api project(path: ':d2j-external', configuration: 'shadow')
13-
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
14-
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
13+
// api libs.asm // Fixed MethodCodeTooLargeException
14+
api(libs.asm.tree) {
1515
exclude(module: 'asm')
1616
}
17-
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
17+
api(libs.asm.util) {
1818
exclude(module: 'asm')
1919
}
2020
api project(':d2j-base-cmd')
21-
antlr "org.antlr:antlr:${project.property('antlr3Version')}"
21+
antlr libs.antlr3
2222
}
2323

2424
sourceSets.main.antlr.srcDirs = ['src/main/antlr3']

d2j-smali/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ plugins {
66
description = "Smali support for dex2jar"
77

88
dependencies {
9-
api "org.antlr:antlr4-runtime:${project.property('antlr4Version')}"
9+
api libs.antlr4.runtime
1010
api project(':dex-reader-api')
1111
api project(':dex-reader')
12-
antlr "org.antlr:antlr4:${project.property('antlr4Version')}"
12+
antlr libs.antlr4
1313
api project(':d2j-base-cmd')
1414
api project(':dex-writer')
15-
testImplementation "com.android.tools.smali:smali-baksmali:${project.property('baksmaliVersion')}"
15+
testImplementation libs.baksmali
1616
}
1717

1818
generateGrammarSource {

dex-reader-api/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ description = 'Dex/Dalvik reader API for dex2jar'
66

77
dependencies {
88
api project(path: ':d2j-external', configuration: 'shadow')
9-
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
9+
// api libs.asm // Fixed MethodCodeTooLargeException
1010
}

dex-reader/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ description = 'Dex/Dalvik reader for dex2jar'
66

77
dependencies {
88
api project(':dex-reader-api')
9-
testImplementation(group: 'org.apache.commons', name: 'commons-compress', version: project.property('commonsCompressVersion'))
9+
testImplementation libs.commons.compress
1010
}

dex-tools/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ dependencies {
1212
api project(':dex-writer')
1313
api project(':d2j-base-cmd')
1414
api project(path: ':d2j-external', configuration: 'shadow')
15-
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
16-
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
15+
// api libs.asm // Fixed MethodCodeTooLargeException
16+
api(libs.asm.tree) {
1717
exclude(module: 'asm')
1818
}
19-
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
19+
api(libs.asm.util) {
2020
exclude(module: 'asm')
2121
}
22-
api(group: 'org.ow2.asm', name: 'asm-commons', version: project.property('asmVersion')) {
22+
api(libs.asm.commons) {
2323
exclude(module: 'asm')
2424
}
25-
testImplementation "org.antlr:antlr-runtime:${project.property('antlr3Version')}"
25+
testImplementation libs.antlr3.runtime
2626
}
2727

2828
tasks.register('bin_gen', JavaExec) {

dex-translator/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ dependencies {
1010
api project(':dex-ir')
1111
api project(':d2j-base-cmd')
1212
api project(path: ':d2j-external', configuration: 'shadow')
13-
// api group: 'org.ow2.asm', name: 'asm', version: project.property('asmVersion') // Fixed MethodCodeTooLargeException
14-
api(group: 'org.ow2.asm', name: 'asm-tree', version: project.property('asmVersion')) {
13+
// api libs.asm // Fixed MethodCodeTooLargeException
14+
api(libs.asm.tree) {
1515
exclude(module: 'asm')
1616
}
17-
api(group: 'org.ow2.asm', name: 'asm-util', version: project.property('asmVersion')) {
17+
api(libs.asm.util) {
1818
exclude(module: 'asm')
1919
}
20-
api(group: 'org.ow2.asm', name: 'asm-commons', version: project.property('asmVersion')) {
20+
api(libs.asm.commons) {
2121
exclude(module: 'asm')
2222
}
2323
testImplementation project(':d2j-smali')

gradle/libs.versions.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[versions]
2+
antlr3 = '3.5.3'
3+
antlr4 = '4.13.1'
4+
asm = '9.7'
5+
smali = '3.0.7'
6+
commons-compress = '1.26.2'
7+
junit = '5.10.3'
8+
junit-platform = '1.10.3'
9+
r8 = '4.0.63' # Newer versions only for Java 11+
10+
versions-plugin = '0.51.0'
11+
12+
[libraries]
13+
antlr3 = { module = "org.antlr:antlr", version.ref = "antlr3" }
14+
antlr3-runtime = { module = "org.antlr:antlr-runtime", version.ref = "antlr3" }
15+
antlr4 = { module = "org.antlr:antlr4", version.ref = "antlr4" }
16+
antlr4-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr4" }
17+
asm-commons = { module = "org.ow2.asm:asm-commons", version.ref = "asm" }
18+
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }
19+
asm-util = { module = "org.ow2.asm:asm-util", version.ref = "asm" }
20+
baksmali = { module = "com.android.tools.smali:smali-baksmali", version.ref = "smali" }
21+
commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "commons-compress" }
22+
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
23+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junit-platform" }
24+
r8 = { module = "com.android.tools:r8", version.ref = "r8" }
25+
26+
[plugins]
27+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }

0 commit comments

Comments
 (0)