|
@@ -4,10 +4,9 @@ apply plugin: 'com.android.application'
|
|
|
apply plugin: 'kotlin-android'
|
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
apply plugin: 'kotlin-kapt'
|
|
|
+apply plugin: 'com.github.zellius.shortcut-helper'
|
|
|
|
|
|
-if (file("custom.gradle").exists()) {
|
|
|
- apply from: "custom.gradle"
|
|
|
-}
|
|
|
+shortcutHelper.filePath = './shortcuts.xml'
|
|
|
|
|
|
ext {
|
|
|
// Git is needed in your system PATH for these commands to work.
|
|
@@ -31,7 +30,7 @@ ext {
|
|
|
|
|
|
android {
|
|
|
compileSdkVersion 26
|
|
|
- buildToolsVersion "26.0.1"
|
|
|
+ buildToolsVersion "26.0.2"
|
|
|
publishNonDefault true
|
|
|
|
|
|
defaultConfig {
|
|
@@ -68,15 +67,20 @@ android {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ flavorDimensions "default"
|
|
|
+
|
|
|
productFlavors {
|
|
|
standard {
|
|
|
buildConfigField "boolean", "INCLUDE_UPDATER", "true"
|
|
|
+ dimension "default"
|
|
|
}
|
|
|
fdroid {
|
|
|
+ dimension "default"
|
|
|
}
|
|
|
dev {
|
|
|
minSdkVersion 21
|
|
|
resConfigs "en", "xxhdpi"
|
|
|
+ dimension "default"
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -247,38 +251,3 @@ kotlin {
|
|
|
coroutines 'enable'
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// add support for placeholders in resource files
|
|
|
-//https://code.google.com/p/android/issues/detail?id=69224
|
|
|
-def replacePlaceholdersInFile(basePath, fileName, placeholders) {
|
|
|
- def file = new File(basePath, fileName);
|
|
|
-
|
|
|
- if (!file.exists()) {
|
|
|
- logger.quiet("Unable to replace placeholders in " + file.toString() + ". File cannot be found.")
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- logger.debug("Replacing placeholders in " + file.toString())
|
|
|
- logger.debug("Placeholders: " + placeholders.toString())
|
|
|
-
|
|
|
- def content = file.getText('UTF-8')
|
|
|
-
|
|
|
- placeholders.each { entry ->
|
|
|
- content = content.replaceAll("\\\$\\{${entry.key}\\}", entry.value)
|
|
|
- }
|
|
|
-
|
|
|
- file.write(content, 'UTF-8')
|
|
|
-}
|
|
|
-
|
|
|
-afterEvaluate {
|
|
|
- android.applicationVariants.all { variant ->
|
|
|
- variant.outputs.each { output ->
|
|
|
- output.processResources.doFirst {
|
|
|
- // prepare placeholder map from manifestPlaceholders including applicationId placeholder
|
|
|
- def placeholders = variant.mergedFlavor.manifestPlaceholders + [applicationId: variant.applicationId]
|
|
|
-
|
|
|
- replacePlaceholdersInFile(resDir, 'xml-v25/shortcuts.xml', placeholders)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|