From 29c45f49d0f1aeac4462d2c2a5a29c5b9e599485 Mon Sep 17 00:00:00 2001 From: John Carlson Date: Thu, 14 Feb 2019 10:24:54 -0600 Subject: [PATCH] Convert project to use AndroidX (#926) --- build.gradle | 10 ++++------ fcm/build.gradle | 2 +- .../com/parse/fcm/ParseFirebaseInstanceIdService.java | 2 +- gcm/build.gradle | 2 +- gcm/src/main/java/com/parse/gcm/ParseGCM.java | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 6 ++---- ktx/build.gradle | 2 +- parse/build.gradle | 6 +++--- parse/src/main/java/com/parse/Parse.java | 2 +- parse/src/main/java/com/parse/ParseHttpClient.java | 2 +- parse/src/main/java/com/parse/ParseJSONUtils.java | 2 +- parse/src/main/java/com/parse/ParseObject.java | 4 ++-- .../java/com/parse/ParsePushBroadcastReceiver.java | 4 ++-- parse/src/main/java/com/parse/ParseQuery.java | 2 +- parse/src/main/java/com/parse/ParseRequest.java | 2 +- parse/src/main/java/com/parse/ParseRole.java | 2 +- parse/src/main/java/com/parse/ParseUser.java | 2 +- parse/src/main/java/com/parse/PushHistory.java | 2 +- .../src/test/java/com/parse/OfflineQueryLogicTest.java | 2 +- parse/src/test/java/com/parse/ParseQueryTest.java | 2 +- 20 files changed, 29 insertions(+), 33 deletions(-) diff --git a/build.gradle b/build.gradle index 4df313651..66aaaf89d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,11 @@ buildscript { - ext.kotlin_version = '1.2.71' + ext.kotlin_version = '1.3.21' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.3' + classpath 'com.android.tools.build:gradle:3.3.1' classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -28,12 +28,10 @@ task clean(type: Delete) { } ext { - compileSdkVersion = 27 - - supportLibVersion = '27.1.1' + compileSdkVersion = 28 firebaseJobdispatcherVersion = '0.8.5' minSdkVersion = 14 - targetSdkVersion = 27 + targetSdkVersion = 28 } diff --git a/fcm/build.gradle b/fcm/build.gradle index 78b6a9345..9e030654c 100644 --- a/fcm/build.gradle +++ b/fcm/build.gradle @@ -9,7 +9,7 @@ android { versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/fcm/src/main/java/com/parse/fcm/ParseFirebaseInstanceIdService.java b/fcm/src/main/java/com/parse/fcm/ParseFirebaseInstanceIdService.java index ecb654327..a8197b720 100644 --- a/fcm/src/main/java/com/parse/fcm/ParseFirebaseInstanceIdService.java +++ b/fcm/src/main/java/com/parse/fcm/ParseFirebaseInstanceIdService.java @@ -8,7 +8,7 @@ */ package com.parse.fcm; -import android.support.annotation.CallSuper; +import androidx.annotation.CallSuper; import com.google.firebase.iid.FirebaseInstanceIdService; import com.parse.ParseInstallation; diff --git a/gcm/build.gradle b/gcm/build.gradle index 49495f1cb..295760678 100644 --- a/gcm/build.gradle +++ b/gcm/build.gradle @@ -9,7 +9,7 @@ android { versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/gcm/src/main/java/com/parse/gcm/ParseGCM.java b/gcm/src/main/java/com/parse/gcm/ParseGCM.java index d158f2284..699e5015c 100644 --- a/gcm/src/main/java/com/parse/gcm/ParseGCM.java +++ b/gcm/src/main/java/com/parse/gcm/ParseGCM.java @@ -10,8 +10,8 @@ import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.firebase.jobdispatcher.FirebaseJobDispatcher; import com.firebase.jobdispatcher.GooglePlayDriver; diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7a0c91296..feffd9762 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,6 @@ -#Tue Aug 22 15:11:42 CDT 2017 +#Thu Feb 14 09:49:29 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -# Make sure to update the version of android-maven-publish if you bump the Gradle version -# See: https://github.com/wupdigital/android-maven-publish -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/ktx/build.gradle b/ktx/build.gradle index 0766864ea..b55571675 100644 --- a/ktx/build.gradle +++ b/ktx/build.gradle @@ -11,7 +11,7 @@ android { versionCode 1 versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/parse/build.gradle b/parse/build.gradle index 835b0f3f3..50af4d70c 100644 --- a/parse/build.gradle +++ b/parse/build.gradle @@ -28,12 +28,12 @@ android { } ext { - okhttpVersion = '3.11.0' + okhttpVersion = '3.12.1' } dependencies { - api "com.android.support:support-annotations:$supportLibVersion" - api "com.android.support:support-compat:$supportLibVersion" + api "androidx.annotation:annotation:1.0.1" + api "androidx.core:core:1.0.1" api 'com.parse.bolts:bolts-tasks:1.4.0' api "com.squareup.okhttp3:okhttp:$okhttpVersion" diff --git a/parse/src/main/java/com/parse/Parse.java b/parse/src/main/java/com/parse/Parse.java index 9d4c3c180..0887cb847 100644 --- a/parse/src/main/java/com/parse/Parse.java +++ b/parse/src/main/java/com/parse/Parse.java @@ -11,7 +11,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.util.Log; import java.io.File; diff --git a/parse/src/main/java/com/parse/ParseHttpClient.java b/parse/src/main/java/com/parse/ParseHttpClient.java index 061fdd736..affe8673f 100644 --- a/parse/src/main/java/com/parse/ParseHttpClient.java +++ b/parse/src/main/java/com/parse/ParseHttpClient.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import com.parse.http.ParseHttpBody; import com.parse.http.ParseHttpRequest; diff --git a/parse/src/main/java/com/parse/ParseJSONUtils.java b/parse/src/main/java/com/parse/ParseJSONUtils.java index 6ac3a565c..5e6371ed4 100644 --- a/parse/src/main/java/com/parse/ParseJSONUtils.java +++ b/parse/src/main/java/com/parse/ParseJSONUtils.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; diff --git a/parse/src/main/java/com/parse/ParseObject.java b/parse/src/main/java/com/parse/ParseObject.java index d8c2fc5fc..9dd9d5a94 100644 --- a/parse/src/main/java/com/parse/ParseObject.java +++ b/parse/src/main/java/com/parse/ParseObject.java @@ -11,8 +11,8 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import org.json.JSONArray; import org.json.JSONException; diff --git a/parse/src/main/java/com/parse/ParsePushBroadcastReceiver.java b/parse/src/main/java/com/parse/ParsePushBroadcastReceiver.java index 6b108b72b..19b8a1b59 100644 --- a/parse/src/main/java/com/parse/ParsePushBroadcastReceiver.java +++ b/parse/src/main/java/com/parse/ParsePushBroadcastReceiver.java @@ -21,8 +21,8 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.NotificationCompat; +import androidx.annotation.Nullable; +import androidx.core.app.NotificationCompat; import org.json.JSONException; import org.json.JSONObject; diff --git a/parse/src/main/java/com/parse/ParseQuery.java b/parse/src/main/java/com/parse/ParseQuery.java index 7653f22cc..a149f9503 100644 --- a/parse/src/main/java/com/parse/ParseQuery.java +++ b/parse/src/main/java/com/parse/ParseQuery.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; diff --git a/parse/src/main/java/com/parse/ParseRequest.java b/parse/src/main/java/com/parse/ParseRequest.java index fa1100439..6b6c71f70 100644 --- a/parse/src/main/java/com/parse/ParseRequest.java +++ b/parse/src/main/java/com/parse/ParseRequest.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import com.parse.http.ParseHttpBody; import com.parse.http.ParseHttpRequest; diff --git a/parse/src/main/java/com/parse/ParseRole.java b/parse/src/main/java/com/parse/ParseRole.java index 381058fc8..3e59c38ed 100644 --- a/parse/src/main/java/com/parse/ParseRole.java +++ b/parse/src/main/java/com/parse/ParseRole.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import java.util.regex.Pattern; diff --git a/parse/src/main/java/com/parse/ParseUser.java b/parse/src/main/java/com/parse/ParseUser.java index 4d55b13d9..a8a9bac90 100644 --- a/parse/src/main/java/com/parse/ParseUser.java +++ b/parse/src/main/java/com/parse/ParseUser.java @@ -10,7 +10,7 @@ import android.os.Bundle; import android.os.Parcel; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.json.JSONObject; diff --git a/parse/src/main/java/com/parse/PushHistory.java b/parse/src/main/java/com/parse/PushHistory.java index e7da8e707..b952e9cf2 100644 --- a/parse/src/main/java/com/parse/PushHistory.java +++ b/parse/src/main/java/com/parse/PushHistory.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; diff --git a/parse/src/test/java/com/parse/OfflineQueryLogicTest.java b/parse/src/test/java/com/parse/OfflineQueryLogicTest.java index c249ffc5e..3b08e142b 100644 --- a/parse/src/test/java/com/parse/OfflineQueryLogicTest.java +++ b/parse/src/test/java/com/parse/OfflineQueryLogicTest.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.json.JSONArray; import org.json.JSONObject; diff --git a/parse/src/test/java/com/parse/ParseQueryTest.java b/parse/src/test/java/com/parse/ParseQueryTest.java index 51a35d68d..c85d2e3f6 100644 --- a/parse/src/test/java/com/parse/ParseQueryTest.java +++ b/parse/src/test/java/com/parse/ParseQueryTest.java @@ -8,7 +8,7 @@ */ package com.parse; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import org.junit.After; import org.junit.Before;