Skip to content

Commit

Permalink
added compose compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Smithy-x committed Aug 13, 2024
1 parent dc43980 commit 4ed51c8
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 54 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool
fun getInt(provider: Provider<String>): Int {
return getString(provider).toInt()
}

fun getString(provider: Provider<String>): String {
return provider.get()
}
plugins {
id("kotlin-android")
alias(libs.plugins.gms.google.services)
alias(libs.plugins.firebase.crashlytics)
//id("kotlin-android")
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.nav.safe.args)
alias(libs.plugins.dagger.hilt)
id("kotlin-parcelize")

alias(libs.plugins.compose.compiler)


alias(libs.plugins.gms.google.services)
alias(libs.plugins.firebase.crashlytics)
}

android {
Expand Down Expand Up @@ -45,15 +54,19 @@ android {
create("playstation") {
dimension = "playstation"
applicationId = "io.vonley.mi"
externalNativeBuild.cmake {
cppFlags += "-DPROD"
externalNativeBuild {
cmake {
cppFlags += "-DPROD"
}
}
}
create("playstationTest") {
dimension = "playstation"
applicationId = "io.vonley.mi"
externalNativeBuild.cmake {
cppFlags += "-DDEBUG"
externalNativeBuild {
cmake {
cppFlags += "-DDEBUG"
}
}
}
}
Expand All @@ -68,13 +81,38 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility")
}

composeCompiler {
enableStrongSkippingMode = true
reportsDestination = layout.buildDirectory.dir("compose_compiler")
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_config.conf")
}

kotlinOptions {
jvmTarget = getString(libs.versions.jvm)
val composeReportsDir = "compose_reports"
val path = project.layout.buildDirectory.get().dir(composeReportsDir).asFile.absolutePath
println(path)
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=$rootDir/stability_config.conf"
)
/*freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${path}"
)*/
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${path}"
)
}
buildFeatures {
compose = true
viewBinding = true
Expand All @@ -84,9 +122,13 @@ android {
abortOnError = false
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.10"
kotlinCompilerExtensionVersion = "1.5.14"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

/*
androidComponents {
onVariants(selector().all()) { variant ->
Expand Down
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.gms.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.nav.safe.args) apply false
alias(libs.plugins.dagger.hilt) apply false


alias(libs.plugins.gms.google.services) apply false
alias(libs.plugins.firebase.crashlytics) apply false
}
8 changes: 5 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[versions]
agp = "8.4.2"
jvm = "11"
agp = "8.7.0-alpha05"
imageLabelingVersion = "17.0.9"
imageLabelingCustomVersion = "17.0.3"
kotlin = "1.9.22"
kotlin = "2.0.0"
coreKtx = "1.13.1"
junit = "4.13.2"
junitVersion = "1.2.1"
Expand Down Expand Up @@ -165,7 +166,8 @@ jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref =
kotlin-parcelize = { id = "kotlin-parcelize", version.ref = "kotlin" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version = "2.49" }
nav-safe-args = { id = "androidx.navigation.safeargs.kotlin", version = "2.7.7" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.22-1.0.17" }
ksp = { id = "com.google.devtools.ksp", version = "2.0.0-1.0.21" }
kotlin-kapt = { id = "kotlin-kapt", version.ref = "kotlin" }
gms-google-services = { id = "com.google.gms.google-services", version.ref = "gms" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Nov 13 16:45:30 EST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 4ed51c8

Please sign in to comment.