mirror of
https://github.com/gsantner/dandelion
synced 2025-09-09 18:29:47 +02:00
Update Gradle to 3.0/4.1 ; SDK 27
This commit is contained in:
parent
496faa7945
commit
cb811d8236
7 changed files with 158 additions and 131 deletions
111
app/build.gradle
111
app/build.gradle
|
@ -2,40 +2,46 @@ apply plugin: 'com.android.application'
|
|||
|
||||
ext {
|
||||
version_sdk = [
|
||||
compileSdk : 24,
|
||||
buildTools : "26.0.1",
|
||||
minSdk : 17,
|
||||
//targetSdk: compileSdk,
|
||||
compileSdk: 27,
|
||||
minSdk : 17,
|
||||
]
|
||||
version_sdk.targetSdk = version_sdk.compileSdk
|
||||
version_lib = [
|
||||
appcompat : "24.1.0", // Broken after 24.1.0, Fix announced at 26.0.0, but still not fixed... See https://issuetracker.google.com/issues/37118105
|
||||
butterknife : "8.4.0",
|
||||
netcipher : "2.0.0-alpha1",
|
||||
appcompat: "27.0.0",
|
||||
butterknife: "8.8.1",
|
||||
netcipher: "2.0.0-alpha1",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
android {
|
||||
compileSdkVersion version_sdk.compileSdk
|
||||
buildToolsVersion version_sdk.buildTools
|
||||
flavorDimensions "default"
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion version_sdk.minSdk
|
||||
targetSdkVersion version_sdk.targetSdk
|
||||
|
||||
versionCode 27
|
||||
versionName "1.0.7"
|
||||
|
||||
applicationId "com.github.dfa.diaspora_android"
|
||||
resValue 'string', 'app_name', "dandelion*"
|
||||
manifestPlaceholders = [appIcon: "@drawable/ic_launcher"]
|
||||
|
||||
targetSdkVersion version_sdk.compileSdk
|
||||
buildConfigField "boolean", "IS_TEST_BUILD", "false"
|
||||
buildConfigField "boolean", "IS_GPLAY_BUILD", "false"
|
||||
buildConfigField("String[]", "APPLICATION_LANGUAGES", '{' + getUsedAndroidLanguages().collect {"\"${it}\""}.join(",") + '}')
|
||||
buildConfigField("String[]", "APPLICATION_LANGUAGES", '{' + getUsedAndroidLanguages().collect {
|
||||
"\"${it}\""
|
||||
}.join(",") + '}')
|
||||
buildConfigField "String", "GITHASH", "\"${getGitHash()}\""
|
||||
|
||||
applicationId "com.github.dfa.diaspora_android"
|
||||
versionName "1.0.7"
|
||||
versionCode 27
|
||||
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
resValue 'string', 'app_name', "dandelion*"
|
||||
manifestPlaceholders = [appIcon: "@drawable/ic_launcher"]
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
|
@ -46,13 +52,9 @@ android {
|
|||
productFlavors {
|
||||
flavorDefault {
|
||||
}
|
||||
|
||||
/*
|
||||
flavorGplay {
|
||||
/*flavorGplay {
|
||||
buildConfigField "boolean", "IS_GPLAY_BUILD", "true"
|
||||
}
|
||||
*/
|
||||
|
||||
}*/
|
||||
flavorTest {
|
||||
applicationId "com.github.dfa.secondlion"
|
||||
resValue 'string', 'app_name', "secondlion*"
|
||||
|
@ -69,61 +71,26 @@ android {
|
|||
|
||||
dependencies {
|
||||
// Sub-Projects
|
||||
//compile project(':subprojectFromRoot')
|
||||
//implementation project(':subprojectFromRoot')
|
||||
|
||||
// Jars
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testCompile 'junit:junit:4.12'
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
testImplementation 'junit:junit:4.12'
|
||||
|
||||
// Android standard libs
|
||||
compile "com.android.support:appcompat-v7:${version_lib.appcompat}"
|
||||
compile "com.android.support:design:${version_lib.appcompat}"
|
||||
compile "com.android.support:support-v4:${version_lib.appcompat}"
|
||||
compile "com.android.support:customtabs:${version_lib.appcompat}"
|
||||
compile "com.android.support:cardview-v7:${version_lib.appcompat}"
|
||||
implementation "com.android.support:appcompat-v7:${version_lib.appcompat}"
|
||||
implementation "com.android.support:design:${version_lib.appcompat}"
|
||||
implementation "com.android.support:support-v4:${version_lib.appcompat}"
|
||||
implementation "com.android.support:customtabs:${version_lib.appcompat}"
|
||||
implementation "com.android.support:cardview-v7:${version_lib.appcompat}"
|
||||
|
||||
// UI libraries
|
||||
compile "com.github.DASAR:ShiftColorPicker:v0.5"
|
||||
implementation "com.github.DASAR:ShiftColorPicker:v0.5"
|
||||
|
||||
// Tool libraries
|
||||
compile "com.jakewharton:butterknife:${version_lib.butterknife}"
|
||||
compile "info.guardianproject.netcipher:netcipher:${version_lib.netcipher}"
|
||||
compile "info.guardianproject.netcipher:netcipher-webkit:${version_lib.netcipher}"
|
||||
implementation "com.jakewharton:butterknife:${version_lib.butterknife}"
|
||||
implementation "info.guardianproject.netcipher:netcipher:${version_lib.netcipher}"
|
||||
implementation "info.guardianproject.netcipher:netcipher-webkit:${version_lib.netcipher}"
|
||||
|
||||
annotationProcessor "com.jakewharton:butterknife-compiler:${version_lib.butterknife}"
|
||||
}
|
||||
|
||||
@SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection"])
|
||||
static String[] getUsedAndroidLanguages() {
|
||||
Set<String> langs = new HashSet<>()
|
||||
new File('.').eachFileRecurse(groovy.io.FileType.DIRECTORIES) {
|
||||
final foldername = it.name
|
||||
if (foldername.startsWith('values-') && !it.canonicalPath.contains("build" + File.separator + "intermediates")) {
|
||||
new File(it.toString()).eachFileRecurse(groovy.io.FileType.FILES) {
|
||||
if (it.name.toLowerCase().endsWith(".xml") && it.getCanonicalFile().getText('UTF-8').contains("<string")) {
|
||||
langs.add(foldername.replace("values-", ""))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return langs.toArray(new String[langs.size()])
|
||||
}
|
||||
|
||||
// #####################
|
||||
// Groovy Coding Area
|
||||
// #####################
|
||||
final String RAW_DIR = "app/src/main/res/raw"
|
||||
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "LICENSE.md", "CHANGELOG.md", "CONTRIBUTORS.md"]
|
||||
|
||||
// Called before building
|
||||
task copyRepoFiles(type: Copy) {
|
||||
|
||||
// Copy files over to raw dir
|
||||
from rootProject.files(ROOT_TO_RAW_COPYFILES)
|
||||
into RAW_DIR.replaceFirst("app/", "")
|
||||
rename { String fileName ->
|
||||
fileName.replace(fileName, fileName.toLowerCase())
|
||||
}
|
||||
}
|
||||
tasks.copyRepoFiles.execute()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue