-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (103 loc) · 3.53 KB
/
build.gradle
File metadata and controls
115 lines (103 loc) · 3.53 KB
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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}
}
apply plugin: 'com.android.application'
ext.vMajor = 2
ext.vMinor = 0
ext.vBugfix = 0
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:gridlayout-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
androidTestCompile files('libs/espresso-1.1-bundled.jar')
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"
versionCode computeVersionCode()
versionName computeVersionName()
}
signingConfigs {
release {
storeFile file("src/main/assets/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
debug {
storeFile file("src/main/assets/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
sourceSets {
testLocal {
java.srcDir file('androidTest/java/')
resources.srcDir file('src/test/res')
}
}
buildTypes {
debug {
debuggable true
applicationIdSuffix ".v2.develop"
versionNameSuffix '-develop'
buildConfigField "boolean", "HOCKEY_ENABLED", "false"
buildConfigField "String", "HOCKEY_APP_ID", "\"\""
signingConfig signingConfigs.debug
buildConfigField "String", "GA_API_KEY", "\"UA-123456789-1\""
buildConfigField "String", "ENVIRONMENT", "\"demo.domain.com\""
}
alpha {
debuggable true
applicationIdSuffix ".v2.alpha"
versionNameSuffix '-alpha'
buildConfigField "boolean", "HOCKEY_ENABLED", "false"
buildConfigField "String", "HOCKEY_APP_ID", "\"\""
signingConfig signingConfigs.debug
buildConfigField "String", "GA_API_KEY", "\"UA-123456789-1\""
buildConfigField "String", "ENVIRONMENT", "\"development.domain.com\""
}
beta {
debuggable true
applicationIdSuffix ".v2.beta"
versionNameSuffix '-beta'
zipAlignEnabled true
buildConfigField "boolean", "HOCKEY_ENABLED", "false"
buildConfigField "String", "HOCKEY_APP_ID", "\"\""
signingConfig signingConfigs.release
buildConfigField "String", "GA_API_KEY", "\"UA-123456789-1\""
buildConfigField "String", "ENVIRONMENT", "\"stage.domain.com\""
}
release {
buildConfigField "boolean", "HOCKEY_ENABLED", "false"
buildConfigField "String", "HOCKEY_APP_ID", "\"\""
debuggable false
zipAlignEnabled true
signingConfig signingConfigs.release
buildConfigField "String", "GA_API_KEY", "\"UA-123456789-1\""
buildConfigField "String", "ENVIRONMENT", "\"www.domain.com\""
}
}
}
static def getBuildNumber() {
System.getenv("BUILD_NUMBER") as Integer ?: 9999
}
def computeVersionName() {
return String.format('%d.%d.%d:%d', vMajor, vMinor, vBugfix, getBuildNumber())
}
def computeVersionCode() {
return (vMajor * 10000) + (vMinor * 1000) + getBuildNumber()
}