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

Chore: Update Gradle and Android core dependencies #583

Merged
merged 7 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
- "StableFullRelease"
- "StableFdroidRelease"
steps:
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- run: ./gradlew build${{ matrix.version }} && ./gradlew clean
6 changes: 3 additions & 3 deletions .github/workflows/emulator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
api-level: [29]
target: [google_apis]
steps:
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- run: ./gradlew testStableFullRelease
- name: uploads test results
uses: actions/upload-artifact@v2
Expand Down
42 changes: 19 additions & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}
}

flavorDimensions 'testing', 'license'
flavorDimensions = ['testing', 'license']
productFlavors {
stable {
dimension 'testing'
Expand Down Expand Up @@ -90,10 +90,6 @@ android {
setIgnore(true)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding = true
}
Expand All @@ -106,9 +102,9 @@ dependencies {
// AndroidX
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
implementation 'androidx.lifecycle:lifecycle-process:2.6.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
implementation 'com.google.guava:guava:30.1.1-android'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
Expand All @@ -127,7 +123,7 @@ dependencies {
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'

implementation 'com.github.xanscale.LocalhostToolkit:app:19.05.01'
implementation 'com.airbnb.android:lottie:3.0.7'
implementation 'com.airbnb.android:lottie:6.0.0'
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'ru.noties:markwon:2.0.1'
implementation 'commons-io:commons-io:2.6'
Expand All @@ -137,49 +133,49 @@ dependencies {
// Flavor
fullImplementation platform('com.google.firebase:firebase-bom:26.3.0')
fullImplementation 'com.google.firebase:firebase-messaging'
fullImplementation 'ly.count.android:sdk:21.11.0'
fullImplementation 'ly.count.android:sdk:23.6.0'
fullImplementation 'io.sentry:sentry-android:6.3.0'
fullImplementation 'com.google.android.play:core:1.10.3'

// Dependency Injection
implementation 'com.google.dagger:dagger:2.36'
annotationProcessor 'com.google.dagger:dagger-compiler:2.36'
implementation 'com.google.dagger:dagger:2.44.2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.44.2'

// Logger
implementation project(':applogger')

// Testing
// Unit Testing
testImplementation 'junit:junit:4.13.2'
testImplementation 'androidx.test:core:1.4.0'
testImplementation 'androidx.test:runner:1.4.0'
testImplementation 'androidx.test:rules:1.4.0'
testImplementation 'androidx.test:core:1.5.0'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test:rules:1.5.0'
testImplementation 'org.mockito:mockito-core:4.6.1'
testImplementation 'org.mockito:mockito-inline:4.6.1'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'com.github.blocoio:faker:1.2.8'
testImplementation 'org.ooni:oonimkall:2023.07.18-162729'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.36'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.44.2'

// Instrumentation Testing
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
androidTestImplementation 'com.github.blocoio:faker:1.2.8'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.4.0') {
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.5.1') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0') {
androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1') {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestImplementation('com.schibsted.spain:barista:3.9.0')
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.36"
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.44.2"
}

static def versionCodeDate() {
Expand Down
22 changes: 14 additions & 8 deletions app/jacoco.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'jacoco'

jacoco {
toolVersion '0.8.5'
toolVersion '0.8.7'
}

task jacocoAndroidTestReport(type: JacocoReport) {
Expand Down Expand Up @@ -48,13 +48,19 @@ task jacocoAndroidTestReport(type: JacocoReport) {
executionData.from += fileTree(dir: codeCoverageDataLocation, includes: ['**/*.ec'])
}

reports {
html.enabled true
html.destination file("${buildDir}/reports/coverage")
xml.enabled true
xml.destination file("${buildDir}/reports/coverage.xml")
csv.enabled false
}
reports {
html {
enabled true
destination file("${buildDir}/reports/coverage")
}
xml {
enabled true
destination file("${buildDir}/reports/coverage.xml")
}
csv {
enabled false
}
}

doLast {
println "Wrote HTML coverage report to ${reports.html.destination}/index.html"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.sentry.android.core.SentryAndroid;
import ly.count.android.sdk.Countly;
import ly.count.android.sdk.CountlyConfig;
import ly.count.android.sdk.messaging.CountlyConfigPush;
import ly.count.android.sdk.messaging.CountlyPush;

public class ThirdPartyServices {
Expand Down Expand Up @@ -48,7 +49,9 @@ public static void initCountly(Application app) {

public static void registerPush(Application app){
if (Countly.sharedInstance().isInitialized()) {
CountlyPush.init(app, BuildConfig.DEBUG ? Countly.CountlyMessagingMode.TEST : Countly.CountlyMessagingMode.PRODUCTION);
CountlyConfigPush countlyConfigPush = new CountlyConfigPush(app, BuildConfig.DEBUG ? Countly.CountlyMessagingMode.TEST : Countly.CountlyMessagingMode.PRODUCTION)
.setProvider(Countly.CountlyMessagingProvider.FCM);
CountlyPush.init(countlyConfigPush);
NotificationUtility.setChannel(app, CountlyPush.CHANNEL_ID, app.getString(R.string.Settings_Notifications_Label), true, true, true);
ThirdPartyServices.setToken(app);
}
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ buildscript {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0'
}
}

Expand All @@ -21,6 +21,6 @@ allprojects {
}
}

task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
9 changes: 4 additions & 5 deletions engine/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdk 33

defaultConfig {
minSdkVersion 19
targetSdkVersion 30
minSdk 19
targetSdk 33
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

flavorDimensions 'testing'
flavorDimensions = ['testing']
productFlavors {
stable {
dimension 'testing'
Expand Down
17 changes: 16 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,24 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# https://github.com/JakeWharton/butterknife/issues/1686
org.gradle.jvmargs=-Xmx1920M \
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists