From e6598922783b3ce6068b956520b05413166d7451 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 19 Sep 2019 11:19:44 -0300 Subject: [PATCH] Fix CI by running tests with newer Java version, but target JDK 8 --- .travis.yml | 8 ++++++-- app/build.gradle | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 64b5f022..be819e6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,13 @@ dist: trusty + +jdk: + - openjdk11 + language: android android: components: - - build-tools-28.0.3 - - android-28 + - build-tools-29.0.2 + - android-29 licenses: - android-sdk-license-.+ diff --git a/app/build.gradle b/app/build.gradle index 4cfccd0a..a3ea567e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,6 +67,9 @@ android { gradle.projectsEvaluated { tasks.withType(JavaCompile) { + if (JavaVersion.current() >= JavaVersion.VERSION_1_9) { + options.compilerArgs.addAll(['--release', '8']) + } options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar') } } @@ -81,6 +84,7 @@ preBuild.doLast { parsedXml.component[1].remove(jdkNode) def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform" + //noinspection GroovyResultOfObjectAllocationIgnored // the note gets inserted new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK']) XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile)) @@ -101,7 +105,7 @@ def aospDeps = fileTree(include: [ dependencies { compileOnly aospDeps - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" implementation 'commons-io:commons-io:2.6' implementation 'io.github.novacrypto:BIP39:2019.01.27' @@ -115,9 +119,9 @@ dependencies { lintChecks 'com.github.thirdegg:lint-rules:0.0.4-alpha' testImplementation aospDeps - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.0' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2' testImplementation 'io.mockk:mockk:1.9.3' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test:rules:1.2.0'