Skip to content

Commit

Permalink
Merge branch 'tim/publish_release' into 'master'
Browse files Browse the repository at this point in the history
fix(gradle): Publish from components.release, not components.android

See merge request TankerHQ/sdk-android!187
  • Loading branch information
Jeremy T committed Mar 31, 2021
2 parents 91600d2 + 9e5c3a8 commit 3046967
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 30 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// 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()
google()
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"
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions run-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
45 changes: 24 additions & 21 deletions tanker-bindings/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ version 'dev'


android {
compileSdkVersion 30
compileSdkVersion 28
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 28

consumerProguardFiles 'proguard-rules.pro'
ndk {
Expand All @@ -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
Expand Down Expand Up @@ -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'
}
}
}
}
Expand All @@ -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"
Expand Down Expand Up @@ -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'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3046967

Please sign in to comment.