build.gradle 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import com.android.build.gradle.tasks.MergeResources
  2. apply plugin: 'com.android.library'
  3. apply plugin: 'witness'
  4. apply from: 'witness.gradle'
  5. android {
  6. compileSdkVersion 29
  7. buildToolsVersion '29.0.2'
  8. defaultConfig {
  9. minSdkVersion 16
  10. targetSdkVersion 28
  11. versionCode 10209
  12. versionName "1.2.9"
  13. consumerProguardFiles 'proguard-rules.txt'
  14. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  15. }
  16. compileOptions {
  17. sourceCompatibility JavaVersion.VERSION_1_8
  18. targetCompatibility JavaVersion.VERSION_1_8
  19. }
  20. lintOptions {
  21. // FIXME
  22. warning "LintError"
  23. warning "InvalidPackage"
  24. warning "MissingPermission"
  25. warning "InlinedApi", "ObsoleteSdkInt", "Override", "NewApi", "UnusedAttribute"
  26. }
  27. }
  28. configurations {
  29. tor
  30. }
  31. dependencies {
  32. implementation project(path: ':bramble-core', configuration: 'default')
  33. tor 'org.briarproject:tor-android:0.3.5.10@zip'
  34. tor 'org.briarproject:obfs4proxy-android:0.0.11-2@zip'
  35. annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
  36. compileOnly 'javax.annotation:jsr250-api:1.0'
  37. testImplementation project(path: ':bramble-api', configuration: 'testOutput')
  38. testImplementation 'junit:junit:4.12'
  39. testImplementation "org.jmock:jmock:2.8.2"
  40. testImplementation "org.jmock:jmock-junit4:2.8.2"
  41. testImplementation "org.jmock:jmock-legacy:2.8.2"
  42. }
  43. def torBinariesDir = 'src/main/res/raw'
  44. task cleanTorBinaries {
  45. doLast {
  46. delete fileTree(torBinariesDir) { include '*.zip' }
  47. }
  48. }
  49. clean.dependsOn cleanTorBinaries
  50. task unpackTorBinaries {
  51. doLast {
  52. copy {
  53. from configurations.tor.collect { zipTree(it) }
  54. into torBinariesDir
  55. // TODO: Remove after next Tor upgrade, which won't include non-PIE binaries
  56. include 'geoip.zip', '*_pie.zip'
  57. }
  58. }
  59. dependsOn cleanTorBinaries
  60. }
  61. tasks.withType(MergeResources) {
  62. inputs.dir torBinariesDir
  63. dependsOn unpackTorBinaries
  64. }