build.gradle 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'witness'
  3. apply from: 'witness.gradle'
  4. android {
  5. compileSdkVersion 33
  6. buildToolsVersion '33.0.0'
  7. packagingOptions {
  8. doNotStrip '**/*.so'
  9. }
  10. defaultConfig {
  11. minSdkVersion 16
  12. targetSdkVersion 31
  13. versionCode 10423
  14. versionName "1.4.23"
  15. consumerProguardFiles 'proguard-rules.txt'
  16. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  17. testInstrumentationRunnerArguments disableAnalytics: 'true'
  18. }
  19. compileOptions {
  20. sourceCompatibility JavaVersion.VERSION_1_8
  21. targetCompatibility JavaVersion.VERSION_1_8
  22. }
  23. lintOptions {
  24. // FIXME
  25. warning "LintError"
  26. warning "InvalidPackage"
  27. warning "MissingPermission"
  28. warning "InlinedApi", "ObsoleteSdkInt", "Override", "NewApi", "UnusedAttribute"
  29. }
  30. }
  31. configurations {
  32. tor
  33. }
  34. dependencies {
  35. // In theory this dependency shouldn't be needed, but without it Android Studio's linter will
  36. // complain about unresolved symbols for bramble-api test classes in bramble-android tests,
  37. // even though the bramble-api test classes are provided by the testImplementation dependency
  38. // below and the compiler can find them
  39. implementation project(':bramble-api')
  40. implementation project(':bramble-core')
  41. implementation 'androidx.annotation:annotation:1.5.0'
  42. tor "org.briarproject:tor-android:$tor_version"
  43. tor "org.briarproject:obfs4proxy-android:$obfs4proxy_version"
  44. tor "org.briarproject:snowflake-android:$snowflake_version"
  45. annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
  46. compileOnly 'javax.annotation:jsr250-api:1.0'
  47. testImplementation project(path: ':bramble-api', configuration: 'testOutput')
  48. testImplementation "junit:junit:$junit_version"
  49. testImplementation "org.jmock:jmock:$jmock_version"
  50. testImplementation "org.jmock:jmock-junit4:$jmock_version"
  51. testImplementation "org.jmock:jmock-imposters:$jmock_version"
  52. }
  53. def torLibsDir = 'src/main/jniLibs'
  54. task cleanTorBinaries {
  55. outputs.dir torLibsDir
  56. doLast {
  57. delete fileTree(torLibsDir)
  58. }
  59. }
  60. clean.dependsOn cleanTorBinaries
  61. task unpackTorBinaries {
  62. outputs.dir torLibsDir
  63. doLast {
  64. copy {
  65. from configurations.tor.collect { zipTree(it) }
  66. into torLibsDir
  67. }
  68. }
  69. dependsOn cleanTorBinaries
  70. }
  71. preBuild.dependsOn unpackTorBinaries