forked from mozilla/MozStumbler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
80 lines (65 loc) · 1.96 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
apply plugin: 'eclipse'
dependencies {
compile 'com.google.android.gms:play-services:3.2.25'
}
android {
compileSdkVersion 19
buildToolsVersion '19'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
signingConfigs {
release
}
buildTypes {
debug {
jniDebugBuild true
}
release {
debuggable true
runProguard true
proguardFile 'proguard.cfg'
signingConfig signingConfigs.release
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}
tasks.withType(JavaCompile) {
options.compilerArgs = ['-Xlint:all', '-Werror', '-Xlint:-deprecation']
}
if (hasProperty('StoreFile')) {
android.signingConfigs.release.storeFile = file(StoreFile)
android.signingConfigs.release.storePassword = StorePassword
android.signingConfigs.release.keyAlias = KeyAlias
android.signingConfigs.release.keyPassword = KeyPassword
} else {
android.buildTypes.release.signingConfig = null
}
// Generate AndroidManifest.xml
String googleAPIKey = hasProperty('GoogleAPIKey') ? GoogleAPIKey : (hasProperty('APIKey') ? APIKey : "FAKE_GOOGLE_API_KEY");
String hasadnaAPIKey = hasProperty('MozAPIKey') ? MozAPIKey : "FAKE_HASADNA_API_KEY";
File manifest = file("./AndroidManifest.xml.in")
String content = manifest.getText('UTF-8')
content = content.replaceAll(/MY_GOOGLE_API_KEY/, googleAPIKey)
content = content.replaceAll(/MY_HASADNA_API_KEY/, hasadnaAPIKey)
manifest = file("./AndroidManifest.xml")
manifest.write(content, 'UTF-8')