forked from phonegap/phonegap-plugin-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.gradle
36 lines (32 loc) · 953 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
import java.util.regex.Pattern
def doExtractStringFromManifest(name) {
def manifestFile = file("AndroidManifest.xml")
if (!manifestFile.exists()) {
manifestFile = file("src/main/AndroidManifest.xml")
}
def pattern = Pattern.compile(name + "=\"(.*?)\"")
def matcher = pattern.matcher(manifestFile.getText())
matcher.find()
return matcher.group(1)
}
android {
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
}