Skip to content

Commit a977d11

Browse files
authored
feat: update all dependencies and modernize the source base (#1095)
1 parent 0362b10 commit a977d11

File tree

199 files changed

+4586
-6340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+4586
-6340
lines changed

.codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
coverage:
22
precision: 2
33
round: down
4-
range: "45...100"
4+
range: "65...100"
55

66
status:
7-
project:
7+
project:
88
default:
9-
target: 45%
9+
target: 65%
1010
patch: yes
1111
changes: no

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
2+
3+
name: ci
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- '**'
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v2
18+
with:
19+
java-version: '11'
20+
distribution: 'adopt'
21+
- name: Validate Gradle wrapper
22+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
23+
- run: pip install --user codecov
24+
- run: mkdir "$ANDROID_HOME/licenses" || true
25+
- run: echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" >> "$ANDROID_HOME/licenses/android-sdk-license"
26+
- run: ./gradlew clean jacocoTestReport
27+
- run: codecov

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,53 @@
1-
## Changelog
2-
3-
### master
4-
5-
### 1.25.0
1+
# Changelog
2+
3+
# master
4+
5+
### BREAKING CHANGES
6+
- Required minimum SDK version is 16
7+
8+
### Feature
9+
- Update all dependencies and modernize the source base (Asen Lekov) [#1095](https://github.com/parse-community/Parse-SDK-Android/pull/1095)
10+
11+
### Internal Changes
12+
- SDK targets the latest Android version API 30
13+
- Update the codebase to advantage of Java 8 syntax
14+
- Update Kotlin and Coroutines version to `1.5.31`
15+
- Update project from Android Studio `3.6` to `4.2`
16+
- Update Gradle version from `5.6.4` to `6.8.3`
17+
- Update Robolectric from `3.8` to `4.6` and adjust all tests
18+
- Update Play services
19+
- Google Play services auth from `18.0.0` to `19.2.0`
20+
- Google Cloud Messaging from `12.0.1` to `17.0.0`
21+
- Firebase Messaging from `20.1.5` to `22.0.0`
22+
- Update jacoco and fixed reporting of test coverage
23+
- Migrate deprecated dependency repository from `jcenter()` to `mavenCentral()`
24+
25+
### CI
26+
- Migrate from Travis CI to GitHub Actions (Asen Lekov) [#1095](https://github.com/parse-community/Parse-SDK-Android/pull/1095)
27+
28+
# 1.26.0
29+
- fix TypeCastException when unlinking google account [#1076](https://github.com/parse-community/Parse-SDK-Android/pull/1076)
30+
- feature: KTX property delegation custom labels [#1066](https://github.com/parse-community/Parse-SDK-Android/pull/1066)
31+
- feature: Coroutine Task Wrapper [#1064](https://github.com/parse-community/Parse-SDK-Android/pull/1064)
32+
- Rename functions that cause shadow members [#1054](https://github.com/parse-community/Parse-SDK-Android/pull/1054)
33+
34+
# 1.25.0
635
> __BREAKING CHANGES__
736
>
837
> - FIX: Corrected the `Installation` property `appVersion` to be the build version instead of the version name. This aligns the property with its equivalent in the Parse iOS SDK. See [#902](https://github.com/parse-community/Parse-SDK-Android/issues/902) for details. Thanks to [Manuel Trezza](https://github.com/mtrezza).
938
- Added RxJava module to transform `Task`s into RxJava types.
1039

11-
### 1.24.2
40+
# 1.24.2
1241
- FIX: Fixed naming collission bug due to integration of bolts-tasks module. See [#1028](https://github.com/parse-community/Parse-SDK-Android/issues/1028) for details. Thanks to [Manuel Trezza](https://github.com/mtrezza)
1342

14-
### 1.24.1
43+
# 1.24.1
1544
> __WARNING__
1645
>
1746
> Avoid using this release as it contains a [naming collission bug](https://github.com/parse-community/Parse-SDK-Android/issues/1028) that has been introduced in release `1.24.0` and fixed in release `1.24.2`. The bug causes the project compliation to fail due to duplicate class names for the `bolts-tasks` module when using the Facebook Android SDK or the Parse Android SDK Facebook module.
1847
1948
- Resolves issue around missing bolts-tasks dependency thanks to @rogerhu (#1025)
2049

21-
### 1.24.0
50+
# 1.24.0
2251
> __WARNING__
2352
>
2453
> Avoid using this release as it contains a [naming collission bug](https://github.com/parse-community/Parse-SDK-Android/issues/1028) that has been introduced in release `1.24.0` and fixed in release `1.24.2`. The bug causes the project compliation to fail due to duplicate class names for the `bolts-tasks` module when using the Facebook Android SDK or the Parse Android SDK Facebook module.
@@ -28,55 +57,55 @@
2857
- Set to unknown name if version name is null (#1014) thanks to @Jawnnypoo
2958
- Fix signup method name (#1017) thanks to @Jawnnypoo
3059

31-
### 1.23.1
60+
# 1.23.1
3261
- Correction to OkHttp version thanks to @mtrezza
3362

34-
### 1.23.0
63+
# 1.23.0
3564
- Add Google login/signup support
3665
- Move Facebook and Twitter libraries to be modules within this library
3766
- Update Facebook login to use AndroidX
3867
- Add ability to update the server without having to reinitialize the client thanks to @mtrezza
3968

40-
### 1.22.1
69+
# 1.22.1
4170
Re-releasing since Jitpack failed. Same as 1.22.0
4271

43-
### 1.22.0
72+
# 1.22.0
4473
- Expose client destroy
4574
- Enhancement to ParseQuery kt operations
4675

47-
### 1.21.0
76+
# 1.21.0
4877
- Add coroutines support module
4978
- Fix bug in save user in batch
5079

51-
### 1.20.0
80+
# 1.20.0
5281
- Fix fetchAllIfNeeded and fetchAllIfNeededInBackground limit #939
5382
- Expose useful constants #930
5483
- ParseQuery extensions #929
5584
- Change to non-deprecated methods for FCM #927. If you are using FCM and updating to 1.20.0, be sure to take a look at the FCM README for the updated steps on usage.
5685

57-
### 1.19.0
86+
# 1.19.0
5887
- SDK now uses AndroidX and API 28
5988
- Kotlin Delegates
6089
- Fix StackOverflowError when merging ParseObject from JSON #896
6190

62-
### 1.18.5
91+
# 1.18.5
6392
- Fix for issue #886
6493

65-
### 1.18.4
94+
# 1.18.4
6695
- Fix issue with returning { "result": null } in cloud function (deserialized as JSONObject instead of null)
6796
- Remove deprecated methods in ParseAnalytics and ParsePush
6897
- Add findAll() method to ParseQuery which iterates and finds all ParseObjects for a query (no limit)
6998

70-
### 1.18.3
99+
# 1.18.3
71100
- Add ktx module and dependency, which adds some Kotlin extensions for easier Parse SDK usage.
72101

73-
### 1.18.2
102+
# 1.18.2
74103
- More things made public for LiveQuery support
75104

76-
### 1.18.1
105+
# 1.18.1
77106
- Make things public for LiveQuery support
78107

79-
### 1.18.0
108+
# 1.18.0
80109
- Annotate ParseObject with nullability thanks to @kurtisnelson and @Jawnnypoo
81110
- Remove deprecated refresh() method from ParseObject
82111
- Partial string match thanks to @rogerhu

bolts-tasks/build.gradle

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,19 @@
66
apply plugin: 'java'
77
apply plugin: 'maven'
88

9-
configurations {
10-
provided
11-
}
12-
13-
sourceSets {
14-
main {
15-
compileClasspath += configurations.provided
16-
}
17-
}
18-
199
dependencies {
20-
provided 'com.google.android:android:4.1.1.4'
21-
testImplementation 'junit:junit:4.12'
10+
compileOnly 'com.google.android:android:4.1.1.4'
11+
testImplementation 'junit:junit:4.13.2'
2212
}
2313

24-
2514
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
2615

2716
task sourcesJar(type: Jar) {
2817
classifier = 'sources'
2918
from sourceSets.main.allJava
3019
}
3120

32-
task javadocJar (type: Jar, dependsOn: javadoc) {
21+
task javadocJar(type: Jar, dependsOn: javadoc) {
3322
classifier = 'javadoc'
3423
from javadoc.destinationDir
3524
}
@@ -45,10 +34,6 @@ artifacts {
4534

4635
apply plugin: 'jacoco'
4736

48-
jacoco {
49-
toolVersion = '0.7.1.201405082137'
50-
}
51-
5237
jacocoTestReport {
5338
group = "Reporting"
5439
description = "Generate Jacoco coverage reports after running tests."
@@ -59,3 +44,8 @@ jacocoTestReport {
5944
}
6045

6146
//endregion
47+
48+
java {
49+
sourceCompatibility = JavaVersion.VERSION_1_8
50+
targetCompatibility = JavaVersion.VERSION_1_8
51+
}

bolts-tasks/src/main/java/com/parse/boltsinternal/AggregateException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class AggregateException extends Exception {
2323

2424
private static final String DEFAULT_MESSAGE = "There were multiple errors.";
2525

26-
private List<Throwable> innerThrowables;
26+
private final List<Throwable> innerThrowables;
2727

2828
/**
2929
* Constructs a new {@code AggregateException} with the current stack trace, the specified detail
@@ -103,7 +103,7 @@ public void printStackTrace(PrintWriter err) {
103103
*/
104104
@Deprecated
105105
public List<Exception> getErrors() {
106-
List<Exception> errors = new ArrayList<Exception>();
106+
List<Exception> errors = new ArrayList<>();
107107
if (innerThrowables == null) {
108108
return errors;
109109
}
@@ -123,7 +123,7 @@ public List<Exception> getErrors() {
123123
*/
124124
@Deprecated
125125
public Throwable[] getCauses() {
126-
return innerThrowables.toArray(new Throwable[innerThrowables.size()]);
126+
return innerThrowables.toArray(new Throwable[0]);
127127
}
128128

129129
}

bolts-tasks/src/main/java/com/parse/boltsinternal/AndroidExecutors.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,8 @@
3434
*/
3535
/* package */ final class AndroidExecutors {
3636

37+
/* package */ static final long KEEP_ALIVE_TIME = 1L;
3738
private static final AndroidExecutors INSTANCE = new AndroidExecutors();
38-
39-
private final Executor uiThread;
40-
41-
private AndroidExecutors() {
42-
uiThread = new UIThreadExecutor();
43-
}
44-
4539
/**
4640
* Nexus 5: Quad-Core
4741
* Moto X: Dual-Core
@@ -55,7 +49,11 @@ private AndroidExecutors() {
5549
private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
5650
/* package */ static final int CORE_POOL_SIZE = CPU_COUNT + 1;
5751
/* package */ static final int MAX_POOL_SIZE = CPU_COUNT * 2 + 1;
58-
/* package */ static final long KEEP_ALIVE_TIME = 1L;
52+
private final Executor uiThread;
53+
54+
private AndroidExecutors() {
55+
uiThread = new UIThreadExecutor();
56+
}
5957

6058
/**
6159
* Creates a proper Cached Thread Pool. Tasks will reuse cached threads if available
@@ -72,7 +70,7 @@ public static ExecutorService newCachedThreadPool() {
7270
CORE_POOL_SIZE,
7371
MAX_POOL_SIZE,
7472
KEEP_ALIVE_TIME, TimeUnit.SECONDS,
75-
new LinkedBlockingQueue<Runnable>());
73+
new LinkedBlockingQueue<>());
7674

7775
allowCoreThreadTimeout(executor, true);
7876

@@ -95,7 +93,7 @@ public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
9593
CORE_POOL_SIZE,
9694
MAX_POOL_SIZE,
9795
KEEP_ALIVE_TIME, TimeUnit.SECONDS,
98-
new LinkedBlockingQueue<Runnable>(),
96+
new LinkedBlockingQueue<>(),
9997
threadFactory);
10098

10199
allowCoreThreadTimeout(executor, true);

bolts-tasks/src/main/java/com/parse/boltsinternal/BoltsExecutors.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@
1818
/* package */ final class BoltsExecutors {
1919

2020
private static final BoltsExecutors INSTANCE = new BoltsExecutors();
21-
22-
private static boolean isAndroidRuntime() {
23-
String javaRuntimeName = System.getProperty("java.runtime.name");
24-
if (javaRuntimeName == null) {
25-
return false;
26-
}
27-
return javaRuntimeName.toLowerCase(Locale.US).contains("android");
28-
}
29-
3021
private final ExecutorService background;
3122
private final ScheduledExecutorService scheduled;
3223
private final Executor immediate;
@@ -39,6 +30,14 @@ private BoltsExecutors() {
3930
immediate = new ImmediateExecutor();
4031
}
4132

33+
private static boolean isAndroidRuntime() {
34+
String javaRuntimeName = System.getProperty("java.runtime.name");
35+
if (javaRuntimeName == null) {
36+
return false;
37+
}
38+
return javaRuntimeName.toLowerCase(Locale.US).contains("android");
39+
}
40+
4241
/**
4342
* An {@link java.util.concurrent.Executor} that executes tasks in parallel.
4443
*/
@@ -69,7 +68,7 @@ static Executor immediate() {
6968
*/
7069
private static class ImmediateExecutor implements Executor {
7170
private static final int MAX_DEPTH = 15;
72-
private ThreadLocal<Integer> executionDepth = new ThreadLocal<>();
71+
private final ThreadLocal<Integer> executionDepth = new ThreadLocal<>();
7372

7473
/**
7574
* Increments the depth.

bolts-tasks/src/main/java/com/parse/boltsinternal/CancellationToken.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ public String toString() {
6464
return String.format(Locale.US, "%s@%s[cancellationRequested=%s]",
6565
getClass().getName(),
6666
Integer.toHexString(hashCode()),
67-
Boolean.toString(tokenSource.isCancellationRequested()));
67+
tokenSource.isCancellationRequested());
6868
}
6969
}

0 commit comments

Comments
 (0)