From 0370416d9029d01f210556ab3662e3fa0f80c239 Mon Sep 17 00:00:00 2001 From: Ben Gruver Date: Fri, 22 May 2015 16:25:56 -0700 Subject: [PATCH] Add the generated accessorTest to source control Some java compilers don't generate the synthetic accessor methods in the way that the accessorTest is trying to test. So we build the test dex file using a known-good compiler and check it in, ensuring the test is always run using an appropriate dex file. Conflicts: brut.apktool.smali/dexlib2/build.gradle --- brut.apktool.smali/dexlib2/build.gradle | 50 +++++++----------- .../src/test/resources/accessorTest.dex | Bin 0 -> 28940 bytes 2 files changed, 20 insertions(+), 30 deletions(-) create mode 100644 brut.apktool.smali/dexlib2/src/test/resources/accessorTest.dex diff --git a/brut.apktool.smali/dexlib2/build.gradle b/brut.apktool.smali/dexlib2/build.gradle index 8889e82a..82b71b53 100644 --- a/brut.apktool.smali/dexlib2/build.gradle +++ b/brut.apktool.smali/dexlib2/build.gradle @@ -29,6 +29,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +ext.testAccessorOutputDir = file("${buildDir}/generated-src/accessorTest/java") +ext.testAccessorOutputFile = file("${testAccessorOutputDir}/org/jf/dexlib2/AccessorTypes.java") + +sourceSets { + accessorTest { + java { + srcDir testAccessorOutputDir + } + } +} + configurations { accessorTestGenerator dx @@ -46,9 +57,6 @@ dependencies { dx depends.dx } -ext.testAccessorOutputDir = file("${buildDir}/generated-accessor-test-sources") -ext.testAccessorOutputFile = file("${buildDir}/generated-accessor-test-sources/org/jf/dexlib2/AccessorTypes.java") - // You must manually execute this task to regenerate SyntheticAccessorFSM.java, after modifying the ragel file // e.g. ./gradlew ragel task ragel(type:Exec) { @@ -59,46 +67,28 @@ task ragel(type:Exec) { } task generateAccessorTestSource(type: JavaExec) { - doFirst { - file(testAccessorOutputFile.parent).mkdirs() - } - + file(testAccessorOutputFile.parent).mkdirs() outputs.dir file(testAccessorOutputDir) - sourceSets['test'].java.srcDir file(testAccessorOutputDir) classpath = configurations.accessorTestGenerator main = 'org.jf.dexlib2.AccessorTestGenerator' args testAccessorOutputFile } -compileTestJava.dependsOn generateAccessorTestSource +compileAccessorTestJava.dependsOn(generateAccessorTestSource) -task generateAccessorTestDex(type: JavaExec, dependsOn: compileTestJava) { - def outputDex = file(new File(sourceSets.test.output.resourcesDir, 'accessorTest.dex')) +// You must manually execute this task to regenerate src/test/resources/accessorTest.dex +task generateAccessorTestDex(type: JavaExec, dependsOn: compileAccessorTestJava) { + def outputDex = file('src/test/resources/accessorTest.dex') + file(outputDex.parent).mkdirs() - doFirst { - file(outputDex.parent).mkdirs() - - // 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 - fileTree(project.sourceSets.test.output.classesDir) { - include 'org/jf/dexlib2/AccessorTypes*.class' - }.each { File file -> - args file - } - } - - inputs.dir(project.sourceSets.test.output.classesDir) + inputs.dir(project.sourceSets.accessorTest.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 \ No newline at end of file + args sourceSets.accessorTest.output.classesDir +} \ No newline at end of file diff --git a/brut.apktool.smali/dexlib2/src/test/resources/accessorTest.dex b/brut.apktool.smali/dexlib2/src/test/resources/accessorTest.dex new file mode 100644 index 0000000000000000000000000000000000000000..456f85f441eacb5a6ac7f8607594d70bec0a3b07 GIT binary patch literal 28940 zcmeHwdw5jU_4b}g!d-|cUaBT%My!{LoXkuDcn1Ul0gGIORD=KlqTDYQwb+0GBMpd% z6e(Ioq+SpK0RfSsMg#;*5h+?q(V`+neyCKDAIkTxeb&mXJu_eb`kv?er}25$yY_ka zT6>+n&g@CT2t!IIHSptwrsAunH-0sBT;Kg4_kOi^_p5si`=Has!@Pp3Mq`Z`V~m;9 zC(#sSzdGT<$WU;-39dA+W6aON1Htvdm(??7IqBdq#>bi&v#;0~{~Tj>bvEW>;3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