-
Notifications
You must be signed in to change notification settings - Fork 37
/
build.gradle
86 lines (77 loc) · 2.96 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
repositories {
jcenter()
}
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "org.wordpress.android.fluxc.example"
minSdkVersion 15
// Keep the targetSdkVersion 22 so we don't need to grant runtime permissions to the tests and the example app
// An alternative would be granting the permissions via adb before running the test, like here:
// https://afterecho.uk/blog/granting-marshmallow-permissions-for-testing-flavoured-builds.html
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
warning 'InvalidPackage'
}
}
android.buildTypes.all { buildType ->
// Add properties named "wp.xxx" to our BuildConfig
project.properties.any { property ->
if (property.key.toLowerCase().startsWith("wp.")) {
buildType.buildConfigField "String", property.key.replace("wp.", "").replace(".", "_").toUpperCase(),
"\"${property.value}\""
}
}
// Load test properties and add them to BuildConfig
Properties testProperties = new Properties()
File testFile = file("tests.properties")
if (testFile.exists()) {
testProperties.load(new InputStreamReader(new FileInputStream(testFile), "utf-8"))
} else {
// Load defaults
println("WARNING: you're using the example example/tests.properties-example file - tests won't pass")
testProperties.load(new InputStreamReader(new FileInputStream(file("tests.properties-example")), "utf-8"))
}
testProperties.any { property ->
buildType.buildConfigField "String", property.key.replace(".", "_").toUpperCase(), "\"${property.value}\""
}
}
dependencies {
compile project(':fluxc');
compile 'com.google.dagger:dagger:2.0.2'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.robolectric:robolectric:3.0'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
androidTestCompile 'org.mockito:mockito-core:1.10.19'
androidTestApt 'com.google.dagger:dagger-compiler:2.0'
apt 'com.google.dagger:dagger-compiler:2.0.2'
provided 'org.glassfish:javax.annotation:10.0-b28'
// Debug dependencies
debugCompile 'com.facebook.stetho:stetho:1.4.2'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.2'
}