forked from pushtorefresh/storio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (115 loc) · 6.01 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import org.gradle.internal.jvm.Jvm
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
// Android Gradle plugin
classpath 'com.android.tools.build:gradle:2.2.3'
// Jacoco Test Coverage Plugin
// (addition to standard Jacoco plugin, allows us fail the build if coverage is not enough)
// https://github.com/palantir/gradle-jacoco-coverage
classpath 'com.palantir:jacoco-coverage:0.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
// Workaround for preventing Gradle from stealing focus from other apps
// https://gist.github.com/artem-zinnatullin/4c250e04636e25797165
tasks.withType(JavaForkOptions) {
jvmArgs '-Djava.awt.headless=true'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}
ext {
buildToolsVersion = '25.0.2'
compileSdkVersion = 23
minSdkVersion = 14
}
def supportLibsVersion = '23.4.0'
def daggerVersion = '2.4'
ext.libraries = [
// Core libraries
supportAnnotations : 'com.android.support:support-annotations:' + supportLibsVersion,
rxJava : 'io.reactivex:rxjava:1.2.1',
// Parts of StorIO
storIOCommon : project(':storio-common'),
storIOSQLite : project(':storio-sqlite'),
storIOContentResolver : project(':storio-content-resolver'),
storIOSQLiteAnnotations : project(':storio-sqlite-annotations'),
storIOContentResolverAnnotations : project(':storio-content-resolver-annotations'),
storIOCommonAnnotationsProcessor : project(':storio-common-annotations-processor'),
storIOSQLiteAnnotationsProcessor : project(':storio-sqlite-annotations-processor'),
storIOContentResolverAnnotationsProcessor : project(':storio-content-resolver-annotations-processor'),
storIOTestCommon : project(':storio-test-common'),
// Libraries for tests and sample app
junit : 'junit:junit:4.12',
assertJ : 'org.assertj:assertj-core:1.7.1',
assertJAndroid : 'com.squareup.assertj:assertj-android:1.0.1',
mockitoCore : 'org.mockito:mockito-core:2.7.7',
equalsVerifier : 'nl.jqno.equalsverifier:equalsverifier:1.7.2',
privateConstructorChecker : 'com.pushtorefresh.java-private-constructor-checker:checker:1.1.0',
guava : 'com.google.guava:guava:18.0',
robolectric : 'org.robolectric:robolectric:3.1.4',
googleTestingCompile : 'com.google.testing.compile:compile-testing:0.10',
dagger : 'com.google.dagger:dagger:' + daggerVersion,
daggerCompiler : 'com.google.dagger:dagger-compiler:' + daggerVersion,
javaxInject : 'javax.inject:javax.inject:1',
javaxAnnotationApi : 'javax.annotation:javax.annotation-api:1.2',
butterKnife : 'com.jakewharton:butterknife:7.0.1',
appCompat : 'com.android.support:appcompat-v7:' + supportLibsVersion,
recyclerView : 'com.android.support:recyclerview-v7:' + supportLibsVersion,
rxAndroid : 'io.reactivex:rxandroid:1.0.1',
timber : 'com.jakewharton.timber:timber:3.0.1',
leakCanary : 'com.squareup.leakcanary:leakcanary-android:1.3.1',
leakCanaryNoOp : 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1',
autoService : 'com.google.auto.service:auto-service:1.0-rc2',
javaPoet : 'com.squareup:javapoet:1.8.0',
intellijAnnotations : 'com.intellij:annotations:12.0',
runtimeJar : files(getRuntimeJar()),
toolsJar : files(Jvm.current().getToolsJar()),
autoParcel : 'com.github.frankiesardo:auto-parcel:0.3',
autoParcelProcessor : 'com.github.frankiesardo:auto-parcel-processor:0.3'
]
def getRuntimeJar() {
try {
final File javaBase = new File(System.getProperty("java.home")).getCanonicalFile();
File runtimeJar = new File(javaBase, "lib/rt.jar");
if (runtimeJar.exists()) {
return runtimeJar;
}
runtimeJar = new File(javaBase, "jre/lib/rt.jar");
return runtimeJar.exists() ? runtimeJar : null;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
// Option to disable Pre-Dexing on CI env
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ('com.android.build.gradle.AppPlugin'.equals(plugin.class.name)
|| 'com.android.build.gradle.LibraryPlugin'.equals(plugin.class.name)) {
// enable or disable pre-dexing
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
// treat all Android Lint warning in all sub-projects as errors
project.android.lintOptions.warningsAsErrors = true
// StorIO should support Java 6
project.android.compileOptions.sourceCompatibility = JavaVersion.VERSION_1_6
project.android.compileOptions.targetCompatibility = JavaVersion.VERSION_1_6
project.android.testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
exceptionFormat 'full'
}
}
}
}
}