Update build.gradle

First step towards migrating to Gradle 3.0, changed all `compile`'s to `implementation`. Tests show only marginally faster compilation and no ill effects. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

Changed all `'` to `"` for consistency.

Also made a few whitespace changes and removed an unnecessary `;`
This commit is contained in:
Taavi 2018-03-20 19:44:23 +02:00 committed by Andreas Shimokawa
parent d2c952ffa5
commit f8f248ec4e

View File

@ -1,14 +1,13 @@
apply plugin: "com.android.application"
apply plugin: "findbugs"
apply plugin: "pmd"
apply plugin: 'com.android.application' def ABORT_ON_CHECK_FAILURE = false
apply plugin: 'findbugs'
apply plugin: 'pmd'
def ABORT_ON_CHECK_FAILURE=false
tasks.withType(Test) { tasks.withType(Test) {
systemProperty 'MiFirmwareDir', System.getProperty('MiFirmwareDir', null) systemProperty "MiFirmwareDir", System.getProperty("MiFirmwareDir", null)
systemProperty 'logback.configurationFile', System.getProperty('user.dir', null) + '/app/src/main/assets/logback.xml' systemProperty "logback.configurationFile", System.getProperty("user.dir", null) + "/app/src/main/assets/logback.xml"
systemProperty 'GB_LOGFILES_DIR', java.nio.file.Files.createTempDirectory('gblog').toString(); systemProperty "GB_LOGFILES_DIR", java.nio.file.Files.createTempDirectory("gblog").toString()
} }
android { android {
@ -18,14 +17,14 @@ android {
targetCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7
} }
compileSdkVersion 27 compileSdkVersion 27
buildToolsVersion '27.0.3' buildToolsVersion "27.0.3"
defaultConfig { defaultConfig {
applicationId "nodomain.freeyourgadget.gadgetbridge" applicationId "nodomain.freeyourgadget.gadgetbridge"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 27 targetSdkVersion 27
// note: always bump BOTH versionCode and versionName! // Note: always bump BOTH versionCode and versionName!
versionName "0.25.0" versionName "0.25.0"
versionCode 124 versionCode 124
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
@ -33,17 +32,16 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
} }
} }
lintOptions { lintOptions {
abortOnError ABORT_ON_CHECK_FAILURE abortOnError ABORT_ON_CHECK_FAILURE
lintConfig file("${project.rootDir}/config/lint/lint.xml") lintConfig file("${project.rootDir}/config/lint/lint.xml")
// If true, generate an HTML report (with issue explanations, sourcecode, etc)
// if true, generate an HTML report (with issue explanations, sourcecode, etc)
htmlReport true htmlReport true
// optional path to report (default will be lint-results.html in the builddir) // Optional path to report (default will be lint-results.html in the builddir)
htmlOutput file("$project.buildDir/reports/lint/lint.html") htmlOutput file("$project.buildDir/reports/lint/lint.html")
} }
@ -53,76 +51,77 @@ android {
} }
pmd { pmd {
toolVersion = '5.5.5' toolVersion = "5.5.5"
} }
dependencies { dependencies {
// testCompile 'ch.qos.logback:logback-classic:1.1.3' // testImplementation "ch.qos.logback:logback-classic:1.1.3"
// testCompile 'ch.qos.logback:logback-core:1.1.3' // testImplementation "ch.qos.logback:logback-core:1.1.3"
testCompile 'junit:junit:4.12' testImplementation "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.19" testImplementation "org.mockito:mockito-core:1.10.19"
testCompile "org.robolectric:robolectric:3.5.1" testImplementation "org.robolectric:robolectric:3.5.1"
compile fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: "libs", include: ["*.jar"])
compile 'com.android.support:appcompat-v7:27.0.2' implementation "com.android.support:appcompat-v7:27.0.2"
compile 'com.android.support:cardview-v7:27.0.2' implementation "com.android.support:cardview-v7:27.0.2"
compile 'com.android.support:recyclerview-v7:27.0.2' implementation "com.android.support:recyclerview-v7:27.0.2"
compile 'com.android.support:support-v4:27.0.2' implementation "com.android.support:support-v4:27.0.2"
compile 'com.android.support:gridlayout-v7:27.0.2' implementation "com.android.support:gridlayout-v7:27.0.2"
compile 'com.android.support:design:27.0.2' implementation "com.android.support:design:27.0.2"
compile 'com.android.support:palette-v7:27.0.2' implementation "com.android.support:palette-v7:27.0.2"
compile('com.github.tony19:logback-android-classic:1.1.1-6') { implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
exclude group: 'com.google.android', module: 'android' exclude group: "com.google.android", module: "android"
} }
compile 'org.slf4j:slf4j-api:1.7.12' implementation "org.slf4j:slf4j-api:1.7.12"
compile 'com.github.Freeyourgadget:MPAndroidChart:5e5bd6c1d3e95c515d4853647ae554e48ee1d593' implementation "com.github.Freeyourgadget:MPAndroidChart:5e5bd6c1d3e95c515d4853647ae554e48ee1d593"
compile 'com.github.pfichtner:durationformatter:0.1.1' implementation "com.github.pfichtner:durationformatter:0.1.1"
compile 'de.cketti.library.changelog:ckchangelog:1.2.2' implementation "de.cketti.library.changelog:ckchangelog:1.2.2"
compile 'net.e175.klaus:solarpositioning:0.0.9' implementation "net.e175.klaus:solarpositioning:0.0.9"
// use pristine greendao instead of our custom version, since our custom jitpack-packaged // use pristine greendao instead of our custom version, since our custom jitpack-packaged
// version contains way too much and our custom patches are in the generator only. // version contains way too much and our custom patches are in the generator only.
compile 'org.greenrobot:greendao:2.2.1' implementation "org.greenrobot:greendao:2.2.1"
compile 'org.apache.commons:commons-lang3:3.5' implementation "org.apache.commons:commons-lang3:3.5"
compile 'org.cyanogenmod:platform.sdk:6.0' implementation "org.cyanogenmod:platform.sdk:6.0"
// compile project(":DaoCore") // implementation project(":DaoCore")
} }
preBuild.dependsOn(":GBDaoGenerator:genSources") preBuild.dependsOn(":GBDaoGenerator:genSources")
gradle.beforeProject { gradle.beforeProject {
preBuild.dependsOn(":GBDaoGenerator:genSources") preBuild.dependsOn(":GBDaoGenerator:genSources")
} }
check.dependsOn 'findbugs', 'pmd', 'lint' check.dependsOn "findbugs", "pmd", "lint"
task pmd(type: Pmd) { task pmd(type: Pmd) {
ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml") ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml")
ignoreFailures = !ABORT_ON_CHECK_FAILURE ignoreFailures = !ABORT_ON_CHECK_FAILURE
ruleSets = [ ruleSets = [
'java-android', "java-android",
'java-basic', "java-basic",
'java-braces', "java-braces",
'java-clone', "java-clone",
'java-codesize', "java-codesize",
'java-controversial', "java-controversial",
'java-coupling', "java-coupling",
'java-design', "java-design",
'java-empty', "java-empty",
'java-finalizers', "java-finalizers",
'java-imports', "java-imports",
'java-junit', "java-junit",
'java-optimizations', "java-optimizations",
'java-strictexception', "java-strictexception",
'java-strings', "java-strings",
'java-sunsecure', "java-sunsecure",
'java-typeresolution', "java-typeresolution",
'java-unnecessary', "java-unnecessary",
'java-unusedcode' "java-unusedcode"
] ]
source 'src' source "src"
include '**/*.java' include "**/*.java"
exclude '**/gen/**' exclude "**/gen/**"
reports { reports {
xml.enabled = false xml.enabled = false
@ -142,7 +141,7 @@ task findbugs(type: FindBugs) {
reportLevel = "medium" reportLevel = "medium"
excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml") excludeFilter = new File("${project.rootDir}/config/findbugs/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes") classes = files("${project.rootDir}/app/build/intermediates/classes")
source = fileTree('src/main/java/') source = fileTree("src/main/java/")
classpath = files() classpath = files()
reports { reports {
xml.enabled = false xml.enabled = false