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

Replace kapt with ksp, update versions #1001

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/blueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- uses: actions/cache@v2
with:
Expand Down
21 changes: 11 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kapt)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
}
Expand Down Expand Up @@ -78,25 +77,27 @@ android {

buildFeatures {
compose = true
buildConfig = true
}

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

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}

packagingOptions {
excludes += "META-INF/AL2.0"
excludes += "META-INF/LGPL2.1"
packaging {
jniLibs.excludes += "META-INF/AL2.0"
jniLibs.excludes += "META-INF/LGPL2.1"
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}
namespace = "com.example.android.architecture.blueprints.todoapp"

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
Expand Down Expand Up @@ -128,7 +129,7 @@ dependencies {
// Hilt
implementation(libs.hilt.android.core)
implementation(libs.androidx.hilt.navigation.compose)
kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)

// Jetpack Compose
val composeBom = platform(libs.androidx.compose.bom)
Expand Down Expand Up @@ -166,7 +167,7 @@ dependencies {

// JVM tests - Hilt
testImplementation(libs.hilt.android.testing)
kaptTest(libs.hilt.compiler)
kspTest(libs.hilt.compiler)

// Dependencies for Android unit tests
androidTestImplementation(composeBom)
Expand Down Expand Up @@ -196,5 +197,5 @@ dependencies {

// AndroidX Test - Hilt testing
androidTestImplementation(libs.hilt.android.testing)
kaptAndroidTest(libs.hilt.compiler)
kspAndroidTest(libs.hilt.compiler)
}
3 changes: 1 addition & 2 deletions app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.architecture.blueprints.todoapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.architecture.blueprints.todoapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.android.architecture.blueprints.todoapp.R
import com.example.android.architecture.blueprints.todoapp.util.AddEditTaskTopAppBar
import com.google.accompanist.swiperefresh.SwipeRefresh
import com.google.accompanist.swiperefresh.rememberSwipeRefreshState

@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun AddEditTaskScreen(
@StringRes topBarTitle: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.example.android.architecture.blueprints.todoapp.di.ApplicationScope
import com.example.android.architecture.blueprints.todoapp.di.DefaultDispatcher
import java.util.UUID
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
Expand All @@ -40,7 +39,6 @@ import kotlinx.coroutines.withContext
* @param scope - The coroutine scope used for deferred jobs where the result isn't important, such
* as sending data to the network.
*/
@Singleton
class DefaultTaskRepository @Inject constructor(
private val networkDataSource: NetworkDataSource,
private val localDataSource: TaskDao,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.android.architecture.blueprints.todoapp.R
import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
import com.example.android.architecture.blueprints.todoapp.util.StatisticsTopAppBar
import com.google.accompanist.appcompattheme.AppCompatTheme

@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun StatisticsScreen(
openDrawer: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,13 @@ import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.android.architecture.blueprints.todoapp.R
import com.example.android.architecture.blueprints.todoapp.data.Task
import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
import com.example.android.architecture.blueprints.todoapp.util.TaskDetailTopAppBar
import com.google.accompanist.appcompattheme.AppCompatTheme

@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun TaskDetailScreen(
onEditTask: (String) -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.ExperimentalLifecycleComposeApi
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.example.android.architecture.blueprints.todoapp.R
import com.example.android.architecture.blueprints.todoapp.data.Task
Expand All @@ -64,7 +63,6 @@ import com.example.android.architecture.blueprints.todoapp.util.LoadingContent
import com.example.android.architecture.blueprints.todoapp.util.TasksTopAppBar
import com.google.accompanist.appcompattheme.AppCompatTheme

@OptIn(ExperimentalLifecycleComposeApi::class)
@Composable
fun TasksScreen(
@StringRes userMessage: Int,
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kapt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.hilt) apply false
}
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryErr
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
kapt.incremental.apt=true
ksp.incremental.apt=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
77 changes: 38 additions & 39 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
[versions]
accompanist = "0.28.0"
annotation = "1.5.0"
androidDesugarJdkLibs = "1.2.2"
androidGradlePlugin = "7.4.0"
androidxActivity = "1.6.1"
androidxAppCompat = "1.5.1"
androidxArchCore = "2.1.0"
accompanist = "0.34.0"
annotation = "1.7.1"
androidDesugarJdkLibs = "2.0.4"
androidGradlePlugin = "8.3.1"
androidxActivity = "1.8.2"
androidxAppCompat = "1.6.1"
androidxArchCore = "2.2.0"
androidxBrowser = "1.4.0"
androidxComposeBom = "2023.01.00"
androidxComposeCompiler = "1.4.3"
androidxComposeBom = "2024.04.00"
androidxComposeCompiler = "1.5.11"
androidxCompose = "1.2.0"
androidxComposeRuntimeTracing = "1.0.0-alpha01"
androidxCore = "1.9.0"
androidxCoreSplashscreen = "1.0.0"
androidxComposeRuntimeTracing = "1.0.0-beta01"
androidxCore = "1.12.0"
androidxCoreSplashscreen = "1.0.1"
androidxDataStore = "1.0.0"
androidxEspresso = "3.5.0"
androidxHiltNavigationCompose = "1.0.0"
androidxLifecycle = "2.6.0-alpha03"
androidxEspresso = "3.5.1"
androidxHiltNavigationCompose = "1.2.0"
androidxLifecycle = "2.7.0"
androidxMacroBenchmark = "1.1.1"
androidxMetrics = "1.0.0-alpha03"
androidxNavigation = "2.5.3"
androidxProfileinstaller = "1.2.1"
androidxMetrics = "1.0.0-beta01"
androidxNavigation = "2.7.7"
androidxProfileinstaller = "1.3.1"
androidxStartup = "1.1.1"
androidxTestCore = "1.5.0"
androidxTestExt = "1.1.4"
androidxTestExt = "1.1.5"
androidxTestRules = "1.5.0"
androidxTestRunner = "1.5.1"
androidxTracing = "1.1.0"
androidxUiAutomator = "2.2.0"
androidxWindowManager = "1.0.0"
androidxWork = "2.7.1"
coil = "2.2.2"
androidxTestRunner = "1.5.2"
androidxTracing = "1.2.0"
androidxUiAutomator = "2.3.0"
androidxWindowManager = "1.2.0"
androidxWork = "2.9.0"
coil = "2.6.0"
# @keep
compileSdk = "33"
compileSdk = "34"
hamcrest = "1.3"
hilt = "2.44.2"
hiltExt = "1.0.0"
hilt = "2.51"
hiltExt = "1.2.0"
jacoco = "0.8.7"
junit4 = "4.13.2"
kotlin = "1.8.10"
kotlinxCoroutines = "1.6.4"
kotlinxDatetime = "0.4.0"
kotlinxSerializationJson = "1.5.0"
ksp = "1.8.10-1.0.9"
lint = "30.3.1"
kotlin = "1.9.23"
kotlinxCoroutines = "1.8.0"
kotlinxDatetime = "0.5.0"
kotlinxSerializationJson = "1.6.3"
ksp = "1.9.23-1.0.20"
lint = "31.3.1"
# @keep
minSdk = "21"
okhttp = "4.10.0"
protobuf = "3.21.12"
protobufPlugin = "0.8.19"
protobufPlugin = "0.9.1"
retrofit = "2.9.0"
retrofitKotlinxSerializationJson = "0.8.0"
room = "2.5.0-rc01"
room = "2.6.1"
spotless = "5.12.5"
timber = "5.0.1"
# @keep
targetSdk = "33"
truth = "1.1.2"
targetSdk = "34"
truth = "1.4.2"
turbine = "0.12.1"

[libraries]
Expand Down Expand Up @@ -149,6 +149,5 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 6 additions & 2 deletions shared-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kapt)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
}
Expand All @@ -27,6 +26,11 @@ android {
defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
}

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

dependencies {
Expand All @@ -39,7 +43,7 @@ dependencies {
implementation(libs.androidx.test.rules)
implementation(libs.hilt.android.core)
implementation(libs.hilt.android.testing)
kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)

// Room
implementation(libs.room.runtime)
Expand Down