aboutsummaryrefslogtreecommitdiff
path: root/dexlib2
diff options
context:
space:
mode:
authorBen Gruver <bgruv@google.com>2015-03-16 19:54:57 -0700
committerBen Gruver <bgruv@google.com>2015-03-16 19:54:57 -0700
commitb76dee7ebd42937e96244fe5291e467f63379e79 (patch)
tree85ce25dbda7a077cdd7d5312b6f0804f2cb7bd3c /dexlib2
parentdd91dd1a71003bf1c3c24929889ca84485b0155d (diff)
downloadsmali-b76dee7ebd42937e96244fe5291e467f63379e79.tar.gz
Don't assume dx is on-path. Rather, grab it from maven central
The version of dx in maven central seems to be fairly old, but it works well enough for our purposes.
Diffstat (limited to 'dexlib2')
-rw-r--r--dexlib2/build.gradle28
1 files changed, 16 insertions, 12 deletions
diff --git a/dexlib2/build.gradle b/dexlib2/build.gradle
index 9027132e..dc3e853a 100644
--- a/dexlib2/build.gradle
+++ b/dexlib2/build.gradle
@@ -31,6 +31,7 @@
configurations {
accessorTestGenerator
+ dx
}
dependencies {
@@ -41,6 +42,8 @@ dependencies {
testCompile depends.junit
accessorTestGenerator project('accessorTestGenerator')
+
+ dx depends.dx
}
ext.testAccessorOutputDir = file("${buildDir}/generated-accessor-test-sources")
@@ -69,23 +72,12 @@ task generateAccessorTestSource(type: JavaExec) {
}
compileTestJava.dependsOn generateAccessorTestSource
-task generateAccessorTestDex(type: Exec, dependsOn: compileTestJava) {
+task generateAccessorTestDex(type: JavaExec, dependsOn: compileTestJava) {
def outputDex = file(new File(sourceSets.test.output.resourcesDir, 'accessorTest.dex'))
doFirst {
file(outputDex.parent).mkdirs()
- }
-
- inputs.dir(project.sourceSets.test.output.classesDir)
- outputs.file outputDex
-
- workingDir project.sourceSets.test.output.classesDir
- executable 'dx'
- args '--dex'
- args '--no-strict'
- args "--output=${outputDex}"
- doFirst {
// this has to be done in doFirst, so that the generated classes will be available.
// otherwise, it the tree will be populated while the build is being configured,
// which is before the compileTestJava has run
@@ -95,6 +87,18 @@ task generateAccessorTestDex(type: Exec, dependsOn: compileTestJava) {
args file
}
}
+
+ inputs.dir(project.sourceSets.test.output.classesDir)
+ outputs.file outputDex
+
+ main 'com.android.dx.command.Main'
+ classpath = configurations.dx
+
+ workingDir project.sourceSets.test.output.classesDir
+ //executable 'dx'
+ args '--dex'
+ args '--no-strict'
+ args "--output=${outputDex}"
}
test.dependsOn generateAccessorTestDex