Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update all dependencies and modernize the source base #1095

Merged
merged 28 commits into from
Oct 9, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6d7f5c6
Update all dependencies
azlekov Jul 2, 2021
083850f
Newer java features and code optimization
azlekov Jul 2, 2021
c7b1f7e
Merge branch 'master' into new-hope
azlekov Jul 2, 2021
d53e6ac
Update jacoco and report coverage
azlekov Jul 2, 2021
a6cd865
Replace travis with gh actions
azlekov Jul 2, 2021
42ddfc8
Update ParseCommandCache.java
azlekov Jul 8, 2021
09cf1fb
Specify Java 1.8 in compileOptions
azlekov Jul 8, 2021
12771e5
Use source and javadoc gradle plugins
azlekov Oct 9, 2021
5dad62c
Update dependencies
azlekov Oct 9, 2021
3c1e015
Update ci.yml
azlekov Oct 9, 2021
da30907
Update ci.yml
azlekov Oct 9, 2021
9143532
Update compatibility versions
azlekov Oct 9, 2021
cb7afde
Update ci.yml
azlekov Oct 9, 2021
1d07965
Update ci.yml
azlekov Oct 9, 2021
c49accc
Update min sdk version to 15
azlekov Oct 9, 2021
67d3d13
Update min sdk version to 16
azlekov Oct 9, 2021
2e065d8
Update ci.yml
azlekov Oct 9, 2021
daf8d58
Merge branch 'master' into new-hope
mtrezza Oct 9, 2021
f89d7e8
Fix jacoco test coverage
azlekov Oct 9, 2021
3c4302b
Update .codecov.yml
azlekov Oct 9, 2021
cacca27
Update ci.yml
azlekov Oct 9, 2021
a4e9dac
Charset and locales fixes
azlekov Oct 9, 2021
ddc550b
Organize imports
azlekov Oct 9, 2021
f3d714d
Replace jcenter with mavenCentral
azlekov Oct 9, 2021
e1cc2f7
Update CHANGELOG.md
azlekov Oct 9, 2021
9632fa5
refactor changelog
mtrezza Oct 9, 2021
a2b61f9
Update ParseFirebaseMessagingService.java
azlekov Oct 9, 2021
b9f7a89
Revert removal of UTF-8 encodings
azlekov Oct 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ coverage:
range: "45...100"

status:
project:
azlekov marked this conversation as resolved.
Show resolved Hide resolved
project:
default:
target: 45%
patch: yes
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle
azlekov marked this conversation as resolved.
Show resolved Hide resolved
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- run: pip install --user codecov
- run: mkdir "$ANDROID_HOME/licenses" || true
- run: echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" >> "$ANDROID_HOME/licenses/android-sdk-license"
- run: ./gradlew clean jacocoTestReport
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removal of this? Other files still have this block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Feel free to add it to your #1122

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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,11 @@ private void cancelAfter(long delay, TimeUnit timeUnit) {
cancelScheduledCancellation();

if (delay != -1) {
scheduledCancellation = executor.schedule(new Runnable() {
@Override
public void run() {
synchronized (lock) {
scheduledCancellation = null;
}
cancel();
scheduledCancellation = executor.schedule(() -> {
synchronized (lock) {
scheduledCancellation = null;
}
cancel();
}, delay, timeUnit);
}
}
Expand Down Expand Up @@ -187,7 +184,7 @@ public String toString() {
return String.format(Locale.US, "%s@%s[cancellationRequested=%s]",
getClass().getName(),
Integer.toHexString(hashCode()),
Boolean.toString(isCancellationRequested()));
isCancellationRequested());
}

// This method makes no attempt to perform any synchronization itself - you should ensure
Expand Down
Loading