Skip to content

Commit

Permalink
chore: upgrade Gradle, Kotlin, Java and AndroidX libs.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Oct 31, 2023
1 parent fa6bf89 commit 7828371
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 45 deletions.
1 change: 0 additions & 1 deletion build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package io.openfeedback.extensions

import com.android.build.api.dsl.CommonExtension
import com.android.build.gradle.LibraryExtension
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
Expand All @@ -12,24 +11,24 @@ import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

internal fun CommonExtension<*, *, *, *>.configureKotlinAndroid() {
compileSdk = 33
internal fun CommonExtension<*, *, *, *, *>.configureKotlinAndroid() {
compileSdk = 34

defaultConfig {
minSdk = 21
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

internal fun CommonExtension<*, *, *, *>.configureAndroidCompose(project: Project) {
internal fun CommonExtension<*, *, *, *, *>.configureAndroidCompose(project: Project) {
val libs = project.extensions.getByType<VersionCatalogsExtension>().named("libs")

buildFeatures {
Expand All @@ -46,6 +45,6 @@ internal fun CommonExtension<*, *, *, *>.configureAndroidCompose(project: Projec
}
}

private fun CommonExtension<*, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
private fun CommonExtension<*, *, *, *, *>.kotlinOptions(block: KotlinJvmOptions.() -> Unit) {
(this as ExtensionAware).extensions.configure("kotlinOptions", block)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

fun TaskContainer.configureKotlinCompiler() = withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
jvmTarget = JavaVersion.VERSION_17.toString()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ComposeLibraryPlugin : Plugin<Project> {
target.extensions.configure<LibraryExtension> {
configureKotlinAndroid()
configureAndroidCompose(target)
defaultConfig.targetSdk = 33
defaultConfig.targetSdk = 34
}
target.tasks.configureKotlinCompiler()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LibraryPlugin : Plugin<Project> {
target.extensions.create("openfeedback", OpenFeedback::class.java, target)
target.extensions.configure<LibraryExtension> {
configureKotlinAndroid()
defaultConfig.targetSdk = 33
defaultConfig.targetSdk = 34
}
target.tasks.configureKotlinCompiler()
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
16 changes: 8 additions & 8 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[versions]
kotlin_lang = "1.7.20"
kotlin_coroutines = "1.6.4"
androidx_core = "1.7.0"
androidx_compose_bom = "2022.10.00"
androidx_compose_compiler = "1.3.2"
androidx_lifecycle = "2.4.1"
androidx_savedstate = "1.1.0"
kotlin_lang = "1.9.10"
kotlin_coroutines = "1.7.3"
androidx_core = "1.12.0"
androidx_compose_bom = "2023.10.01"
androidx_compose_compiler = "1.5.3"
androidx_lifecycle = "2.6.2"
androidx_savedstate = "1.2.1"
firebase_firestore = "24.0.1"
firebase_auth = "21.0.1"

[libraries]
android-gradle-plugin = "com.android.tools.build:gradle:7.3.1"
android-gradle-plugin = "com.android.tools.build:gradle:8.1.2"
vespene = "net.mbonnin.vespene:vespene-lib:0.5"

kotlin_gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin_lang" }
Expand Down
4 changes: 4 additions & 0 deletions openfeedback-m2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id("io.openfeedback.plugins.compose.lib")
}

android {
namespace = "io.openfeedback.android.m2"
}

openfeedback {
configurePublishing("feedback-android-sdk-m2")
}
Expand Down
2 changes: 0 additions & 2 deletions openfeedback-m2/src/main/AndroidManifest.xml

This file was deleted.

4 changes: 4 additions & 0 deletions openfeedback-m3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id("io.openfeedback.plugins.compose.lib")
}

android {
namespace = "io.openfeedback.android.m3"
}

openfeedback {
configurePublishing("feedback-android-sdk-m3")
}
Expand Down
2 changes: 0 additions & 2 deletions openfeedback-m3/src/main/AndroidManifest.xml

This file was deleted.

4 changes: 4 additions & 0 deletions openfeedback-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id("io.openfeedback.plugins.compose.lib")
}

android {
namespace = "io.openfeedback.android.ui"
}

openfeedback {
configurePublishing("feedback-android-sdk-ui")
}
Expand Down
7 changes: 0 additions & 7 deletions openfeedback-ui/src/main/AndroidManifest.xml

This file was deleted.

4 changes: 4 additions & 0 deletions openfeedback-viewmodel/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id("io.openfeedback.plugins.compose.lib")
}

android {
namespace = "io.openfeedback.android.viewmodel"
}

openfeedback {
configurePublishing("feedback-android-sdk-viewmodel")
}
Expand Down
2 changes: 0 additions & 2 deletions openfeedback-viewmodel/src/main/AndroidManifest.xml

This file was deleted.

4 changes: 4 additions & 0 deletions openfeedback/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ plugins {
id("io.openfeedback.plugins.lib")
}

android {
namespace = "io.openfeedback.android"
}

openfeedback {
configurePublishing("feedback-android-sdk")
}
Expand Down
7 changes: 0 additions & 7 deletions openfeedback/src/main/AndroidManifest.xml

This file was deleted.

1 change: 1 addition & 0 deletions sample-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
}

android {
namespace = "io.openfeedback.android.sample"
defaultConfig {
versionCode = 1
versionName = "1"
Expand Down
3 changes: 1 addition & 2 deletions sample-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.openfeedback.android.sample">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
enableFeaturePreview("VERSION_CATALOGS")

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
Expand Down

0 comments on commit 7828371

Please sign in to comment.