Fix CI by running tests with newer Java version, but target JDK 8

This commit is contained in:
Torsten Grote 2019-09-19 11:19:44 -03:00
parent 37ffacbafe
commit e659892278
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
2 changed files with 13 additions and 5 deletions

View file

@ -1,9 +1,13 @@
dist: trusty dist: trusty
jdk:
- openjdk11
language: android language: android
android: android:
components: components:
- build-tools-28.0.3 - build-tools-29.0.2
- android-28 - android-29
licenses: licenses:
- android-sdk-license-.+ - android-sdk-license-.+

View file

@ -67,6 +67,9 @@ android {
gradle.projectsEvaluated { gradle.projectsEvaluated {
tasks.withType(JavaCompile) { 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') options.compilerArgs.add('-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar')
} }
} }
@ -81,6 +84,7 @@ preBuild.doLast {
parsedXml.component[1].remove(jdkNode) parsedXml.component[1].remove(jdkNode)
def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform" 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']) new Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK'])
XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile)) XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile))
@ -101,7 +105,7 @@ def aospDeps = fileTree(include: [
dependencies { dependencies {
compileOnly aospDeps 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 'commons-io:commons-io:2.6'
implementation 'io.github.novacrypto:BIP39:2019.01.27' implementation 'io.github.novacrypto:BIP39:2019.01.27'
@ -115,9 +119,9 @@ dependencies {
lintChecks 'com.github.thirdegg:lint-rules:0.0.4-alpha' lintChecks 'com.github.thirdegg:lint-rules:0.0.4-alpha'
testImplementation aospDeps 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' 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:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0' androidTestImplementation 'androidx.test:rules:1.2.0'