diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3db9e4c5ef..71cfd8bca0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,11 +28,6 @@ jobs: # Ensure we are building the branch and not the branch after being merged on develop # https://github.com/actions/checkout/issues/881 ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - - name: Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Configure gradle uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/maestro.yml b/.github/workflows/maestro.yml index b359f44b75..fcd109225d 100644 --- a/.github/workflows/maestro.yml +++ b/.github/workflows/maestro.yml @@ -24,11 +24,6 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - name: Use JDK 17 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Assemble debug APK run: ./gradlew assembleDebug $CI_GRADLE_ARG_PROPERTIES - uses: mobile-dev-inc/action-maestro-cloud@v1.3.1 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 2f7c10a3d0..e5c8447446 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,11 +16,6 @@ jobs: if: ${{ github.repository == 'vector-im/element-x-android' }} steps: - uses: actions/checkout@v3 - - name: Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Install towncrier run: | python3 -m pip install towncrier diff --git a/.github/workflows/nightly_manual.yml b/.github/workflows/nightly_manual.yml index 6e8ef7c684..707d424817 100644 --- a/.github/workflows/nightly_manual.yml +++ b/.github/workflows/nightly_manual.yml @@ -13,11 +13,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Install towncrier run: | python3 -m pip install towncrier diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 06d79e857d..8f6fe6112c 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -8,7 +8,7 @@ on: # Enrich gradle.properties for CI/CD env: - GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options="-Xmx2g" -Dkotlin.incremental=false + GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -XX:MaxPermSize=512m -Dkotlin.daemon.jvm.options="-Xmx2g" -Dkotlin.incremental=false CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon jobs: @@ -21,11 +21,6 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 - - name: Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Configure gradle uses: gradle/gradle-build-action@v2 with: @@ -65,11 +60,6 @@ jobs: cancel-in-progress: true steps: - uses: actions/checkout@v3 - - name: Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Configure gradle uses: gradle/gradle-build-action@v2 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ada7ba1ab3..a4fce4b8e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,11 +25,6 @@ jobs: uses: actions/checkout@v3 with: lfs: 'true' - - name: ☕️ Use JDK 17 - uses: actions/setup-java@v3 - with: - distribution: 'temurin' # See 'Supported distributions' for available options - java-version: '17' - name: Configure gradle uses: gradle/gradle-build-action@v2 with: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cc79516e7f..1e3de32f22 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -25,6 +25,7 @@ import extension.allServicesImpl @Suppress("DSL_SCOPE_VIOLATION") plugins { id("io.element.android-compose-application") + alias(libs.plugins.stem) alias(libs.plugins.kotlin.android) alias(libs.plugins.anvil) alias(libs.plugins.ksp) @@ -139,7 +140,7 @@ android { } } kotlinOptions { - jvmTarget = "17" + jvmTarget = "1.8" } // Waiting for https://github.com/google/ksp/issues/37 @@ -150,10 +151,6 @@ android { } } } - - buildFeatures { - buildConfig = true - } } androidComponents { diff --git a/gradle.properties b/gradle.properties index 15ee7e1fcb..df832c13ba 100644 --- a/gradle.properties +++ b/gradle.properties @@ -46,7 +46,7 @@ signing.element.nightly.keyPassword=Secret # Customise the Lint version to use a more recent version than the one bundled with AGP # https://googlesamples.github.io/android-custom-lint-rules/usage/newer-lint.md.html -android.experimental.lint.version=8.0.0-rc01 +android.experimental.lint.version=8.0.0-alpha10 # Enable test fixture for all modules by default android.experimental.enableTestFixtures=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cfec8a2f2d..aa7ed975b7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ [versions] # Project -android_gradle_plugin = "8.0.0-rc01" +android_gradle_plugin = "7.4.2" firebase_gradle_plugin = "3.2.0" kotlin = "1.8.10" ksp = "1.8.10-1.0.9" @@ -156,6 +156,8 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } dependencygraph = { id = "com.savvasdalkitsis.module-dependency-graph", version.ref = "dependencygraph" } dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "dependencycheck" } +stem = { id = "com.likethesalad.stem", version.ref = "stem" } +stemlibrary = { id = "com.likethesalad.stem-library", version.ref = "stem" } paparazzi = "app.cash.paparazzi:1.2.0" sonarqube = "org.sonarqube:4.0.0.2929" kover = "org.jetbrains.kotlinx.kover:0.6.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4b00b4d231..147d0a111f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -16,8 +16,8 @@ #Fri Oct 07 15:02:00 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionSha256Sum=47a5bfed9ef814f90f8debcbbb315e8e7c654109acd224595ea39fca95c5d4da -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip +distributionSha256Sum=518a863631feb7452b8f1b3dc2aaee5f388355cc3421bbd0275fbeadd77e84b2 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/libraries/core/build.gradle.kts b/libraries/core/build.gradle.kts index b3695b861a..dad8f844cc 100644 --- a/libraries/core/build.gradle.kts +++ b/libraries/core/build.gradle.kts @@ -23,8 +23,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } dependencies { diff --git a/libraries/coroutines/build.gradle.kts b/libraries/coroutines/build.gradle.kts index 10cfd0ee80..f9f12e0b09 100644 --- a/libraries/coroutines/build.gradle.kts +++ b/libraries/coroutines/build.gradle.kts @@ -21,8 +21,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } dependencies { diff --git a/libraries/designsystem/build.gradle.kts b/libraries/designsystem/build.gradle.kts index aea3c89305..45430e5d82 100644 --- a/libraries/designsystem/build.gradle.kts +++ b/libraries/designsystem/build.gradle.kts @@ -24,10 +24,6 @@ plugins { android { namespace = "io.element.android.libraries.designsystem" - buildFeatures { - buildConfig = true - } - dependencies { // Should not be there, but this is a POC implementation(libs.coil.compose) diff --git a/libraries/matrix/api/build.gradle.kts b/libraries/matrix/api/build.gradle.kts index aee8c7b840..3a2fd2472a 100644 --- a/libraries/matrix/api/build.gradle.kts +++ b/libraries/matrix/api/build.gradle.kts @@ -25,10 +25,6 @@ plugins { android { namespace = "io.element.android.libraries.matrix.api" - - buildFeatures { - buildConfig = true - } } anvil { diff --git a/libraries/statemachine/build.gradle.kts b/libraries/statemachine/build.gradle.kts index 5757c9fe4f..31fe22b5f8 100644 --- a/libraries/statemachine/build.gradle.kts +++ b/libraries/statemachine/build.gradle.kts @@ -23,8 +23,8 @@ plugins { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } dependencies { diff --git a/libraries/ui-strings/build.gradle.kts b/libraries/ui-strings/build.gradle.kts index df27a9e5e8..33dc7d6ba6 100644 --- a/libraries/ui-strings/build.gradle.kts +++ b/libraries/ui-strings/build.gradle.kts @@ -18,8 +18,15 @@ @Suppress("DSL_SCOPE_VIOLATION") plugins { id("io.element.android-library") + alias(libs.plugins.stemlibrary) } android { namespace = "io.element.android.libraries.ui.strings" } + +// forcing the stem string template generator to be cacheable, without this the templates +// are regenerated causing the app module to recompile its sources +tasks.withType(com.likethesalad.android.templates.common.tasks.BaseTask::class.java) { + outputs.cacheIf { true } +} diff --git a/plugins/src/main/kotlin/Versions.kt b/plugins/src/main/kotlin/Versions.kt index 36a3a33e70..6236bfd307 100644 --- a/plugins/src/main/kotlin/Versions.kt +++ b/plugins/src/main/kotlin/Versions.kt @@ -24,6 +24,6 @@ object Versions { const val compileSdk = 33 const val targetSdk = 33 const val minSdk = 23 - val javaCompileVersion = JavaVersion.VERSION_17 + val javaCompileVersion = JavaVersion.VERSION_11 val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(11) } diff --git a/plugins/src/main/kotlin/extension/CommonExtension.kt b/plugins/src/main/kotlin/extension/CommonExtension.kt index 52df186a66..16e9b13c1c 100644 --- a/plugins/src/main/kotlin/extension/CommonExtension.kt +++ b/plugins/src/main/kotlin/extension/CommonExtension.kt @@ -32,8 +32,8 @@ fun CommonExtension<*, *, *, *>.androidConfig(project: Project) { compileOptions { isCoreLibraryDesugaringEnabled = true - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } testOptions { diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index 62ecbd4f96..314421ebc8 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -16,17 +16,14 @@ package extension +import gradle.kotlin.dsl.accessors._71f190358cebd46a469f2989484fd643.androidTestImplementation +import gradle.kotlin.dsl.accessors._71f190358cebd46a469f2989484fd643.debugImplementation +import gradle.kotlin.dsl.accessors._71f190358cebd46a469f2989484fd643.implementation import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.project import java.io.File -private fun DependencyHandlerScope.implementation(dependency: Any) = dependencies.add("implementation", dependency) - -private fun DependencyHandlerScope.androidTestImplementation(dependency: Any) = dependencies.add("androidTestImplementation", dependency) - -private fun DependencyHandlerScope.debugImplementation(dependency: Any) = dependencies.add("debugImplementation", dependency) - /** * Dependencies used by all the modules */