forked from wordpress-mobile/WordPress-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
181 lines (157 loc) · 5.98 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.github.nrudenko:gradle-android-cq-plugin:0.1+'
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:+'
}
}
repositories {
mavenCentral()
maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
maven { url 'http://download.crashlytics.com/maven' }
maven { url "http://simperium.github.io/simperium-android" }
}
apply plugin: 'android'
apply plugin: 'android-cq'
apply plugin: 'crashlytics'
dependencies {
compile 'com.crashlytics.android:crashlytics:+'
}
android {
useOldManifestMerger true
lintOptions {
quiet true
abortOnError false
}
packagingOptions {
exclude "META-INF/LICENSE.txt"
exclude "META-INF/NOTICE.txt"
}
buildTypes {
release {
buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.playstore\""
buildConfigField "String", "STATS_PROVIDER_AUTHORITY", "\"org.wordpress.android.providers.StatsContentProvider\""
}
debug {
buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.debug.build\""
buildConfigField "String", "STATS_PROVIDER_AUTHORITY", "\"org.wordpress.android.providers.StatsContentProvider\""
}
zbetagroup {
buildConfigField "String", "APP_PN_KEY", "\"org.wordpress.android.beta.build\""
buildConfigField "String", "STATS_PROVIDER_AUTHORITY", "\"org.wordpress.android.providers.StatsContentProviderBeta\""
applicationIdSuffix ".beta"
}
}
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "org.wordpress.android"
versionName "3.0-beta-3"
versionCode 120
minSdkVersion 14
targetSdkVersion 19
}
dependencies {
// Provided by maven central
compile 'com.google.code.gson:gson:2.2.2'
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
compile 'com.android.support:support-v13:19.0.+'
compile 'com.github.castorflex.smoothprogressbar:library:0.4.0'
compile 'com.github.chrisbanes.photoview:library:1.2.3'
compile 'net.simonvt.menudrawer:menudrawer:3.0.6'
compile 'com.mcxiaoke.volley:library:1.0.+'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.+'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
androidTestCompile 'org.objenesis:objenesis:2.1'
androidTestCompile 'org.mockito:mockito-core:+'
// These are provided by the WordPress-Android Repository
compile 'org.wordpress:gcm:1.0.0'
compile 'com.automattic:wordpresscom-rest:0.0.5'
compile 'org.wordpress:httpmime:4.1.2'
compile 'org.wordpress:graphview:3.1.1'
compile 'org.wordpress:drag-sort-listview:0.6.1'
compile 'org.wordpress:slidinguppanel:1.0.0'
compile 'org.wordpress:android-passcodelock:0.0.5'
compile 'org.wordpress:commons-lang:2.6'
compile 'org.wordpress:pulltorefresh-main:+'
releaseCompile 'org.wordpress:emailchecker:0.2'
debugCompile 'org.wordpress:emailchecker-debug:0.2'
zbetagroupCompile 'org.wordpress:emailchecker:0.2'
// Simperium
compile('com.simperium:simperium-android:0.4.8') {
exclude group: 'com.android', module: 'volley'
}
// Local dependencies
compile files('libs/MixpanelAPI.jar')
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
release {
manifest.srcFile 'AndroidManifestReleaseAndDebug.xml'
}
debug {
manifest.srcFile 'AndroidManifestReleaseAndDebug.xml'
}
zbetagroup {
res.srcDirs = ['res-zbetagroup']
manifest.srcFile 'AndroidManifestBetagroup.xml'
}
androidTest.setRoot('tests')
}
} // end android
task generateCrashlyticsConfig(group: "generate", description: "Generate Crashlytics config") {
def outputFile = new File("${rootDir}/crashlytics.properties")
def inputFile = file("${rootDir}/gradle.properties")
outputs.file outputFile
inputs.file inputFile
doLast {
def properties = new Properties()
inputFile.withInputStream { stream ->
properties.load(stream)
}
def crashlyticsApiKey = properties.getProperty('crashlytics.apikey', '0')
def writer = new FileWriter(outputFile)
writer.write("""// auto-generated file from ${rootDir}/gradle.properties do not modify
apiKey=${crashlyticsApiKey}""")
writer.close()
}
}
// Add the generateWPConfig task to every buildType's compile tasks
android.buildTypes.all { buildType ->
project.properties.any { property ->
if (property.key.toLowerCase().startsWith("wp.")) {
buildType.buildConfigField "String", property.key.replace("wp.", "").replace(".", "_").toUpperCase(),
"\"${property.value}\""
}
}
def name = "generate${buildType.name.capitalize()}BuildConfig"
tasks.whenTaskAdded { task ->
if (task.name == name) {
task.dependsOn(generateCrashlyticsConfig)
}
}
}
// For app signing
if (["storeFile", "storePassword", "keyAlias", "keyPassword"].count { !project.hasProperty(it) } == 0) {
android {
signingConfigs {
release {
storeFile = file(project.storeFile)
storePassword = project.storePassword
keyAlias = project.keyAlias
keyPassword = project.keyPassword
}
}
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
android.buildTypes.zbetagroup.signingConfig = android.signingConfigs.release
}