diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7ebfdd4..3ed5523 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -10,6 +10,7 @@ on: jobs: build_and_test: + name: build_and_test runs-on: ubuntu-latest steps: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b37e59a..32e694a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,14 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { + // Default alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) alias(libs.plugins.kotlin.compose) + + // New + alias(libs.plugins.kotlin.ksp) + alias(libs.plugins.dagger.hilt.android) } android { @@ -28,19 +35,29 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - kotlinOptions { - jvmTarget = "11" + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } + buildFeatures { compose = true } + + java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } + } } -dependencies { +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) + } +} +dependencies { + // Default implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.activity.compose) @@ -56,4 +73,14 @@ dependencies { androidTestImplementation(libs.androidx.ui.test.junit4) debugImplementation(libs.androidx.ui.tooling) debugImplementation(libs.androidx.ui.test.manifest) + + // New + ksp(libs.dagger.hilt.android.compiler) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.dagger.hilt.android) + implementation(libs.androidx.material3.icons.extended) + implementation(libs.squareup.retrofit2) + implementation(libs.squareup.retrofit2.converter.gson) + implementation(libs.google.gson) } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 16e2f86..5222b0b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,10 @@ + + + diff --git a/app/src/main/java/com/debatetimer/app/MainActivity.kt b/app/src/main/java/com/debatetimer/app/MainActivity.kt index c8f4cce..9969ac7 100644 --- a/app/src/main/java/com/debatetimer/app/MainActivity.kt +++ b/app/src/main/java/com/debatetimer/app/MainActivity.kt @@ -1,5 +1,6 @@ package com.debatetimer.app +import android.app.Application import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent @@ -12,7 +13,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import com.debatetimer.app.ui.theme.DebateTimerTheme +import dagger.hilt.android.AndroidEntryPoint +import dagger.hilt.android.HiltAndroidApp +@HiltAndroidApp +class DebateTimerApp : Application() + +@AndroidEntryPoint class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/build.gradle.kts b/build.gradle.kts index 952b930..7177efd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,11 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { + // Default alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.kotlin.compose) apply false + + // New + alias(libs.plugins.kotlin.ksp) apply false + alias(libs.plugins.dagger.hilt.android) apply false } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 739703c..2f3f2cd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,15 +1,25 @@ [versions] +# Default agp = "8.11.1" -kotlin = "2.0.21" -coreKtx = "1.10.1" +kotlin = "2.2.0" +coreKtx = "1.16.0" junit = "4.13.2" -junitVersion = "1.1.5" -espressoCore = "3.5.1" -lifecycleRuntimeKtx = "2.6.1" -activityCompose = "1.8.0" -composeBom = "2024.09.00" +junitVersion = "1.3.0" +espressoCore = "3.7.0" +lifecycleRuntimeKtx = "2.9.2" +activityCompose = "1.10.1" +composeBom = "2025.07.00" +# New +icon = "1.7.8" +ksp = "2.2.0-2.0.2" +navigation = "2.9.3" +hilt = "2.57" +androidxHilt = "1.2.0" +retrofit2 = "3.0.0" +gson = "2.13.1" [libraries] +# Default androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } junit = { group = "junit", name = "junit", version.ref = "junit" } androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } @@ -24,9 +34,22 @@ androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-toolin androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } androidx-material3 = { group = "androidx.compose.material3", name = "material3" } +# New +androidx-material3-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended", version.ref = "icon" } +androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation" } +androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "androidxHilt" } +dagger-hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } +dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } +squareup-retrofit2 = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit2" } +squareup-retrofit2-converter-gson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "retrofit2" } +google-gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } [plugins] +# Default android-application = { id = "com.android.application", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +# New +kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }