build.gradle 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. apply plugin: 'java-library'
  2. sourceCompatibility = 1.8
  3. targetCompatibility = 1.8
  4. apply plugin: 'idea'
  5. apply plugin: 'witness'
  6. apply from: 'witness.gradle'
  7. apply from: '../dagger.gradle'
  8. configurations {
  9. tor
  10. }
  11. dependencies {
  12. implementation project(path: ':bramble-core', configuration: 'default')
  13. implementation fileTree(dir: 'libs', include: '*.jar')
  14. implementation 'net.java.dev.jna:jna:4.5.2'
  15. implementation 'net.java.dev.jna:jna-platform:4.5.2'
  16. tor 'org.briarproject:tor:0.3.5.10@zip'
  17. tor 'org.briarproject:obfs4proxy:0.0.7@zip'
  18. annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
  19. testImplementation project(path: ':bramble-api', configuration: 'testOutput')
  20. testImplementation project(path: ':bramble-core', configuration: 'testOutput')
  21. testImplementation 'junit:junit:4.12'
  22. testImplementation "org.jmock:jmock:2.8.2"
  23. testImplementation "org.jmock:jmock-junit4:2.8.2"
  24. testImplementation "org.jmock:jmock-legacy:2.8.2"
  25. testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.24'
  26. }
  27. def torBinariesDir = 'src/main/resources'
  28. task cleanTorBinaries {
  29. doLast {
  30. delete fileTree(torBinariesDir) { include '*.zip' }
  31. }
  32. }
  33. clean.dependsOn cleanTorBinaries
  34. task unpackTorBinaries {
  35. doLast {
  36. copy {
  37. from configurations.tor.collect { zipTree(it) }
  38. into torBinariesDir
  39. }
  40. }
  41. dependsOn cleanTorBinaries
  42. }
  43. processResources {
  44. inputs.dir torBinariesDir
  45. dependsOn unpackTorBinaries
  46. }
  47. tasks.withType(Test) {
  48. systemProperty 'java.library.path', 'libs'
  49. }