-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuild.gradle
159 lines (136 loc) · 4.25 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
buildscript {
apply from: 'gradle/dependencies.gradle'
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.1'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.2' // 3.9.0
classpath 'com.github.ben-manes:gradle-versions-plugin:0.51.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'com.github.triplet.play'
apply plugin: 'com.github.ben-manes.versions'
android {
compileSdkVersion buildConfig.compileSdk
namespace 'burrows.apps.example.template'
defaultConfig {
applicationId 'burrows.apps.example.template'
versionCode 1
versionName '1.0'
minSdkVersion buildConfig.minSdk
targetSdkVersion buildConfig.targetSdk
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
resConfigs 'en'
vectorDrawables.useSupportLibrary = true
}
signingConfigs {
debug {
storeFile file('config/debug.keystore')
storePassword buildConfig.signing.password
keyAlias buildConfig.signing.alias
keyPassword buildConfig.signing.password
}
}
buildTypes {
release {
minifyEnabled false
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
proguardFile 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
lintOptions {
textReport true
textOutput 'stdout'
checkAllWarnings true
warningsAsErrors true
lintConfig = file('config/lint.xml')
checkReleaseBuilds = false
checkTestSources = true
}
testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
}
dependencies {
implementation deps.material
implementation deps.androidx.cardview
implementation deps.gps.ads
implementation deps.gps.basement
implementation deps.gps.base
androidTestImplementation deps.androidx.test.runner
androidTestImplementation deps.androidx.test.rules
androidTestImplementation deps.androidx.test.espresso.core
androidTestImplementation deps.androidx.test.espresso.intents
androidTestImplementation deps.androidx.test.espresso.contrib
androidTestImplementation deps.androidx.test.ext.junit
testImplementation deps.androidx.test.runner
testImplementation deps.androidx.test.rules
testImplementation deps.androidx.test.espresso.core
testImplementation deps.androidx.test.ext.junit
testImplementation deps.junit
testImplementation deps.mockito.inline
testImplementation deps.robolectric
testImplementation deps.assertj
}
play {
serviceAccountEmail = '[email protected]'
pk12File = file('config/key.p12')
track = 'production' // or 'beta' or 'alpha'
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
configure(options) {
compilerArgs << '-Xlint:all' // Turn on all warnings
compilerArgs << '-Xlint:-options' // Turn off 'missing' bootclasspath warning
compilerArgs << '-Xlint:-classfile' // Espresso
encoding = 'utf-8'
}
}
tasks.withType(Test).configureEach {
testLogging {
exceptionFormat 'full'
showCauses true
showExceptions true
showStackTraces true
events = ['failed', 'skipped']
}
failFast = true
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
tasks.configureEach { task ->
if (task instanceof JavaForkOptions) {
// should improve memory on a 64bit JVM
task.jvmArgs("-XX:+UseCompressedOops")
// should avoid GradleWorkerMain to steal focus
task.jvmArgs("-Djava.awt.headless=true")
task.jvmArgs("-Dapple.awt.UIElement=true")
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}
tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}