-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.gradle
39 lines (34 loc) · 974 Bytes
/
push.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
import java.util.regex.Pattern
def doExtractStringFromManifest(name) {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
def pattern = Pattern.compile(name + "=\"(.*?)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return matcher.group(1)
}
android {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}
defaultConfig {
multiDexEnabled true
applicationId = doExtractStringFromManifest("package")
}
}
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.0.0'
}
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}