Skip to content

Commit 85429e5

Browse files
hborisoffe7mac
andauthored
Update external dependencies (gradle, sdk, ...) (#398)
* Bump versions of gradle, artifactory, bintray, android sdk, robolectric * Fix travis with new sdk and tools * Manually download new Android SDK in travis * Add publication of classes.jar, bump other dependencies in test project * Bump source and target java version to 1.8 * Fix pom packaging value to be always aar * Set version to test artifactory and bintray publishing * Try disable jar to debug * Test artifactory publish * Add bintray and artifactory init to afterEvaluate * Bump version to test bintray * Try fix bintray upload * Test older version of artifactory plugin * Return jar publication. * Remove unused ext definitions * Revert the sdk-version.txt Co-authored-by: Mayank Sanganeria <[email protected]>
1 parent ae7c973 commit 85429e5

File tree

11 files changed

+119
-125
lines changed

11 files changed

+119
-125
lines changed

.travis.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
11
language: android
2+
3+
env:
4+
global:
5+
- BUILD_API=29
6+
- BUILD_TOOLS=29.0.3
7+
- ANDROID_HOME=/usr/local/android-sdk
8+
- TOOLS=${ANDROID_HOME}/tools
9+
# PATH order is important, the 'emulator' script exists in more than one place
10+
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
11+
212
android:
313
components:
414
- tools
5-
- platform-tools
6-
- build-tools-28.0.3
7-
- android-28
15+
16+
licenses:
17+
- 'android-sdk-preview-license-.+'
18+
- 'android-sdk-license-.+'
19+
- 'google-gdk-license-.+'
820

921
before_install:
10-
- sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-160.jar" -O "${JAVA_HOME}/jre/lib/ext/bcprov-ext-jdk15on-160.jar"
22+
- sudo wget "https://bouncycastle.org/download/bcprov-ext-jdk15on-165.jar" -O "${JAVA_HOME}/jre/lib/ext/bcprov-ext-jdk15on-165.jar"
1123
- sudo echo "security.provider.11=org.bouncycastle.jce.provider.BouncyCastleProvider" | sudo tee -a ${JAVA_HOME}/jre/lib/security/java.security
1224

25+
before_script:
26+
# Install Android SDK
27+
- echo 'count=0' > /home/travis/.android/repositories.cfg # avoid harmless sdkmanager warning
28+
- echo y | sdkmanager "platform-tools" >/dev/null
29+
- echo y | sdkmanager "tools" >/dev/null
30+
- echo y | sdkmanager "build-tools;$BUILD_TOOLS" >/dev/null
31+
- echo y | sdkmanager "platforms;android-$BUILD_API" >/dev/null
32+
- echo y | sdkmanager "extras;android;m2repository" >/dev/null
33+
1334
script:
1435
- ./gradlew assembleRelease testReleaseUnitTest
1536

1637
before_deploy:
1738
- ./Tools/verifyTag.sh
18-
- ./gradlew assembleRelease makeJar generatePomFileForAarPublication
39+
- ./gradlew assembleRelease generatePomFileForAarPublication
1940

2041
after_deploy:
2142
- ./Tools/triggerRondo.sh

AndroidSDK/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies {
1919

2020
android {
2121
compileSdkVersion COMPILE_SDK_VERSION
22-
// publishNonDefault true
2322

2423
defaultConfig {
2524
minSdkVersion MIN_SDK_VERSION
@@ -33,6 +32,11 @@ android {
3332
}
3433
}
3534

35+
compileOptions {
36+
sourceCompatibility JAVA_VERSION
37+
targetCompatibility JAVA_VERSION
38+
}
39+
3640
sourceSets {
3741
main {
3842
manifest.srcFile 'AndroidManifest.xml'

AndroidSDKCore/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ android {
99
compileSdkVersion COMPILE_SDK_VERSION
1010
useLibrary 'org.apache.http.legacy'
1111

12-
publishNonDefault true
13-
1412
defaultConfig {
1513
minSdkVersion MIN_SDK_VERSION
1614
consumerProguardFiles CONSUMER_PROGUARD_FILES
@@ -23,11 +21,17 @@ android {
2321
def buildNumber = System.getenv('BUILD_NUMBER') ?: '0'
2422
buildConfigField 'String', 'BUILD_NUMBER', "\"${buildNumber}\""
2523
}
24+
2625
buildTypes {
2726
release {
2827
proguardFiles getDefaultProguardFile('proguard-android.txt'), PROGUARD_FILES
2928
}
3029
}
30+
31+
compileOptions {
32+
sourceCompatibility JAVA_VERSION
33+
targetCompatibility JAVA_VERSION
34+
}
3135
}
3236

3337
dependencies {
@@ -47,4 +51,4 @@ task generateJavadoc(type: Javadoc) {
4751
failOnError false
4852
}
4953

50-
publishing_task(LEANPLUM_CORE_ARTIFACT_ID, 'AndroidSDKCore')
54+
publishing_task(LEANPLUM_CORE_ARTIFACT_ID)

AndroidSDKFcm/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ android {
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
}
22+
23+
compileOptions {
24+
sourceCompatibility JAVA_VERSION
25+
targetCompatibility JAVA_VERSION
26+
}
2227
}
2328

2429
dependencies {
@@ -40,4 +45,4 @@ task generateJavadoc(type: Javadoc) {
4045
failOnError false
4146
}
4247

43-
publishing_task(LEANPLUM_FCM_ARTIFACT_ID, 'AndroidSDKFcm')
48+
publishing_task(LEANPLUM_FCM_ARTIFACT_ID)

AndroidSDKLocation/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ android {
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
}
22+
23+
compileOptions {
24+
sourceCompatibility JAVA_VERSION
25+
targetCompatibility JAVA_VERSION
26+
}
2227
}
2328

2429
dependencies {
@@ -37,4 +42,4 @@ task generateJavadoc(type: Javadoc) {
3742
failOnError false
3843
}
3944

40-
publishing_task(LEANPLUM_LOCATION_ARTIFACT_ID, 'AndroidSDKLocation')
45+
publishing_task(LEANPLUM_LOCATION_ARTIFACT_ID)

AndroidSDKPush/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ android {
1818
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1919
}
2020
}
21+
22+
compileOptions {
23+
sourceCompatibility JAVA_VERSION
24+
targetCompatibility JAVA_VERSION
25+
}
2126
}
2227

2328
dependencies {
@@ -33,4 +38,4 @@ task generateJavadoc(type: Javadoc) {
3338
failOnError false
3439
}
3540

36-
publishing_task(LEANPLUM_PUSH_ARTIFACT_ID, 'AndroidSDKPush')
41+
publishing_task(LEANPLUM_PUSH_ARTIFACT_ID)

AndroidSDKTests/build.gradle

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ android {
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
20+
compileOptions {
21+
sourceCompatibility JAVA_VERSION
22+
targetCompatibility JAVA_VERSION
23+
}
2024
testOptions {
2125
unitTests.all {
2226
maxParallelForks = 2
@@ -47,11 +51,11 @@ dependencies {
4751
implementation project(':AndroidSDKLocation')
4852
implementation project(':AndroidSDKFcm')
4953
implementation "androidx.appcompat:appcompat:${APPCOMPAT_LIBRARY_VERSION}"
50-
implementation 'com.google.android.gms:play-services-location:11.6.0'
54+
implementation 'com.google.android.gms:play-services-location:17.0.0'
5155

5256
// Dependencies used for unit tests.
53-
testImplementation 'junit:junit:4.12'
54-
testImplementation('org.robolectric:robolectric:4.1') {
57+
testImplementation 'junit:junit:4.13'
58+
testImplementation('org.robolectric:robolectric:4.3.1') {
5559
exclude group: 'commons-logging', module: 'commons-logging'
5660
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
5761
}
@@ -61,11 +65,11 @@ dependencies {
6165
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.6'
6266
testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
6367
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.6'
64-
testImplementation 'org.bouncycastle:bcmail-jdk15on:1.54'
68+
testImplementation 'org.bouncycastle:bcmail-jdk15on:1.65'
6569
}
6670

6771
task jarTests(type: Jar, dependsOn: "assembleDebugUnitTest") {
68-
classifier = 'tests'
72+
archiveClassifier = 'tests'
6973
from "$buildDir/intermediates/classes/test/debug"
7074
}
7175
configurations {

AndroidSDKTests/src/test/java/com/leanplum/LeanplumInboxMessageTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
package com.leanplum;
2222

23+
import android.os.Build.VERSION_CODES;
2324
import com.leanplum.internal.Constants;
2425

2526
import org.junit.Test;
@@ -29,6 +30,7 @@
2930
import java.util.Calendar;
3031
import java.util.Date;
3132
import java.util.HashMap;
33+
import org.robolectric.annotation.Config;
3234

3335
import static org.junit.Assert.assertEquals;
3436
import static org.junit.Assert.assertFalse;
@@ -41,6 +43,7 @@
4143
* @author Sayaan Saha
4244
*/
4345
@RunWith(RobolectricTestRunner.class)
46+
@Config(sdk = VERSION_CODES.P) // temporarily fix issue with Robolectric and Android SDK 29
4447
public class LeanplumInboxMessageTest {
4548
/**
4649
* Test creating a message from json.

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5'
10-
classpath 'com.android.tools.build:gradle:3.3.0'
11-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
9+
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.13.0'
10+
classpath 'com.android.tools.build:gradle:3.6.3'
11+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.3'
1212
}
1313
}
1414

0 commit comments

Comments
 (0)