forked from mozilla/MozStumbler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
83 lines (67 loc) · 2.09 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
apply plugin: 'eclipse'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
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 mozillaAPIKey = hasProperty('MozAPIKey') ? MozAPIKey : "FAKE_MOZILLA_API_KEY";
String mapAPIKey = hasProperty('MapAPIKey') ? MapAPIKey : "FAKE_MAP_API_KEY";
String tileServerURL = hasProperty('TileServerURL') ? TileServerURL : "http://tile.openstreetmap.org/";
File manifest = file("./AndroidManifest.xml.in")
String content = manifest.getText('UTF-8')
content = content.replaceAll(/MY_MOZILLA_API_KEY/, mozillaAPIKey)
content = content.replaceAll(/MY_MAP_API_KEY/, mapAPIKey)
content = content.replaceAll(/MY_TILE_SERVER/, tileServerURL)
manifest = file("./AndroidManifest.xml")
manifest.write(content, 'UTF-8')