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

Update kotlin monorepo to v2 (major) #181

Merged
merged 2 commits into from
Jun 10, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
cache: gradle

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
.kotlin/

# Gradle files
.gradle/
Expand Down Expand Up @@ -69,4 +70,4 @@ lint/tmp/
.LSOverride

# Secrets
/secrets.profile
/secrets.profile
7 changes: 3 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.compose.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
id(libs.plugins.dagger.hilt.get().pluginId)
id(libs.plugins.kotlinter.get().pluginId)
}

kotlin {
explicitApi()
jvmToolchain(17)
jvmToolchain(21)
}

android {
Expand All @@ -29,6 +30,7 @@ android {
}
kotlinOptions {
allWarningsAsErrors = true
freeCompilerArgs += listOf("-Xsuppress-version-warnings")
}
lint {
warningsAsErrors = true
Expand All @@ -49,9 +51,6 @@ android {
viewBinding = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
1 change: 1 addition & 0 deletions build-logic/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
implementation(libs.plugin.androidx.navigationSafeArgs)
implementation(libs.plugin.dagger.hilt)
implementation(libs.plugin.kotlin)
implementation(libs.plugin.kotlin.compose)
implementation(libs.plugin.kotlinter)
implementation(libs.plugin.square.sqlDelight)
implementation(libs.plugin.twitter.compose)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("svpolitician-android-library")
id("org.jetbrains.kotlin.plugin.compose")
}

val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
Expand All @@ -9,8 +10,6 @@ android {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion =
libs.findVersion("androidx.compose.compiler").get().toString()
useLiveLiterals = true
}
kotlinOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ kapt {
correctErrorTypes = true // Required by hilt
}

android {
kotlinOptions {
freeCompilerArgs += listOf("-Xsuppress-version-warnings")
}
}

hilt {
enableAggregatingTask = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val libs: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().name

kotlin {
explicitApi()
jvmToolchain(17)
jvmToolchain(21)
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {

kotlin {
explicitApi()
jvmToolchain(17)
jvmToolchain(21)
}

tasks.compileKotlin {
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.dagger.hilt) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.kotlin.serialization) apply false
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
org.gradle.configuration-cache=true
kapt.use.k2=true
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ android-minSdk = "26"
android-targetSdk = "34"
androidx-activity = "1.9.0"
androidx-fragment = "1.7.1"
androidx-compose-compiler = "1.5.14"
androidx-hilt = "1.2.0"
androidx-lifecycle = "2.8.1"
androidx-lifecycle = "2.7.0"
androidx-navigation = "2.7.7"
dagger-hilt = "2.51.1"
kotlin = "1.9.24"
kotlin = "2.0.0"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.6.3"
plugin-android = "8.4.2"
Expand All @@ -26,7 +25,6 @@ androidx-activity = { module = "androidx.activity:activity-ktx", version.ref = "
androidx-activityCompose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-appcompat = "androidx.appcompat:appcompat:1.7.0"
androidx-composeBom = "androidx.compose:compose-bom:2024.05.00"
androidx-composeCompiler = { module = "androidx.compose.compiler:compiler", version.ref = "androidx-compose-compiler" }
androidx-composeAnimation = { module = "androidx.compose.animation:animation" }
androidx-composeFoundation = { module = "androidx.compose.foundation:foundation" }
androidx-composeMaterial3 = { module = "androidx.compose.material3:material3" }
Expand Down Expand Up @@ -81,6 +79,7 @@ plugin-android = { module = "com.android.tools.build:gradle", version.ref = "plu
plugin-androidx-navigationSafeArgs = { module = "androidx.navigation:navigation-safe-args-gradle-plugin", version.ref = "androidx-navigation" }
plugin-dagger-hilt = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "dagger-hilt" }
plugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
plugin-kotlin-compose = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" }
plugin-kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
plugin-kotlinter = { module = "org.jmailen.gradle:kotlinter-gradle", version.ref = "plugin-kotlinter" }
plugin-square-sqlDelight = { module = "app.cash.sqldelight:gradle-plugin", version.ref = "cash-sqlDelight" }
Expand All @@ -95,6 +94,7 @@ android-application = { id = "com.android.application", version.ref = "plugin-an
android-library = { id = "com.android.library", version.ref = "plugin-android" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger-hilt" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
Expand Down
9 changes: 4 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://androidx.dev/storage/compose-compiler/repository/")
}
}

// Gradle dependencies --scan
plugins {
`gradle-enterprise`
id("com.gradle.develocity") version "3.17.4"
}

gradleEnterprise {
develocity {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
termsOfUseUrl = "https://gradle.com/terms-of-service"
termsOfUseAgree = "yes"
}
}

Expand Down