Delete Tor binaries when cleaning.

This commit is contained in:
akwizgran
2018-10-30 13:06:06 +00:00
parent 6565172e10
commit d29812a42b
2 changed files with 42 additions and 8 deletions

View File

@@ -43,9 +43,26 @@ dependencies {
testImplementation "org.hamcrest:hamcrest-core:1.3" testImplementation "org.hamcrest:hamcrest-core:1.3"
} }
project.afterEvaluate { def torBinariesDir = 'src/main/res/raw'
task unpackTorBinaries {
outputs.dir torBinariesDir
doLast {
copy { copy {
from configurations.tor.collect { zipTree(it) } from configurations.tor.collect { zipTree(it) }
into 'src/main/res/raw' into torBinariesDir
} }
} }
}
tasks.withType(JavaCompile) {
dependsOn unpackTorBinaries
}
task cleanTorBinaries {
doLast {
delete fileTree(torBinariesDir) { include '*.zip' }
}
}
clean.dependsOn cleanTorBinaries

View File

@@ -32,12 +32,29 @@ dependencies {
testApt 'com.google.dagger:dagger-compiler:2.0.2' testApt 'com.google.dagger:dagger-compiler:2.0.2'
} }
project.afterEvaluate { def torBinariesDir = 'src/main/resources'
task unpackTorBinaries {
outputs.dir torBinariesDir
doLast {
copy { copy {
from configurations.tor.collect { zipTree(it) } from configurations.tor.collect { zipTree(it) }
into 'src/main/resources' into torBinariesDir
} }
} }
}
tasks.withType(JavaCompile) {
dependsOn unpackTorBinaries
}
task cleanTorBinaries {
doLast {
delete fileTree(torBinariesDir) { include '*.zip' }
}
}
clean.dependsOn cleanTorBinaries
tasks.withType(Test) { tasks.withType(Test) {
systemProperty 'java.library.path', 'libs' systemProperty 'java.library.path', 'libs'