Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
🔧 Update gradle file for cordova-android 7
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 30, 2017
1 parent b8b38c2 commit 8e28a4e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions push.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import java.util.regex.Pattern

def doExtractStringFromManifest(name) {
def manifestFile = file(android.sourceSets.main.manifest.srcFile)
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 {
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
}
}

defaultConfig {
multiDexEnabled true
applicationId = doExtractStringFromManifest("package")
Expand Down

0 comments on commit 8e28a4e

Please sign in to comment.