From a7247e8a888506e9f744213ac3e7014e48a1c580 Mon Sep 17 00:00:00 2001 From: Skylot Date: Thu, 27 Jun 2019 11:59:25 +0300 Subject: [PATCH] build: remove unused test-app submodule --- .gitmodules | 3 -- build.gradle | 6 +--- jadx-test-app/README.md | 14 -------- jadx-test-app/build.gradle | 70 -------------------------------------- jadx-test-app/test-app | 1 - settings.gradle | 1 - 6 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 .gitmodules delete mode 100644 jadx-test-app/README.md delete mode 100644 jadx-test-app/build.gradle delete mode 160000 jadx-test-app/test-app diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index cae93fa27..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "jadx-test-app/test-app"] - path = jadx-test-app/test-app - url = git://github.com/skylot/jadx-test-app.git diff --git a/build.gradle b/build.gradle index 69b40b173..848bb81b7 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ spotless { } format 'misc', { target '**/*.gradle', '**/*.md', '**/*.xml', '**/.gitignore', '**/.properties' - targetExclude "jadx-test-app/test-app/**", ".gradle/**", ".idea/**" + targetExclude ".gradle/**", ".idea/**" lineEndings(LineEnding.UNIX) encoding("UTF-8") @@ -152,10 +152,6 @@ task samples(dependsOn: 'jadx-samples:samples') { group 'jadx' } -task testAppCheck(dependsOn: 'jadx-test-app:testAppCheck') { - group 'jadx' -} - task cleanBuildDir(type: Delete) { group 'jadx' delete buildDir diff --git a/jadx-test-app/README.md b/jadx-test-app/README.md deleted file mode 100644 index c26aef802..000000000 --- a/jadx-test-app/README.md +++ /dev/null @@ -1,14 +0,0 @@ -### Run jadx on test android application - -This module contains build scripts for test recompilation of simple android app from: -https://github.com/skylot/jadx-test-app - -For run tests type follow commands in jadx root directory: - -```java -git submodule init -git submodule update -./gradlew testAppCheck -``` - -Note: You will need connected device or emulator for success diff --git a/jadx-test-app/build.gradle b/jadx-test-app/build.gradle deleted file mode 100644 index 63c11b240..000000000 --- a/jadx-test-app/build.gradle +++ /dev/null @@ -1,70 +0,0 @@ -ext { - testAppDir = 'test-app' - testAppTmpDir = 'test-app-tmp' - - tmpBuildFile = "${testAppTmpDir}/build.gradle" - apkFile = "${testAppTmpDir}/build/outputs/apk/test-app-tmp-debug.apk" - outCodeDir = "${testAppTmpDir}/src/main" - checkTask = 'connectedCheck' -} - -dependencies { - compile(project(":jadx-cli")) -} - -task deleteTmp(type:Delete) { - delete testAppTmpDir -} - -task copyApp(type:Copy, dependsOn: deleteTmp) { - from testAppDir - into testAppTmpDir -} - -task buildApp(type:Exec, dependsOn: copyApp) { - workingDir testAppTmpDir - commandLine "./gradlew clean build ${checkTask}".split(' ') -} - -task removeSource(type:Delete, dependsOn: buildApp) { - delete outCodeDir -} - -task runJadx(type: JavaExec, dependsOn: removeSource) { - classpath = sourceSets.main.output + configurations.compile - main = project(':jadx-cli').mainClassName - args = ['-d', testAppTmpDir, apkFile, '-v', '-e'] -} - -task decompile(dependsOn: runJadx) { - doLast { - injectDependencies() - } -} - -def injectDependencies() { - def fileContent = file(tmpBuildFile).getText('UTF-8') - def updatedContent = fileContent.replaceAll( - '// some dependencies', - """ - androidTestCompile 'junit:junit:4.12' - androidTestCompile 'org.hamcrest:hamcrest-library:1.3' - """) - file(tmpBuildFile).write(updatedContent, 'UTF-8') -} - -task runChecks(type:Exec, dependsOn: decompile) { - workingDir testAppTmpDir - commandLine "./gradlew clean build ${checkTask}".split(' ') -} - -task testAppCheck(dependsOn: runChecks) { - doFirst { - def buildFile = file(buildFile) - if (!buildFile.exists() || !buildFile.isFile()) { - throw new StopExecutionException("Test app not found") - } - } -} - -clean.dependsOn deleteTmp diff --git a/jadx-test-app/test-app b/jadx-test-app/test-app deleted file mode 160000 index 2f34a777a..000000000 --- a/jadx-test-app/test-app +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2f34a777adf9c4b303e2627c95a41d28204bdc4c diff --git a/settings.gradle b/settings.gradle index 4dee6d109..cde32274a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,4 +4,3 @@ include 'jadx-core' include 'jadx-cli' include 'jadx-gui' include 'jadx-samples' -include 'jadx-test-app'