Skip to content

Commit

Permalink
Update to Kotlin 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Jun 1, 2024
1 parent 04c6241 commit ecbdcce
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 135 deletions.
132 changes: 0 additions & 132 deletions app/build.gradle

This file was deleted.

103 changes: 103 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.android.application")
id("kotlin-android")
alias(libs.plugins.compose.compiler)
}

android {
compileSdk = 34

defaultConfig {
applicationId = "de.jensklingenberg.jetpackcomposeplayground"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}

namespace = "de.jensklingenberg.jetpackcomposeplayground"

}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.buildDir.absolutePath}/compose_compiler"
)
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.buildDir.absolutePath}/compose_compiler"
)
}
}
val compose_version = "1.6.7"
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("androidx.activity:activity-compose:1.9.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.compose.animation:animation-core:$compose_version")
implementation("androidx.compose.animation:animation:$compose_version")
implementation("androidx.compose.foundation:foundation-layout:$compose_version")
implementation("androidx.compose.foundation:foundation:$compose_version")
implementation("androidx.compose.material:material-icons-core:$compose_version")
implementation("androidx.compose.material:material-icons-extended:$compose_version")
implementation("androidx.compose.material:material:$compose_version")
implementation("androidx.compose.material:material:$compose_version")
implementation("androidx.compose.runtime:runtime-livedata:$compose_version")
implementation("androidx.compose.runtime:runtime-rxjava2:$compose_version")
implementation("androidx.compose.ui:ui-geometry:$compose_version")
implementation("androidx.compose.ui:ui-graphics:$compose_version")
implementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.compose.ui:ui-viewbinding:$compose_version")
implementation("androidx.compose.ui:ui-text:$compose_version")
implementation("androidx.compose.ui:ui-util:$compose_version")
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
androidTestImplementation("androidx.compose.ui:ui-test:$compose_version")
androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test:core:1.5.0")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
androidTestImplementation("org.mockito:mockito-core:5.3.1")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")

androidTestImplementation("com.adevinta.android:barista:4.3.0") {
exclude(group = "org.jetbrains.kotlin")
}
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradl.
#
# For more details, see
# https://developer.android.com/guide/developing/tools/proguard.html
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

buildscript {
ext {
compose_version = '1.6.3'
kotlin_version = "1.9.22"
compose_version = '1.6.7'
kotlin_version = "2.0.0"
}
repositories {
google()
Expand Down
8 changes: 8 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[versions]
kotlin = "2.0.0"
compose_version = "1.6.7"
[plugins]
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }


compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

0 comments on commit ecbdcce

Please sign in to comment.