-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
83 lines (73 loc) · 1.76 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
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.deploygate:gradle:1.1.5'
}
}
apply plugin: 'deploygate'
apply plugin: 'com.android.application'
File lp = project.rootProject.file('local.properties')
if (lp.exists()) {
Properties properties = new Properties()
properties.load(lp.newDataInputStream())
project.ext.set("sdkDir", properties.getProperty('sdk.dir'))
}
else {
project.ext.set("sdkDir", System.getenv("ANDROID_HOME"))
}
allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
}
def gitLastCommit() {
return 'git log -1 --no-merges --pretty=oneline --abbrev-commit'.execute().text.trim()
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
signingConfigs {
release {
storeFile file("postcode.keystore")
storePassword "android"
keyAlias "mykey"
keyPassword "android"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
flavorDimensions "standard"
productFlavors {
production {
dimension "standard"
}
dogfood {
dimension "standard"
versionName "DF-${gitSha()}"
buildToolsVersion "28.0.3"
}
}
variantFilter { variant ->
if (variant.buildType.name.equals('release')
&& variant.getFlavors().get(0).name.equals('dogfood')) {
variant.setIgnore(true);
}
}
}
task(runTest, dependsOn: 'assembleDogfood', type: JavaExec) {
main = 'net.tevp.postcode.PostcodeBackend'
classpath = files( 'build/intermediates/classes/dogfood/debug/', 'json.jar', project.sdkDir + '/platforms/android-28/android.jar')
args '51.5269721','-0.0836098'
}