diff --git a/.travis.yml b/.travis.yml index 2c48cd70e..dcbf8137e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,15 +20,10 @@ android: - extra-android-m2repository - android-22 - android-28 - - sys-img-${ANDROID_ABI}-${ANDROID_TARGET} licenses: - 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: -- "./gradlew clean check connectedCheck jacocoTestReport" +- "./gradlew -Pcoverage clean check jacocoTestReport" - if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then mkdir -p app/src/prodRelease/play/release-notes/en-US; fi diff --git a/app/build.gradle b/app/build.gradle index c842bb6dd..e4847c49e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,15 +19,15 @@ dependencies { implementation 'com.google.code.gson:gson:2.8.5' implementation 'info.debatty:java-string-similarity:0.24' implementation 'in.yuvi:http.fluent:1.3' - implementation 'com.squareup.okhttp3:okhttp:3.10.0' - implementation 'com.squareup.okio:okio:1.14.0' + implementation 'com.squareup.okhttp3:okhttp:3.12.1' + implementation 'com.squareup.okio:okio:1.15.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-support-v4:2.1.1' implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7: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' // UI @@ -38,12 +38,11 @@ dependencies { implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0' implementation 'com.dinuscxj:circleprogressbar:1.1.1' implementation 'com.karumi:dexter:5.0.0' - implementation files('libs/simplemagic-1.9.jar') implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION" kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION" // Logging 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' api('com.github.tony19:logback-android-classic:1.1.1-6') { exclude group: 'com.google.android', module: 'android' @@ -73,7 +72,6 @@ dependencies { androidTestImplementation 'org.mockito:mockito-core:2.10.0' // Debugging - implementation 'com.tspoon.traceur:traceur:1.0.1' implementation 'com.facebook.stetho:stetho:1.5.0' debugImplementation "com.squareup.leakcanary:leakcanary-android:$LEAK_CANARY_VERSION" releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY_VERSION" @@ -89,7 +87,6 @@ dependencies { //swipe_layout implementation 'com.daimajia.swipelayout:library:1.2.0@aar' - implementation 'com.nineoldandroids:library:2.4.0' //metadata extractor implementation 'com.drewnoakes:metadata-extractor:2.11.0' } @@ -105,7 +102,7 @@ android { setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName()) minSdkVersion 15 - targetSdkVersion 27 + targetSdkVersion 28 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true } @@ -142,7 +139,7 @@ android { } debug { minifyEnabled true - testCoverageEnabled true + testCoverageEnabled project.hasProperty('coverage') proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' testProguardFile 'test-proguard-rules.txt' versionNameSuffix "-debug-" + getBranchName() diff --git a/app/libs/simplemagic-1.9.jar b/app/libs/simplemagic-1.9.jar deleted file mode 100644 index 59533b049..000000000 Binary files a/app/libs/simplemagic-1.9.jar and /dev/null differ diff --git a/app/proguard-rules.txt b/app/proguard-rules.txt index d023294dc..1fda6bb54 100644 --- a/app/proguard-rules.txt +++ b/app/proguard-rules.txt @@ -1,6 +1,10 @@ -dontobfuscate -ignorewarnings +-dontnote ** +-dontwarn net.bytebuddy.** +-dontwarn org.mockito.** + -keep class org.apache.http.** { *; } -dontwarn org.apache.http.** -keep class android.support.v7.widget.ShareActionProvider { *; } diff --git a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java index e99de01e2..f512b042b 100644 --- a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java +++ b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.java @@ -16,7 +16,6 @@ import com.facebook.imagepipeline.core.ImagePipelineConfig; import com.facebook.stetho.Stetho; import com.squareup.leakcanary.LeakCanary; import com.squareup.leakcanary.RefWatcher; -import com.tspoon.traceur.Traceur; import org.acra.ACRA; import org.acra.ReportingInteractionMode; @@ -90,11 +89,6 @@ public class CommonsApplication extends Application { public void onCreate() { super.onCreate(); 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 .getInstance(this) diff --git a/app/src/main/java/fr/free/nrw/commons/notification/NotificationRenderer.java b/app/src/main/java/fr/free/nrw/commons/notification/NotificationRenderer.java index 4033a005c..d0b7683f0 100644 --- a/app/src/main/java/fr/free/nrw/commons/notification/NotificationRenderer.java +++ b/app/src/main/java/fr/free/nrw/commons/notification/NotificationRenderer.java @@ -1,6 +1,7 @@ package fr.free.nrw.commons.notification; import android.graphics.Color; +import android.support.design.animation.ArgbEvaluatorCompat; import android.text.Html; import android.view.LayoutInflater; import android.view.View; @@ -11,7 +12,6 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.daimajia.swipe.SwipeLayout; -import com.nineoldandroids.view.ViewHelper; import com.pedrogomez.renderers.Renderer; import butterknife.BindView; @@ -82,34 +82,15 @@ public class NotificationRenderer extends Renderer { swipeLayout.addRevealListener(R.id.bottom_wrapper_child1, (child, edge, fraction, distance) -> { View star = child.findViewById(R.id.star); float d = child.getHeight() / 2 - star.getHeight() / 2; - ViewHelper.setTranslationY(star, d * fraction); - ViewHelper.setScaleX(star, fraction + 0.6f); - ViewHelper.setScaleY(star, fraction + 0.6f); - int c = (Integer) evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#90960a0a")); + star.setTranslationY(d * fraction); + star.setScaleX(fraction + 0.6f); + star.setScaleY(fraction + 0.6f); + int c = ArgbEvaluatorCompat.getInstance().evaluate(fraction, Color.parseColor("#dddddd"), Color.parseColor("#90960a0a")); child.setBackgroundColor(c); }); 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 public void render() { Notification notification = getContent(); diff --git a/app/test-proguard-rules.txt b/app/test-proguard-rules.txt index 3b560b25a..6a60ecf72 100644 --- a/app/test-proguard-rules.txt +++ b/app/test-proguard-rules.txt @@ -2,3 +2,5 @@ -dontoptimize -dontshrink -ignorewarnings + +-dontnote ** diff --git a/build.gradle b/build.gradle index 79c6d7248..07b1a7e09 100644 --- a/build.gradle +++ b/build.gradle @@ -6,8 +6,8 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' - classpath 'com.dicedmelon.gradle:jacoco-android:0.1.3' + classpath 'com.android.tools.build:gradle:3.3.2' + classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4' classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" diff --git a/gradle.properties b/gradle.properties index 219730504..806180475 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,10 +18,10 @@ android.enableBuildCache=true compileSdkVersion=android-28 buildToolsVersion=28.0.3 -SUPPORT_LIB_VERSION=27.1.1 -KOTLIN_VERSION=1.2.60 +SUPPORT_LIB_VERSION=28.0.0 +KOTLIN_VERSION=1.3.21 BUTTERKNIFE_VERSION=8.8.1 -LEAK_CANARY_VERSION=1.5.4 +LEAK_CANARY_VERSION=1.6.2 DAGGER_VERSION=2.15 systemProp.http.proxyPort=0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 71869afd4..394c95658 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Nov 03 11:02:51 CET 2018 +#Thu Mar 14 14:54:52 EDT 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME 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