Skip to content

Commit 8df21ae

Browse files
authored
Merge pull request #856 from OneSignal/dependency_upgrade_robo_4.0
Updated dependencies and unittest for robolectric
2 parents c293239 + e9f0e93 commit 8df21ae

30 files changed

+391
-324
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ android:
1010
# https://github.com/travis-ci/travis-ci/issues/6193
1111
# Required to get the newest platform-tools.
1212
- platform-tools
13-
- build-tools-27.0.3
14-
- android-27
13+
- build-tools-28.0.3
14+
- android-28
1515
licenses:
1616
- '.+'
17+
- 'android-sdk-license-.+'
1718
before_install:
18-
- yes | sdkmanager "platforms;android-27"
19+
- yes | sdkmanager "platforms;android-28"
20+
- yes | sdkmanager "build-tools;28.0.3"
1921
- pwd
2022
- ls -la
2123
- cd OneSignalSDK

OneSignalSDK/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
2+
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.12.6'
33
}
44
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
55

OneSignalSDK/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ buildscript {
1111
// maven { url 'https://plugins.gradle.org/m2/' }
1212
}
1313
dependencies {
14-
classpath 'com.android.tools.build:gradle:3.1.0'
14+
classpath 'com.android.tools.build:gradle:3.5.0'
1515

16-
classpath 'com.google.gms:google-services:4.0.1'
16+
classpath 'com.google.gms:google-services:4.3.2'
1717

1818
// OneSignal-Gradle-Plugin - Local testing
1919
// classpath 'com.onesignal:onesignal-gradle-plugin:[0.8.1, 0.99.99]'

OneSignalSDK/gradle.properties

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,18 @@
2121
# https://github.com/robolectric/robolectric/issues/3169
2222
# org.robolectric.res.ResourceTableFactory.parseResourceFiles
2323
# Remove when creating an .aar build.
24-
android.enableAapt2=false
24+
#android.enableAapt2=false
25+
26+
android.databinding.incremental = false
27+
kapt.incremental.apt = false
28+
android.testConfig.useRelativePath = false
29+
30+
# Disables R8 for Android Library modules only
31+
android.enableR8.libraries = false
32+
# Disables R8 for all modules.
33+
android.enableR8 = true
34+
android.enableD8 = true
35+
36+
# Android X settings
37+
android.enableJetifier = false
38+
android.useAndroidX = false

OneSignalSDK/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

OneSignalSDK/onesignal/build.gradle

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 27
5-
buildToolsVersion '27.0.3'
6-
4+
compileSdkVersion 28
75
defaultConfig {
6+
// Normally we shouldn't need to redefine manifestPlaceholders for our onesignal project
7+
// but Android Studio gets a sync error if these are not here.
8+
// - /gradlew onesignal:assembleRelease is fine from the console.
9+
// We can't use static values are these are directly added to the AndroidManifest.xml in the .aar file.
10+
manifestPlaceholders = [onesignal_app_id: '${onesignal_app_id}',
11+
// Project number pulled from dashboard, local value is ignored
12+
onesignal_google_project_number: '${onesignal_google_project_number}']
813
minSdkVersion 15
914
consumerProguardFiles 'consumer-proguard-rules.pro'
1015
}
1116

1217
buildTypes {
13-
main {
18+
original {
1419
minifyEnabled false
1520
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1621
}
17-
1822
release {
1923
minifyEnabled false
2024
}
21-
2225
unity {
2326
minifyEnabled false
2427
}
@@ -30,19 +33,18 @@ android {
3033
dependencies {
3134
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
3235

33-
compileOnly 'com.google.android.gms:play-services-gcm:12.0.1'
34-
api 'com.google.firebase:firebase-messaging:12.0.1'
35-
36+
compileOnly 'com.google.android.gms:play-services-gcm:16.0.0'
3637
// Can be compileOnly in 4.0.0, can't change until then as some projects may rely on this
37-
implementation 'com.google.android.gms:play-services-location:12.0.1'
38-
39-
implementation 'com.android.support:cardview-v7:27.1.1'
40-
38+
implementation 'com.google.android.gms:play-services-location:16.0.0'
39+
implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
4140
// Required for GoogleApiAvailability
42-
implementation 'com.google.android.gms:play-services-base:12.0.1'
41+
implementation 'com.google.android.gms:play-services-base:16.0.1'
42+
43+
api 'com.google.firebase:firebase-messaging:17.3.3'
4344

44-
api 'com.android.support:support-v4:27.1.1'
45-
api 'com.android.support:customtabs:27.1.1'
45+
api 'com.android.support:cardview-v7:28.0.0'
46+
api 'com.android.support:support-v4:28.0.0'
47+
api 'com.android.support:customtabs:28.0.0'
4648

4749
// Change api to implementation. Need to check however this has any effect in production
4850
// projects that pull from maven.

OneSignalSDK/onesignal/maven-push.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class Global {
2828

2929
// Limit upper number (exclusive) to prevent untested versions
3030
static def versionGroupOverrides = [
31-
'com.google.android.gms': '[10.2.1, 12.1.0)',
32-
'com.google.firebase': '[10.2.1, 12.1.0)',
33-
'com.android.support': '[26.0.0, 27.2.0)'
31+
'com.google.android.gms': '[10.2.1, 16.1.0)',
32+
'com.google.firebase': '[10.2.1, 16.1.0)',
33+
'com.android.support': '[26.0.0, 28.1.0)'
3434
]
3535

3636
static def GROUP_ID = 'com.onesignal'

OneSignalSDK/onesignal/src/debug/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.onesignal">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.onesignal">
23

34
<!-- Create a unique permission for your app and use it so only your app can receive your OneSignal messages. -->
45
<permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
56
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
67

78
<application>
9+
810
<meta-data android:name="onesignal_app_id" android:value="${onesignal_app_id}" />
911
<!-- Deprecated - Pulled from OneSignal dashboard. -->
1012
<meta-data android:name="onesignal_google_project_number" android:value="str:${onesignal_google_project_number}" />

OneSignalSDK/onesignal/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest
2-
xmlns:android="http://schemas.android.com/apk/res/android"
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
32
package="com.onesignal">
43

54
<!-- OneSignal SDK has runtime checks Android version. -->
@@ -61,6 +60,7 @@
6160
<!-- End: ShortcutBadger -->
6261

6362
<application>
63+
6464
<receiver android:name="com.onesignal.NotificationOpenedReceiver" />
6565

6666
<service android:name="com.onesignal.GcmIntentService" />

OneSignalSDK/unittest/build.gradle

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 27
5-
buildToolsVersion '27.0.3'
6-
4+
compileSdkVersion 28
75
defaultConfig {
86
applicationId 'com.onesignal.example'
97
manifestPlaceholders = [onesignal_app_id: 'b2f7f966-d8cc-11e4-bed1-df8f05be55ba',
10-
// Project number pulled from dashboard, local value is ignored.
8+
// Project number pulled from dashboard, local value is ignored
119
onesignal_google_project_number: 'REMOTE']
1210
minSdkVersion 15
13-
targetSdkVersion 27
11+
targetSdkVersion 28
1412
versionCode 1
1513
versionName '1.0'
14+
testOptions.unitTests.includeAndroidResources = true
1615
}
1716
buildTypes {
1817
debug {
@@ -25,9 +24,6 @@ android {
2524
maxParallelForks 1
2625
maxHeapSize '2048m'
2726
}
28-
unitTests {
29-
includeAndroidResources = true
30-
}
3127
}
3228
}
3329

@@ -42,15 +38,15 @@ tasks.withType(Test) {
4238
dependencies {
4339
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
4440

45-
// Use for SDK Development
41+
// Use local onesignal SDK
4642
implementation(project(':onesignal'))
4743

4844
// Required to shadow firebase analytics classes
49-
implementation 'com.google.firebase:firebase-core:12.0.1'
45+
implementation 'com.google.android.gms:play-services-location:16.0.0'
5046

51-
implementation 'com.google.android.gms:play-services-location:12.0.1'
47+
implementation 'com.google.firebase:firebase-core:16.0.4'
5248

5349
testImplementation 'junit:junit:4.12'
54-
testImplementation 'org.robolectric:robolectric:3.8'
55-
testCompile 'org.awaitility:awaitility:3.1.5'
50+
testImplementation 'org.robolectric:robolectric:4.0'
51+
testImplementation 'org.awaitility:awaitility:3.1.5'
5652
}

0 commit comments

Comments
 (0)