Skip to content

Commit

Permalink
fix: remove ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
HDYOU committed May 21, 2024
1 parent 6291c0d commit f85d851
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
local.properties
*.log
.idea

reports
65 changes: 42 additions & 23 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.io.ByteArrayOutputStream
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.google.devtools.ksp)
//alias(libs.plugins.google.devtools.ksp)
alias(libs.plugins.rikka.tools.materialthemebuilder)
alias(libs.plugins.google.dagger.hilt.android)
alias(libs.plugins.kotlin.kapt)
Expand All @@ -17,6 +17,12 @@ apply(plugin = "kotlin-kapt")
kapt {
generateStubs = true
correctErrorTypes = true

arguments {
arg("room.incremental", "true")
arg("room.expandProjection", "true")
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
}

materialThemeBuilder {
Expand Down Expand Up @@ -55,23 +61,31 @@ materialThemeBuilder {
generatePalette = true
}

val gitBuildNumber: Int by lazy {
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
rootProject.exec {
commandLine("git", "rev-list", "--count", "HEAD")
standardOutput = stdout
}
stdout.toString().trim().toInt()
}
val gitBuildNumber = providers.exec {
commandLine("git", "rev-list", "--count", "HEAD")
}.standardOutput.asText.get().trim().toInt()

val gitBuildName: String by lazy {
val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
rootProject.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
stdout.toString().trim()
}
//val gitBuildNumber: Int by lazy {
// val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
// rootProject.exec {
// commandLine("git", "rev-list", "--count", "HEAD")
// standardOutput = stdout
// }
// stdout.toString().trim().toInt()
//}

val gitBuildName = providers.exec {
commandLine("git", "rev-parse", "--short", "HEAD")
}.standardOutput.asText.get().trim()

//val gitBuildName: String by lazy {
// val stdout = org.apache.commons.io.output.ByteArrayOutputStream()
// rootProject.exec {
// commandLine("git", "rev-parse", "--short", "HEAD")
// standardOutput = stdout
// }
// stdout.toString().trim()
//}

android {
namespace = "com.example.c001apk"
Expand Down Expand Up @@ -107,6 +121,7 @@ android {
}*/
val signConfig = signingConfigs.getByName("keyStore")
getByName("release") {
isCrunchPngs = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
Expand All @@ -116,6 +131,7 @@ android {
signingConfig = signConfig
}
getByName("debug") {
isCrunchPngs = false
isMinifyEnabled = false
isShrinkResources = false
proguardFiles(
Expand Down Expand Up @@ -154,9 +170,11 @@ android {
abiFilters += SUPPORTED_ABIS
}
}
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
}

//ksp {
// arg("room.schemaLocation", "$projectDir/schemas")
//}

applicationVariants.all {
outputs.all {
val versionName = defaultConfig.versionName
Expand Down Expand Up @@ -188,22 +206,23 @@ dependencies {
implementation(libs.androidx.preference.ktx)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
kapt(libs.androidx.room.compiler)
implementation(libs.androidx.swiperefreshlayout)
implementation(libs.androidx.webkit)
implementation(libs.androidx.core.ktx)
implementation(libs.google.android.flexbox)
implementation(libs.google.android.material)
implementation(libs.google.dagger.hilt.android)
ksp(libs.google.dagger.hilt.android.compiler)
kapt(libs.google.dagger.hilt.android.compiler)
implementation(libs.rikkax.borderview)
implementation(libs.rikkax.material.preference)
implementation(libs.rikkax.material)
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.okhttp3.logging.interceptor)
implementation(libs.glide)
ksp(libs.glide.ksp)
//ksp(libs.glide.ksp)
kapt(libs.glide.compiler)
implementation(libs.glide.okhttp3.integration)
implementation(libs.glide.transformations)
implementation(project(":mojito"))
Expand Down
23 changes: 21 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx6g -Xms256m -XX:MaxMetaspaceSize=512m -XX:+UseParallelGC -Dkotlin.daemon.jvm.options\="-Xmx6g" -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand All @@ -20,4 +20,23 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
#启用gradle缓存
org.gradle.caching=true
#android.useDeprecatedNdk=true
android.injected.testOnly=false
#org.gradle.jvmargs=-Xmx4608M
#启用新一代资源编译器aapt2 (增量资源处理), 默认已开启
#android.enableAapt2=true
android.enableJetifier=false
org.gradle.daemon=true
#按需配置, 开启后Flutter Boost代码报错
org.gradle.configureondemand=true
#启用新一代Dex编译器D8
# android.enableD8=true
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution
# 启用gradle缓存
org.gradle.parallel=true

org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache-problems=warn
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ google-dagger-hilt-android = { module = "com.google.dagger:hilt-android", versio
google-dagger-hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-ksp = { module = "com.github.bumptech.glide:ksp", version.ref = "glide" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" }
glide-okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" }
glide-transformations = { module = "jp.wasabeef:glide-transformations", version.ref = "glide-transformations" }
immersionbar = { module = "com.geyifeng.immersionbar:immersionbar", version.ref = "immersionbar" }
Expand Down

0 comments on commit f85d851

Please sign in to comment.