1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2025-09-09 02:09:41 +02:00

Update buildscript

This commit is contained in:
Gregor Santner 2018-02-06 23:11:18 +01:00
parent 8aec1aa74f
commit 3442f018e9
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
4 changed files with 34 additions and 23 deletions

View file

@ -4,18 +4,20 @@ buildscript {
ext.version_setup_compileSdk = 27
ext.version_setup_minSdk = 17
ext.version_setup_targetSdk = ext.version_setup_compileSdk
ext.version_setup_buildTools = "27.0.1" // Specifying optional
ext.version_setup_buildTools = "27.0.3" // Specifying optional
// https://developer.android.com/studio/releases/gradle-plugin.html
ext.version_gradle_tools = "3.0.1"
// https://developer.android.com/topic/libraries/support-library/revisions.html
ext.version_library_appcompat = "27.0.1"
ext.version_library_appcompat = "27.0.2"
// https://github.com/JakeWharton/butterknife/releases
ext.version_library_butterknife = "8.8.1"
// https://github.com/atlassian/commonmark-java/releases
ext.version_library_commonmark = "0.10.0"
// https://github.com/guardianproject/NetCipher/releases
ext.version_library_netcipher = "2.0.0-alpha1"
// https://github.com/JetBrains/kotlin/blob/master/ReadMe.md
ext.version_plugin_kotlin = "1.1.60"
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin#LookAtCentral
ext.version_plugin_kotlin = "1.2.10"
ext.enable_plugin_kotlin = false
repositories {
@ -23,7 +25,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "com.android.tools.build:gradle:$version_gradle_tools"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
if (project.enable_plugin_kotlin) {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_plugin_kotlin"
@ -41,18 +43,22 @@ allprojects {
mavenCentral()
maven { url "https://jitpack.io" }
}
tasks.matching { task -> task.name.matches('.*generate.*Resources') }.all {
task -> task.dependsOn copyRepoFiles
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "CHANGELOG.md", "CONTRIBUTORS.md","LICENSE.txt","LICENSE.md","LICENSE"]
final String[] ROOT_TO_RAW_COPYFILES = ["README.md", "CHANGELOG.md", "CONTRIBUTORS.md", "LICENSE.txt", "LICENSE.md", "LICENSE"]
task copyRepoFiles(type: Copy) {
from rootProject.files(ROOT_TO_RAW_COPYFILES)
into "app/src/main/res/raw"
rename { String fileName -> fileName.replace(fileName, fileName.toLowerCase()) }
}; tasks.copyRepoFiles.execute()
}
@SuppressWarnings(["UnnecessaryQualifiedReference", "SpellCheckingInspection", "GroovyUnusedDeclaration"])
@ -73,10 +79,13 @@ static String getUsedAndroidLanguages() {
}
ext.getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
try {
def stdout = new ByteArrayOutputStream() exec {
commandLine 'git', 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception e) {
return '???'
}
return stdout.toString().trim()
}