mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 04:13:53 +01:00
Update to API 28, and fix CI issues. (#2595)
* Update gradle version. Also update jacoco plugin to work with latest gradle. * Update target sdk to 28. * Update other dependencies to latest versions. * Remove totally unused(?) local jar file. * Remove dependency on nineoldandroids. The functions it provides are no longer necessary. This also removes a homemade "evaluate" function, which is readily available in the Support library. * Remove dependency on Traceur. This library has not been updated in two years (may no longer be maintained?), and no longer works with the latest RxJava. * Enable test coverage only when performing CI. Running test coverage on every single build while developing in the IDE is quite a waste of time. * Suppress gradle Notes and Warnings from reflection-using packages. The build output was getting extremely long, and was actually causing the build to fail because of the sheer size of the log. * Suppress gradle Note messages during tests and CI. Stop CI messages from exploding to 10k+ lines. * Temporarily remove instrumented test(s). The project's instrumented tests consist of a single test which sets a SharedPreference, then verified that the SharedPreference was set. I humbly submit that this is not worth the trouble of having the CI server download the system image, spin up an emulator, load the APK, and run it just for this purpose. Once the instrumented tests are ready for prime time, we can reinstate instrumented tests in CI.
This commit is contained in:
parent
8dbeb6eba0
commit
c21cc83eb5
10 changed files with 26 additions and 53 deletions
|
|
@ -20,15 +20,10 @@ android:
|
||||||
- extra-android-m2repository
|
- extra-android-m2repository
|
||||||
- android-22
|
- android-22
|
||||||
- android-28
|
- android-28
|
||||||
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
|
|
||||||
licenses:
|
licenses:
|
||||||
- android-sdk-license-.+
|
- android-sdk-license-.+
|
||||||
before_script:
|
|
||||||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
|
|
||||||
- emulator -avd test -no-audio -no-window -no-boot-anim &
|
|
||||||
- android-wait-for-emulator
|
|
||||||
script:
|
script:
|
||||||
- "./gradlew clean check connectedCheck jacocoTestReport"
|
- "./gradlew -Pcoverage clean check jacocoTestReport"
|
||||||
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
|
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
|
||||||
mkdir -p app/src/prodRelease/play/release-notes/en-US;
|
mkdir -p app/src/prodRelease/play/release-notes/en-US;
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,15 @@ dependencies {
|
||||||
implementation 'com.google.code.gson:gson:2.8.5'
|
implementation 'com.google.code.gson:gson:2.8.5'
|
||||||
implementation 'info.debatty:java-string-similarity:0.24'
|
implementation 'info.debatty:java-string-similarity:0.24'
|
||||||
implementation 'in.yuvi:http.fluent:1.3'
|
implementation 'in.yuvi:http.fluent:1.3'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
|
||||||
implementation 'com.squareup.okio:okio:1.14.0'
|
implementation 'com.squareup.okio:okio:1.15.0'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
|
||||||
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
|
||||||
implementation 'com.facebook.fresco:fresco:1.10.0'
|
implementation 'com.facebook.fresco:fresco:1.13.0'
|
||||||
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
|
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
|
||||||
|
|
||||||
// UI
|
// UI
|
||||||
|
|
@ -38,12 +38,11 @@ dependencies {
|
||||||
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
|
||||||
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
|
||||||
implementation 'com.karumi:dexter:5.0.0'
|
implementation 'com.karumi:dexter:5.0.0'
|
||||||
implementation files('libs/simplemagic-1.9.jar')
|
|
||||||
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
|
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
|
||||||
kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
|
kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
|
||||||
// Logging
|
// Logging
|
||||||
implementation 'ch.acra:acra:4.9.2'
|
implementation 'ch.acra:acra:4.9.2'
|
||||||
implementation 'com.jakewharton.timber:timber:4.4.0'
|
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||||
implementation 'org.slf4j:slf4j-api:1.7.25'
|
implementation 'org.slf4j:slf4j-api:1.7.25'
|
||||||
api('com.github.tony19:logback-android-classic:1.1.1-6') {
|
api('com.github.tony19:logback-android-classic:1.1.1-6') {
|
||||||
exclude group: 'com.google.android', module: 'android'
|
exclude group: 'com.google.android', module: 'android'
|
||||||
|
|
@ -73,7 +72,6 @@ dependencies {
|
||||||
androidTestImplementation 'org.mockito:mockito-core:2.10.0'
|
androidTestImplementation 'org.mockito:mockito-core:2.10.0'
|
||||||
|
|
||||||
// Debugging
|
// Debugging
|
||||||
implementation 'com.tspoon.traceur:traceur:1.0.1'
|
|
||||||
implementation 'com.facebook.stetho:stetho:1.5.0'
|
implementation 'com.facebook.stetho:stetho:1.5.0'
|
||||||
debugImplementation "com.squareup.leakcanary:leakcanary-android:$LEAK_CANARY_VERSION"
|
debugImplementation "com.squareup.leakcanary:leakcanary-android:$LEAK_CANARY_VERSION"
|
||||||
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY_VERSION"
|
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY_VERSION"
|
||||||
|
|
@ -89,7 +87,6 @@ dependencies {
|
||||||
|
|
||||||
//swipe_layout
|
//swipe_layout
|
||||||
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
|
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
|
||||||
implementation 'com.nineoldandroids:library:2.4.0'
|
|
||||||
//metadata extractor
|
//metadata extractor
|
||||||
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
|
implementation 'com.drewnoakes:metadata-extractor:2.11.0'
|
||||||
}
|
}
|
||||||
|
|
@ -105,7 +102,7 @@ android {
|
||||||
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
|
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
|
||||||
|
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 27
|
targetSdkVersion 28
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
|
@ -142,7 +139,7 @@ android {
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
testCoverageEnabled true
|
testCoverageEnabled project.hasProperty('coverage')
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||||
testProguardFile 'test-proguard-rules.txt'
|
testProguardFile 'test-proguard-rules.txt'
|
||||||
versionNameSuffix "-debug-" + getBranchName()
|
versionNameSuffix "-debug-" + getBranchName()
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,6 +1,10 @@
|
||||||
-dontobfuscate
|
-dontobfuscate
|
||||||
-ignorewarnings
|
-ignorewarnings
|
||||||
|
|
||||||
|
-dontnote **
|
||||||
|
-dontwarn net.bytebuddy.**
|
||||||
|
-dontwarn org.mockito.**
|
||||||
|
|
||||||
-keep class org.apache.http.** { *; }
|
-keep class org.apache.http.** { *; }
|
||||||
-dontwarn org.apache.http.**
|
-dontwarn org.apache.http.**
|
||||||
-keep class android.support.v7.widget.ShareActionProvider { *; }
|
-keep class android.support.v7.widget.ShareActionProvider { *; }
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import com.facebook.imagepipeline.core.ImagePipelineConfig;
|
||||||
import com.facebook.stetho.Stetho;
|
import com.facebook.stetho.Stetho;
|
||||||
import com.squareup.leakcanary.LeakCanary;
|
import com.squareup.leakcanary.LeakCanary;
|
||||||
import com.squareup.leakcanary.RefWatcher;
|
import com.squareup.leakcanary.RefWatcher;
|
||||||
import com.tspoon.traceur.Traceur;
|
|
||||||
|
|
||||||
import org.acra.ACRA;
|
import org.acra.ACRA;
|
||||||
import org.acra.ReportingInteractionMode;
|
import org.acra.ReportingInteractionMode;
|
||||||
|
|
@ -90,11 +89,6 @@ public class CommonsApplication extends Application {
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
ACRA.init(this);
|
ACRA.init(this);
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
//FIXME: Traceur should be disabled for release builds until error fixed
|
|
||||||
//See https://github.com/commons-app/apps-android-commons/issues/1877
|
|
||||||
Traceur.enableLogging();
|
|
||||||
}
|
|
||||||
|
|
||||||
ApplicationlessInjection
|
ApplicationlessInjection
|
||||||
.getInstance(this)
|
.getInstance(this)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package fr.free.nrw.commons.notification;
|
package fr.free.nrw.commons.notification;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.support.design.animation.ArgbEvaluatorCompat;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
@ -11,7 +12,6 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.daimajia.swipe.SwipeLayout;
|
import com.daimajia.swipe.SwipeLayout;
|
||||||
import com.nineoldandroids.view.ViewHelper;
|
|
||||||
import com.pedrogomez.renderers.Renderer;
|
import com.pedrogomez.renderers.Renderer;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
|
|
@ -82,34 +82,15 @@ public class NotificationRenderer extends Renderer<Notification> {
|
||||||
swipeLayout.addRevealListener(R.id.bottom_wrapper_child1, (child, edge, fraction, distance) -> {
|
swipeLayout.addRevealListener(R.id.bottom_wrapper_child1, (child, edge, fraction, distance) -> {
|
||||||
View star = child.findViewById(R.id.star);
|
View star = child.findViewById(R.id.star);
|
||||||
float d = child.getHeight() / 2 - star.getHeight() / 2;
|
float d = child.getHeight() / 2 - star.getHeight() / 2;
|
||||||
ViewHelper.setTranslationY(star, d * fraction);
|
star.setTranslationY(d * fraction);
|
||||||
ViewHelper.setScaleX(star, fraction + 0.6f);
|
star.setScaleX(fraction + 0.6f);
|
||||||
ViewHelper.setScaleY(star, fraction + 0.6f);
|
star.setScaleY(fraction + 0.6f);
|
||||||
int c = (Integer) evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#90960a0a"));
|
int c = ArgbEvaluatorCompat.getInstance().evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#90960a0a"));
|
||||||
child.setBackgroundColor(c);
|
child.setBackgroundColor(c);
|
||||||
});
|
});
|
||||||
return inflatedView;
|
return inflatedView;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object evaluate(float fraction, Object startValue, Object endValue) {
|
|
||||||
int startInt = (Integer) startValue;
|
|
||||||
int startA = (startInt >> 24) & 0xff;
|
|
||||||
int startR = (startInt >> 16) & 0xff;
|
|
||||||
int startG = (startInt >> 8) & 0xff;
|
|
||||||
int startB = startInt & 0xff;
|
|
||||||
|
|
||||||
int endInt = (Integer) endValue;
|
|
||||||
int endA = (endInt >> 24) & 0xff;
|
|
||||||
int endR = (endInt >> 16) & 0xff;
|
|
||||||
int endG = (endInt >> 8) & 0xff;
|
|
||||||
int endB = endInt & 0xff;
|
|
||||||
|
|
||||||
return (int) ((startA + (int) (fraction * (endA - startA))) << 24) |
|
|
||||||
(int) ((startR + (int) (fraction * (endR - startR))) << 16) |
|
|
||||||
(int) ((startG + (int) (fraction * (endG - startG))) << 8) |
|
|
||||||
(int) ((startB + (int) (fraction * (endB - startB))));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
Notification notification = getContent();
|
Notification notification = getContent();
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,5 @@
|
||||||
-dontoptimize
|
-dontoptimize
|
||||||
-dontshrink
|
-dontshrink
|
||||||
-ignorewarnings
|
-ignorewarnings
|
||||||
|
|
||||||
|
-dontnote **
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||||
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.3'
|
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
|
||||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@ android.enableBuildCache=true
|
||||||
compileSdkVersion=android-28
|
compileSdkVersion=android-28
|
||||||
buildToolsVersion=28.0.3
|
buildToolsVersion=28.0.3
|
||||||
|
|
||||||
SUPPORT_LIB_VERSION=27.1.1
|
SUPPORT_LIB_VERSION=28.0.0
|
||||||
KOTLIN_VERSION=1.2.60
|
KOTLIN_VERSION=1.3.21
|
||||||
BUTTERKNIFE_VERSION=8.8.1
|
BUTTERKNIFE_VERSION=8.8.1
|
||||||
LEAK_CANARY_VERSION=1.5.4
|
LEAK_CANARY_VERSION=1.6.2
|
||||||
DAGGER_VERSION=2.15
|
DAGGER_VERSION=2.15
|
||||||
|
|
||||||
systemProp.http.proxyPort=0
|
systemProp.http.proxyPort=0
|
||||||
|
|
|
||||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
#Sat Nov 03 11:02:51 CET 2018
|
#Thu Mar 14 14:54:52 EDT 2019
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue