Skip to content

Commit

Permalink
feat: update all dependencies and modernize the source base (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
azlekov committed Oct 9, 2021
1 parent 0362b10 commit a977d11
Show file tree
Hide file tree
Showing 199 changed files with 4,586 additions and 6,340 deletions.
6 changes: 3 additions & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
coverage:
precision: 2
round: down
range: "45...100"
range: "65...100"

status:
project:
project:
default:
target: 45%
target: 65%
patch: yes
changes: no
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- run: pip install --user codecov
- run: mkdir "$ANDROID_HOME/licenses" || true
- run: echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" >> "$ANDROID_HOME/licenses/android-sdk-license"
- run: ./gradlew clean jacocoTestReport
- run: codecov
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

71 changes: 50 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,53 @@
## Changelog

### master

### 1.25.0
# Changelog

# master

### BREAKING CHANGES
- Required minimum SDK version is 16

### Feature
- Update all dependencies and modernize the source base (Asen Lekov) [#1095](https://github.com/parse-community/Parse-SDK-Android/pull/1095)

### Internal Changes
- SDK targets the latest Android version API 30
- Update the codebase to advantage of Java 8 syntax
- Update Kotlin and Coroutines version to `1.5.31`
- Update project from Android Studio `3.6` to `4.2`
- Update Gradle version from `5.6.4` to `6.8.3`
- Update Robolectric from `3.8` to `4.6` and adjust all tests
- Update Play services
- Google Play services auth from `18.0.0` to `19.2.0`
- Google Cloud Messaging from `12.0.1` to `17.0.0`
- Firebase Messaging from `20.1.5` to `22.0.0`
- Update jacoco and fixed reporting of test coverage
- Migrate deprecated dependency repository from `jcenter()` to `mavenCentral()`

### CI
- Migrate from Travis CI to GitHub Actions (Asen Lekov) [#1095](https://github.com/parse-community/Parse-SDK-Android/pull/1095)

# 1.26.0
- fix TypeCastException when unlinking google account [#1076](https://github.com/parse-community/Parse-SDK-Android/pull/1076)
- feature: KTX property delegation custom labels [#1066](https://github.com/parse-community/Parse-SDK-Android/pull/1066)
- feature: Coroutine Task Wrapper [#1064](https://github.com/parse-community/Parse-SDK-Android/pull/1064)
- Rename functions that cause shadow members [#1054](https://github.com/parse-community/Parse-SDK-Android/pull/1054)

# 1.25.0
> __BREAKING CHANGES__
>
> - 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).
- Added RxJava module to transform `Task`s into RxJava types.

### 1.24.2
# 1.24.2
- 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)

### 1.24.1
# 1.24.1
> __WARNING__
>
> 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.
- Resolves issue around missing bolts-tasks dependency thanks to @rogerhu (#1025)

### 1.24.0
# 1.24.0
> __WARNING__
>
> 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.
Expand All @@ -28,55 +57,55 @@
- Set to unknown name if version name is null (#1014) thanks to @Jawnnypoo
- Fix signup method name (#1017) thanks to @Jawnnypoo

### 1.23.1
# 1.23.1
- Correction to OkHttp version thanks to @mtrezza

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

### 1.22.1
# 1.22.1
Re-releasing since Jitpack failed. Same as 1.22.0

### 1.22.0
# 1.22.0
- Expose client destroy
- Enhancement to ParseQuery kt operations

### 1.21.0
# 1.21.0
- Add coroutines support module
- Fix bug in save user in batch

### 1.20.0
# 1.20.0
- Fix fetchAllIfNeeded and fetchAllIfNeededInBackground limit #939
- Expose useful constants #930
- ParseQuery extensions #929
- 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.

### 1.19.0
# 1.19.0
- SDK now uses AndroidX and API 28
- Kotlin Delegates
- Fix StackOverflowError when merging ParseObject from JSON #896

### 1.18.5
# 1.18.5
- Fix for issue #886

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

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

### 1.18.2
# 1.18.2
- More things made public for LiveQuery support

### 1.18.1
# 1.18.1
- Make things public for LiveQuery support

### 1.18.0
# 1.18.0
- Annotate ParseObject with nullability thanks to @kurtisnelson and @Jawnnypoo
- Remove deprecated refresh() method from ParseObject
- Partial string match thanks to @rogerhu
Expand Down
26 changes: 8 additions & 18 deletions bolts-tasks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,19 @@
apply plugin: 'java'
apply plugin: 'maven'

configurations {
provided
}

sourceSets {
main {
compileClasspath += configurations.provided
}
}

dependencies {
provided 'com.google.android:android:4.1.1.4'
testImplementation 'junit:junit:4.12'
compileOnly 'com.google.android:android:4.1.1.4'
testImplementation 'junit:junit:4.13.2'
}


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

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}

task javadocJar (type: Jar, dependsOn: javadoc) {
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
Expand All @@ -45,10 +34,6 @@ artifacts {

apply plugin: 'jacoco'

jacoco {
toolVersion = '0.7.1.201405082137'
}

jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
Expand All @@ -59,3 +44,8 @@ jacocoTestReport {
}

//endregion

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AggregateException extends Exception {

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

private List<Throwable> innerThrowables;
private final List<Throwable> innerThrowables;

/**
* Constructs a new {@code AggregateException} with the current stack trace, the specified detail
Expand Down Expand Up @@ -103,7 +103,7 @@ public void printStackTrace(PrintWriter err) {
*/
@Deprecated
public List<Exception> getErrors() {
List<Exception> errors = new ArrayList<Exception>();
List<Exception> errors = new ArrayList<>();
if (innerThrowables == null) {
return errors;
}
Expand All @@ -123,7 +123,7 @@ public List<Exception> getErrors() {
*/
@Deprecated
public Throwable[] getCauses() {
return innerThrowables.toArray(new Throwable[innerThrowables.size()]);
return innerThrowables.toArray(new Throwable[0]);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,8 @@
*/
/* package */ final class AndroidExecutors {

/* package */ static final long KEEP_ALIVE_TIME = 1L;
private static final AndroidExecutors INSTANCE = new AndroidExecutors();

private final Executor uiThread;

private AndroidExecutors() {
uiThread = new UIThreadExecutor();
}

/**
* Nexus 5: Quad-Core
* Moto X: Dual-Core
Expand All @@ -55,7 +49,11 @@ private AndroidExecutors() {
private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
/* package */ static final int CORE_POOL_SIZE = CPU_COUNT + 1;
/* package */ static final int MAX_POOL_SIZE = CPU_COUNT * 2 + 1;
/* package */ static final long KEEP_ALIVE_TIME = 1L;
private final Executor uiThread;

private AndroidExecutors() {
uiThread = new UIThreadExecutor();
}

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

allowCoreThreadTimeout(executor, true);

Expand All @@ -95,7 +93,7 @@ public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
CORE_POOL_SIZE,
MAX_POOL_SIZE,
KEEP_ALIVE_TIME, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(),
new LinkedBlockingQueue<>(),
threadFactory);

allowCoreThreadTimeout(executor, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
/* package */ final class BoltsExecutors {

private static final BoltsExecutors INSTANCE = new BoltsExecutors();

private static boolean isAndroidRuntime() {
String javaRuntimeName = System.getProperty("java.runtime.name");
if (javaRuntimeName == null) {
return false;
}
return javaRuntimeName.toLowerCase(Locale.US).contains("android");
}

private final ExecutorService background;
private final ScheduledExecutorService scheduled;
private final Executor immediate;
Expand All @@ -39,6 +30,14 @@ private BoltsExecutors() {
immediate = new ImmediateExecutor();
}

private static boolean isAndroidRuntime() {
String javaRuntimeName = System.getProperty("java.runtime.name");
if (javaRuntimeName == null) {
return false;
}
return javaRuntimeName.toLowerCase(Locale.US).contains("android");
}

/**
* An {@link java.util.concurrent.Executor} that executes tasks in parallel.
*/
Expand Down Expand Up @@ -69,7 +68,7 @@ static Executor immediate() {
*/
private static class ImmediateExecutor implements Executor {
private static final int MAX_DEPTH = 15;
private ThreadLocal<Integer> executionDepth = new ThreadLocal<>();
private final ThreadLocal<Integer> executionDepth = new ThreadLocal<>();

/**
* Increments the depth.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public String toString() {
return String.format(Locale.US, "%s@%s[cancellationRequested=%s]",
getClass().getName(),
Integer.toHexString(hashCode()),
Boolean.toString(tokenSource.isCancellationRequested()));
tokenSource.isCancellationRequested());
}
}
Loading

0 comments on commit a977d11

Please sign in to comment.