diff --git a/build.gradle b/build.gradle index 8d42fb6..a01e2ee 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.70' + ext.kotlin_version = '1.4.31' ext.dokka_version = '0.9.18' repositories { mavenCentral() @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:4.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}" classpath "digital.wup:android-maven-publish:3.6.2" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8384b08..c16e85a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Feb 26 12:58:07 CET 2019 +#Fri Mar 12 11:54:10 CET 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/run-ci.py b/run-ci.py index 6dfbc33..3f08c8f 100644 --- a/run-ci.py +++ b/run-ci.py @@ -69,6 +69,12 @@ def test() -> None: "./gradlew", "tanker-bindings:testRelease", ) + with tankerci.android.emulator(): + try: + tankerci.run("./gradlew", "connectedAndroidTest", "-PandroidTestRelease") + except: + dump_logcat_for_failed_tests() + raise def build_and_test( diff --git a/tanker-bindings/build.gradle b/tanker-bindings/build.gradle index c21ea5d..86249b0 100644 --- a/tanker-bindings/build.gradle +++ b/tanker-bindings/build.gradle @@ -11,10 +11,10 @@ version 'dev' android { - compileSdkVersion 30 + compileSdkVersion 28 defaultConfig { minSdkVersion 19 - targetSdkVersion 30 + targetSdkVersion 28 consumerProguardFiles 'proguard-rules.pro' ndk { @@ -35,8 +35,6 @@ android { packagingOptions { doNotStrip "**/*.so" } - // Tests produce more than 64K methods... - multiDexEnabled true } } // This is the only way to build instrumented tests in release mode @@ -137,22 +135,27 @@ dokka { } } - -publishing { - - publications { - tankerBindings(MavenPublication) { - from components.android - - artifact javaDocJar - artifact sourcesJar +// We use afterEvaluate to give the Android Gradle plugin time to inject the Adhoc Component 'release' +afterEvaluate { + publishing { + publications { + tankerBindings(MavenPublication) { + // Instead of components.android, we want only the release aar, otherwise publish + // fails with "multiple artifacts with the identical extension and classifier", + // because the debug and release .aar have no "classifier" to distinguish them + from components.release + + // These have different classifiers (doc and source) so no conflict here + artifact javaDocJar + artifact sourcesJar + } } - } - repositories { - maven { - name = 'maven.tanker.io' - url = 'gcs://maven.tanker.io' + repositories { + maven { + name = 'maven.tanker.io' + url = 'gcs://maven.tanker.io' + } } } } @@ -163,8 +166,8 @@ dependencies { api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.1' api 'net.java.dev.jna:jna:5.4.0@aar' - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.android.support:support-compat:28.0.0' + implementation 'com.android.support:support-annotations:28.0.0' testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.7.1") testImplementation "androidx.test:runner:1.3.0" @@ -197,7 +200,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:1.0.2' + classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0' } } diff --git a/tanker-bindings/src/main/kotlin/io/tanker/api/AsynchronousByteChannelWrapper.kt b/tanker-bindings/src/main/kotlin/io/tanker/api/AsynchronousByteChannelWrapper.kt index 07e36d3..9c28efe 100644 --- a/tanker-bindings/src/main/kotlin/io/tanker/api/AsynchronousByteChannelWrapper.kt +++ b/tanker-bindings/src/main/kotlin/io/tanker/api/AsynchronousByteChannelWrapper.kt @@ -1,6 +1,6 @@ package io.tanker.api -import androidx.annotation.RequiresApi +import android.support.annotation.RequiresApi import java.nio.ByteBuffer import java.nio.channels.AsynchronousByteChannel import java.nio.channels.CompletionHandler diff --git a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerAsynchronousByteChannelWrapper.kt b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerAsynchronousByteChannelWrapper.kt index 602c1f4..ce06b17 100644 --- a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerAsynchronousByteChannelWrapper.kt +++ b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerAsynchronousByteChannelWrapper.kt @@ -1,6 +1,6 @@ package io.tanker.api -import androidx.annotation.RequiresApi +import android.support.annotation.RequiresApi import java.nio.ByteBuffer import java.nio.channels.AsynchronousByteChannel import java.nio.channels.CompletionHandler diff --git a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerChannels.kt b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerChannels.kt index e90694e..c4ba795 100644 --- a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerChannels.kt +++ b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerChannels.kt @@ -1,6 +1,6 @@ package io.tanker.api -import androidx.annotation.RequiresApi +import android.support.annotation.RequiresApi import java.io.InputStream import java.nio.channels.AsynchronousByteChannel diff --git a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerFuture.kt b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerFuture.kt index b880974..a0f945a 100644 --- a/tanker-bindings/src/main/kotlin/io/tanker/api/TankerFuture.kt +++ b/tanker-bindings/src/main/kotlin/io/tanker/api/TankerFuture.kt @@ -2,12 +2,12 @@ package io.tanker.api import android.os.Looper import android.os.NetworkOnMainThreadException -import androidx.annotation.WorkerThread import com.sun.jna.Pointer import io.tanker.api.errors.toError import io.tanker.bindings.TankerLib import java.lang.reflect.Type import java.util.concurrent.Executors +import android.support.annotation.WorkerThread import io.tanker.bindings.AsyncLib import java.util.* import kotlin.collections.ArrayList diff --git a/tanker-bindings/src/test/kotlin/io/tanker/api/TankerResourceChannel.kt b/tanker-bindings/src/test/kotlin/io/tanker/api/TankerResourceChannel.kt index 34bc492..b6ccdbb 100644 --- a/tanker-bindings/src/test/kotlin/io/tanker/api/TankerResourceChannel.kt +++ b/tanker-bindings/src/test/kotlin/io/tanker/api/TankerResourceChannel.kt @@ -1,6 +1,6 @@ package io.tanker.api -import androidx.annotation.RequiresApi +import android.support.annotation.RequiresApi import org.assertj.core.api.Assertions.assertThat import org.junit.After import org.junit.Before