diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 5406dd1f..6a607283 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -60,7 +60,7 @@ jobs: uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: "temurin" - java-version: 25 + java-version: 21.0.13+9 - name: Install dependencies run: | sudo apt install python3-defusedxml diff --git a/.github/workflows/assemble.yml b/.github/workflows/assemble.yml index 525161db..f17e01ab 100644 --- a/.github/workflows/assemble.yml +++ b/.github/workflows/assemble.yml @@ -18,11 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: "temurin" - java-version: 17.0.21+9 + java-version: 21.0.13+9 - name: Setup Gradle uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0 - name: Assemble diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 04661fe8..9dd44340 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -24,11 +24,11 @@ jobs: task: [ detekt, spotlessKotlinCheck, lint ] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: "temurin" - java-version: 17.0.21+9 + java-version: 21.0.13+9 - name: Setup Gradle uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0 - name: Check ${{ matrix.task }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ca30e100..f7e2b603 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,7 +50,7 @@ jobs: uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: "temurin" - java-version: 25 + java-version: 21.0.13+9 - name: Assemble run: | mkdir -p "$HOME/.gradle" diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 447c5461..355de2e1 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: 'temurin' - java-version: '17.0.21+9' + java-version: '21.0.13+9' check-latest: true cache: 'gradle' - name: Validate Gradle Wrapper @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0 with: distribution: 'temurin' - java-version: '17.0.21+9' + java-version: '21.0.13+9' check-latest: true cache: 'gradle' - name: Unit tests diff --git a/build.gradle b/build.gradle index 37947d91..85d4a3c0 100644 --- a/build.gradle +++ b/build.gradle @@ -17,11 +17,6 @@ buildscript { composeBomVersion = "2026.09.00" kotlinxSerializationVersion = "1.12.0" jUnitVersion = "4.13.2" - androidXTestVersion = "1.3.0" - androidXEspressoTestVersion = "3.7.0" - mockkVersion = "1.14.11" - mockitoVersion = "5.24.0" - mockitoKotlinVersion = "6.4.0" } } diff --git a/core/build.gradle b/core/build.gradle index 98949a00..eb5011cd 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -13,7 +13,7 @@ plugins { android { namespace 'com.nextcloud.android.common.core' defaultConfig { - minSdk = 21 + minSdk = 26 compileSdk = 37 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -27,8 +27,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } namespace 'com.nextcloud.android.common.core' @@ -44,17 +44,11 @@ android { dependencies { implementation 'androidx.core:core-ktx:1.19.1' - implementation 'androidx.appcompat:appcompat:1.8.0' implementation 'com.google.android.material:material:1.14.0' testImplementation "junit:junit:$jUnitVersion" testImplementation 'androidx.test:core:1.7.0' testImplementation 'org.robolectric:robolectric:4.17' - testImplementation "org.mockito:mockito-core:$mockitoVersion" - testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion" - testImplementation "io.mockk:mockk:$mockkVersion" - androidTestImplementation "androidx.test.ext:junit:$androidXTestVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidXEspressoTestVersion" } afterEvaluate { diff --git a/core/src/main/java/com/nextcloud/android/common/core/utils/DateFormatter.kt b/core/src/main/java/com/nextcloud/android/common/core/utils/DateFormatter.kt index 2872de77..2ba5ce4f 100644 --- a/core/src/main/java/com/nextcloud/android/common/core/utils/DateFormatter.kt +++ b/core/src/main/java/com/nextcloud/android/common/core/utils/DateFormatter.kt @@ -8,7 +8,6 @@ package com.nextcloud.android.common.core.utils import android.content.Context -import android.os.Build import android.text.format.DateFormat import com.nextcloud.android.common.core.R import java.text.SimpleDateFormat @@ -24,14 +23,7 @@ class DateFormatter(private val context: Context) { private val sdfYears: SimpleDateFormat init { - val locale = - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - this.context.resources.configuration - .getLocales() - .get(0) - } else { - this.context.resources.configuration.locale - } + val locale = this.context.resources.configuration.locales[0] this.sdfDays = SimpleDateFormat(DateFormat.getBestDateTimePattern(locale, "EEE"), locale) this.sdfMonths = SimpleDateFormat(DateFormat.getBestDateTimePattern(locale, "MMM d"), locale) diff --git a/gradle.properties b/gradle.properties index 616a029d..3976f8d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,9 +9,10 @@ kotlin.code.style=official # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true android.nonFinalResIds=false -android.defaults.buildfeatures.resvalues=true -android.enableAppCompileTimeRClass=false -android.uniquePackageNames=false -android.dependency.useConstraints=true -android.r8.strictFullModeForKeepRules=false -android.newDsl=false + +org.gradle.caching=true +org.gradle.parallel=true +org.gradle.configureondemand=true +org.gradle.daemon=true +org.gradle.configuration-cache=true +org.gradle.tooling.parallel=true diff --git a/jitpack.yml b/jitpack.yml index 2c6e35da..0f04be31 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2022-2023 Nextcloud GmbH and Nextcloud contributors # SPDX-License-Identifier: MIT jdk: - - openjdk17 + - openjdk21 diff --git a/material-color-utilities/build.gradle b/material-color-utilities/build.gradle index d65fdbb3..0c05b988 100644 --- a/material-color-utilities/build.gradle +++ b/material-color-utilities/build.gradle @@ -12,8 +12,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } dependencies { diff --git a/sample/build.gradle b/sample/build.gradle index 1002157d..ef78b3fb 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -29,8 +29,8 @@ android { } } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } buildFeatures { @@ -47,7 +47,4 @@ dependencies { implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.11.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0' implementation project(path: ':ui') - testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.3.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0' } diff --git a/ui/build.gradle b/ui/build.gradle index 96918ea6..79431354 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -29,8 +29,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } namespace 'com.nextcloud.android.common.ui' @@ -70,18 +70,13 @@ dependencies { implementation("io.coil-kt.coil3:coil-network-okhttp:$coilVersion") implementation("io.coil-kt.coil3:coil-svg:$coilVersion") - implementation("com.vanniktech:ui:0.10.0") - implementation 'androidx.core:core-ktx:1.19.1' implementation 'androidx.appcompat:appcompat:1.8.0' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.3.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0' // region okhttp implementation(platform("com.squareup.okhttp3:okhttp-bom:$okHttpVersion")) implementation("com.squareup.okhttp3:okhttp") - implementation("com.squareup.okhttp3:logging-interceptor") // endregion implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion") @@ -89,7 +84,6 @@ dependencies { implementation project(':core') api project(':material-color-utilities') - implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0' implementation 'com.google.android.material:material:1.14.0'