forked from pushtorefresh/storio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
142 lines (112 loc) · 5.78 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
// 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:1.4.0-beta1'
// Resolves android-sdk dependencies
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
// APT compile-time annotation processing
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// 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'
}
project.plugins.whenPluginAdded { plugin ->
// Ignore 'debug' buildType for library projects
// Because we don't have debug-specific code and we don't need to build debug variants
// https://gist.github.com/artem-zinnatullin/ec3bce6dcb2cd524c435
if ('com.android.build.gradle.LibraryPlugin'.equals(plugin.class.name)) {
project.android.variantFilter {
if (it.buildType.name.equals('debug')) {
it.ignore = true
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
ext {
buildToolsVersion = '23'
compileSdkVersion = 23
minSdkVersion = 14
}
def supportLibsVersion = '23.0.1'
def daggerVersion = '2.0.1'
ext.libraries = [
// Core libraries
supportAnnotations : 'com.android.support:support-annotations:' + supportLibsVersion,
rxJava : 'io.reactivex:rxjava:1.0.14',
// Parts of StorIO
storIOCommon : project(':storio-common'),
storIOSQLite : project(':storio-sqlite'),
storIOContentResolver : project(':storio-content-resolver'),
storIOSQLiteAnnotation : project(':storio-sqlite-annotations'),
storIOSQLiteAnnotationProcessor: project(':storio-sqlite-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',
mockitoCore : 'org.mockito:mockito-core:1.10.19',
powerMockJUnit : 'org.powermock:powermock-module-junit4:1.6.2',
powerMockMockito : 'org.powermock:powermock-api-mockito:1.6.2',
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.0',
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',
leakCanaryNoOp : 'com.squareup.leakcanary:leakcanary-android-no-op:1.3',
autoService : 'com.google.auto.service:auto-service:1.0-rc2',
javaPoet : 'com.squareup:javapoet:1.2.0',
intellijAnnotations : 'com.intellij:annotations:12.0',
autoParcel : 'com.github.frankiesardo:auto-parcel:0.3',
autoParcelProcessor : 'com.github.frankiesardo:auto-parcel-processor:0.3'
]
// 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'
}
}
}
}
}