Fix compose compiler compatibility.

This commit is contained in:
oxy
2024-06-09 21:00:53 +08:00
parent 6efd47a1ad
commit f169567928
17 changed files with 40 additions and 77 deletions

View File

@ -104,10 +104,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
applicationVariants.all {
outputs
.map { it as com.android.build.gradle.internal.api.ApkVariantOutputImpl }

View File

@ -1,3 +1,5 @@
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.gradle.dsl.kotlinExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
@ -14,29 +16,33 @@ plugins {
subprojects {
tasks.withType<KotlinCompile>().configureEach {
val composeMetricsPath =
project.layout.buildDirectory.dir("compose_metrics").get().asFile.path
val composeStabilityConfigurationPath =
"${project.rootDir.path}/compose_compiler_config.conf"
compilerOptions {
freeCompilerArgs.addAll(
"-Xcontext-receivers",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
"-opt-in=com.google.accompanist.permissions.ExperimentalPermissionsApi",
"-opt-in=androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi",
"-opt-in=androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi",
"-opt-in=androidx.compose.material3.adaptive.navigation.suite.ExperimentalMaterial3AdaptiveNavigationSuiteApi",
"-opt-in=androidx.tv.material3.ExperimentalTvMaterial3Api",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=$composeMetricsPath",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=$composeMetricsPath",
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=$composeStabilityConfigurationPath"
)
kotlinExtension.sourceSets {
all {
languageSettings {
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
optIn("androidx.compose.foundation.ExperimentalFoundationApi")
optIn("androidx.compose.foundation.layout.ExperimentalLayoutApi")
optIn("androidx.compose.material3.ExperimentalMaterial3Api")
optIn("androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi")
optIn("androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi")
optIn("androidx.tv.material3.ExperimentalTvMaterial3Api")
optIn("com.google.accompanist.permissions.ExperimentalPermissionsApi")
}
}
}
}
plugins.withId("org.jetbrains.kotlin.plugin.compose") {
configure<ComposeCompilerGradlePluginExtension> {
enableStrongSkippingMode = true
enableNonSkippingGroupOptimization = true
enableIntrinsicRemember = true
includeSourceInformation = true
val file = rootProject.layout.projectDirectory.file("compose_compiler_config.conf")
if (file.asFile.exists()) {
stabilityConfigurationFile.set(file)
}
metricsDestination.set(layout.buildDirectory.dir("compose_metrics"))
reportsDestination.set(layout.buildDirectory.dir("compose_metrics"))
}
}
}

View File

@ -1,5 +1,6 @@
kotlin.collections.*
android.net.Uri
androidx.media3.common.Format
org.jupnp.model.meta.Device
androidx.media3.exoplayer.offline.Download
kotlin.collections.*
net.mm2d.upnp.Device
kotlinx.datetime.LocalDateTime

View File

@ -34,10 +34,6 @@ android {
buildFeatures {
compose = true
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -41,10 +41,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -37,10 +37,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -36,10 +36,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -36,10 +36,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -36,10 +36,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -39,10 +39,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -38,10 +38,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -5,6 +5,7 @@ import android.app.Activity
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.snapshotFlow
import androidx.core.content.pm.ShortcutInfoCompat
import androidx.core.content.pm.ShortcutManagerCompat
@ -334,6 +335,7 @@ class PlaylistViewModel @Inject constructor(
internal val query = MutableStateFlow("")
internal val scrollUp: MutableStateFlow<Event<Unit>> = MutableStateFlow(handledEvent())
@Immutable
data class ChannelParameters(
val playlistUrl: String,
val query: String,
@ -341,6 +343,7 @@ class PlaylistViewModel @Inject constructor(
val categories: List<String>,
)
@Immutable
data class CategoryWithChannels(
val category: String,
val channels: Flow<PagingData<Channel>>,

View File

@ -36,10 +36,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -31,10 +31,6 @@ android {
buildFeatures {
compose = true
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {

View File

@ -119,7 +119,7 @@ fun TextField(
),
keyboardOptions = KeyboardOptions(
keyboardType = keyboardType,
autoCorrect = false,
autoCorrectEnabled = false,
imeAction = imeAction ?: if (singleLine) ImeAction.Done else ImeAction.Default
),
interactionSource = interactionSource,
@ -223,7 +223,7 @@ fun PlaceholderField(
),
keyboardOptions = KeyboardOptions(
keyboardType = keyboardType,
autoCorrect = false,
autoCorrectEnabled = false,
imeAction = imeAction
),
interactionSource = interactionSource,
@ -413,7 +413,7 @@ private fun TvTextFieldImpl(
)
),
keyboardOptions = KeyboardOptions(
autoCorrect = false,
autoCorrectEnabled = false,
imeAction = ImeAction.Search
),
keyboardActions = keyboardActions,

View File

@ -1,3 +1,5 @@
@file: Suppress("DEPRECATION")
package com.m3u.material.transformation
import android.content.Context
@ -12,7 +14,6 @@ import androidx.core.graphics.createBitmap
import coil.size.Size
import coil.transform.Transformation
@Suppress("DEPRECATION")
class BlurTransformation @JvmOverloads constructor(
private val context: Context,
private val radius: Float = DEFAULT_RADIUS,

View File

@ -37,10 +37,6 @@ android {
packaging {
resources.excludes += "META-INF/**"
}
composeCompiler {
enableStrongSkippingMode = true
includeSourceInformation = true
}
}
dependencies {