mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
117 lines
2.9 KiB
Groovy
117 lines
2.9 KiB
Groovy
apply plugin: 'com.android.library'
|
|
apply plugin: 'witness'
|
|
apply from: 'witness.gradle'
|
|
|
|
android {
|
|
compileSdkVersion 33
|
|
buildToolsVersion '33.0.0'
|
|
|
|
packagingOptions {
|
|
doNotStrip '**/*.so'
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdkVersion 16
|
|
targetSdkVersion 31
|
|
versionCode 10420
|
|
versionName "1.4.20"
|
|
consumerProguardFiles 'proguard-rules.txt'
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
testInstrumentationRunnerArguments disableAnalytics: 'true'
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
lintOptions {
|
|
// FIXME
|
|
warning "LintError"
|
|
warning "InvalidPackage"
|
|
warning "MissingPermission"
|
|
warning "InlinedApi", "ObsoleteSdkInt", "Override", "NewApi", "UnusedAttribute"
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
tor
|
|
}
|
|
|
|
dependencies {
|
|
// In theory this dependency shouldn't be needed, but without it Android Studio's linter will
|
|
// complain about unresolved symbols for bramble-api test classes in bramble-android tests,
|
|
// even though the bramble-api test classes are provided by the testImplementation dependency
|
|
// below and the compiler can find them
|
|
implementation project(':bramble-api')
|
|
|
|
implementation project(':bramble-core')
|
|
|
|
implementation 'androidx.annotation:annotation:1.5.0'
|
|
|
|
tor "org.briarproject:tor-android:$tor_version"
|
|
tor "org.briarproject:obfs4proxy-android:$obfs4proxy_version"
|
|
tor "org.briarproject:snowflake-android:$snowflake_version"
|
|
|
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
|
|
|
|
compileOnly 'javax.annotation:jsr250-api:1.0'
|
|
|
|
testImplementation project(path: ':bramble-api', configuration: 'testOutput')
|
|
|
|
testImplementation "junit:junit:$junit_version"
|
|
testImplementation "org.jmock:jmock:$jmock_version"
|
|
testImplementation "org.jmock:jmock-junit4:$jmock_version"
|
|
testImplementation "org.jmock:jmock-imposters:$jmock_version"
|
|
}
|
|
|
|
def torLibsDir = 'src/main/jniLibs'
|
|
|
|
task cleanTorBinaries {
|
|
outputs.dir torLibsDir
|
|
doLast {
|
|
delete fileTree(torLibsDir) { include '**/*.so' }
|
|
}
|
|
}
|
|
|
|
clean.dependsOn cleanTorBinaries
|
|
|
|
task unpackTorBinaries {
|
|
outputs.dir torLibsDir
|
|
doLast {
|
|
configurations.tor.each { outer ->
|
|
zipTree(outer).each { inner ->
|
|
if (inner.name.endsWith('_arm_pie.zip')) {
|
|
copy {
|
|
from zipTree(inner)
|
|
into torLibsDir
|
|
rename '(.*)', 'armeabi-v7a/lib$1.so'
|
|
}
|
|
} else if (inner.name.endsWith('_arm64_pie.zip')) {
|
|
copy {
|
|
from zipTree(inner)
|
|
into torLibsDir
|
|
rename '(.*)', 'arm64-v8a/lib$1.so'
|
|
}
|
|
} else if (inner.name.endsWith('_x86_pie.zip')) {
|
|
copy {
|
|
from zipTree(inner)
|
|
into torLibsDir
|
|
rename '(.*)', 'x86/lib$1.so'
|
|
}
|
|
} else if (inner.name.endsWith('_x86_64_pie.zip')) {
|
|
copy {
|
|
from zipTree(inner)
|
|
into torLibsDir
|
|
rename '(.*)', 'x86_64/lib$1.so'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
dependsOn cleanTorBinaries
|
|
}
|
|
|
|
preBuild.dependsOn unpackTorBinaries
|