build.gradle 1.82 KB
Newer Older
1
2
import com.android.build.gradle.tasks.MergeResources

akwizgran's avatar
akwizgran committed
3
4
apply plugin: 'com.android.library'
apply plugin: 'witness'
5
apply from: 'witness.gradle'
akwizgran's avatar
akwizgran committed
6
7

android {
8
9
	compileSdkVersion 29
	buildToolsVersion '29.0.2'
akwizgran's avatar
akwizgran committed
10
11

	defaultConfig {
12
		minSdkVersion 16
akwizgran's avatar
akwizgran committed
13
		targetSdkVersion 28
14
15
		versionCode 10205
		versionName "1.2.5"
akwizgran's avatar
akwizgran committed
16
		consumerProguardFiles 'proguard-rules.txt'
17

18
		testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
akwizgran's avatar
akwizgran committed
19
20
21
	}

	compileOptions {
22
23
		sourceCompatibility JavaVersion.VERSION_1_8
		targetCompatibility JavaVersion.VERSION_1_8
akwizgran's avatar
akwizgran committed
24
	}
25
26
27
28
29
30
31
32

	lintOptions {
		// FIXME
		warning "LintError"
		warning "InvalidPackage"
		warning "MissingPermission"
		warning "InlinedApi", "ObsoleteSdkInt", "Override", "NewApi", "UnusedAttribute"
	}
akwizgran's avatar
akwizgran committed
33
34
}

35
36
37
38
configurations {
	tor
}

akwizgran's avatar
akwizgran committed
39
dependencies {
40
	implementation project(path: ':bramble-core', configuration: 'default')
akwizgran's avatar
akwizgran committed
41
	tor 'org.briarproject:tor-android:0.3.5.9@zip'
42
	tor 'org.briarproject:obfs4proxy-android:0.0.11-2@zip'
43

44
	annotationProcessor 'com.google.dagger:dagger-compiler:2.24'
45

46
	compileOnly 'javax.annotation:jsr250-api:1.0'
47

48
49
50
51
52
	testImplementation project(path: ':bramble-api', configuration: 'testOutput')
	testImplementation 'junit:junit:4.12'
	testImplementation "org.jmock:jmock:2.8.2"
	testImplementation "org.jmock:jmock-junit4:2.8.2"
	testImplementation "org.jmock:jmock-legacy:2.8.2"
akwizgran's avatar
akwizgran committed
53
54
}

akwizgran's avatar
akwizgran committed
55
56
def torBinariesDir = 'src/main/res/raw'

57
58
59
60
61
62
63
64
task cleanTorBinaries {
	doLast {
		delete fileTree(torBinariesDir) { include '*.zip' }
	}
}

clean.dependsOn cleanTorBinaries

akwizgran's avatar
akwizgran committed
65
66
67
68
69
task unpackTorBinaries {
	doLast {
		copy {
			from configurations.tor.collect { zipTree(it) }
			into torBinariesDir
70
71
			// TODO: Remove after next Tor upgrade, which won't include non-PIE binaries
			include 'geoip.zip', '*_pie.zip'
akwizgran's avatar
akwizgran committed
72
		}
akwizgran's avatar
akwizgran committed
73
	}
74
	dependsOn cleanTorBinaries
akwizgran's avatar
akwizgran committed
75
}
akwizgran's avatar
akwizgran committed
76

77
78
tasks.withType(MergeResources) {
	inputs.dir torBinariesDir
akwizgran's avatar
akwizgran committed
79
80
	dependsOn unpackTorBinaries
}