Skip to content

Commit ccc681d

Browse files
committed
Bump dependencies and cleanup
1 parent 43b0fdb commit ccc681d

File tree

13 files changed

+47
-34
lines changed

13 files changed

+47
-34
lines changed

compiler-gradle-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract class UpdatePluginVersionTask : DefaultTask() {
5858

5959
destination.get().asFile.forEachLine { line ->
6060
if (line.startsWith("package")) packageLine = line
61-
if (line.contains("const val VERSION")) currentVersion = line.split("\"")[1]
61+
if (line.contains("const val VERSION")) currentVersion = line.split('"')[1]
6262
}
6363
if (currentVersion == version.get()) return
6464

compiler-gradle-plugin/src/main/kotlin/land/sungbin/composeinvestigator/gradle/ComposeInvestigatorGradleSubplugin.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet.Companion.COMMON_MAIN_
1212
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer
1313
import org.jetbrains.kotlin.gradle.plugin.SubpluginArtifact
1414
import org.jetbrains.kotlin.gradle.plugin.SubpluginOption
15+
import org.jetbrains.kotlin.gradle.plugin.kotlinToolingVersion
1516

1617
public class ComposeInvestigatorGradleSubplugin : KotlinCompilerPluginSupportPlugin {
1718
override fun apply(target: Project) {
@@ -27,7 +28,12 @@ public class ComposeInvestigatorGradleSubplugin : KotlinCompilerPluginSupportPlu
2728
version = VERSION,
2829
)
2930

30-
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean = true
31+
// TODO test this
32+
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
33+
val project = kotlinCompilation.target.project
34+
val kotlinVersion = project.kotlinToolingVersion
35+
return kotlinVersion.major == 2
36+
}
3137

3238
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> {
3339
val project = kotlinCompilation.target.project

compiler-gradle-plugin/src/main/kotlin/land/sungbin/composeinvestigator/gradle/VERSION.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
// SPDX-License-Identifier: Apache-2.0
33
package land.sungbin.composeinvestigator.gradle
44

5-
internal const val VERSION = "2.1.0-Beta1-1.0.0-b1"
5+
internal const val VERSION = "2.1.0-1.0.0.a1"

compiler-integration-test/build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ kotlin {
2424

2525
jvm()
2626

27-
iosArm64()
28-
iosX64()
29-
iosSimulatorArm64()
27+
// TODO
28+
// iosArm64()
29+
// iosX64()
30+
// iosSimulatorArm64()
3031

3132
sourceSets {
3233
commonMain {
@@ -55,6 +56,6 @@ kotlin {
5556

5657
dependencies {
5758
configurations
58-
.filter { conf -> conf.name.contains("kotlinCompilerPluginClasspath") }
59-
.forEach { conf -> conf(projects.compiler) }
59+
.filter { configuration -> configuration.name.contains("kotlinCompilerPluginClasspath", ignoreCase = true) }
60+
.forEach { configuration -> configuration(projects.compiler) }
6061
}

compiler/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies {
4343
testImplementation(projects.runtime)
4444
testImplementation(libs.compose.runtime)
4545
testImplementation(libs.test.diffutil)
46-
testImplementation(libs.test.kluent) // FIXME Temporary library to use until KT-53336 is resolved
46+
testImplementation(libs.test.kluent) // TODO Temporary library to use until KT-53336 is resolved
4747

4848
testImplementation(kotlin("test-junit5", version = libs.versions.kotlin.core.get()))
4949
testImplementation(kotlin("compiler-embeddable", version = libs.versions.kotlin.core.get()))

compiler/src/main/kotlin/land/sungbin/composeinvestigator/compiler/ComposeInvestigatorFirstPhaseExtension.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package land.sungbin.composeinvestigator.compiler
44

55
import androidx.compose.compiler.plugins.kotlin.analysis.StabilityInferencer
66
import java.util.EnumSet
7+
import land.sungbin.composeinvestigator.compiler.ComposeInvestigatorPluginRegistrar.Companion.DefaultIrValidatorConfig
78
import land.sungbin.composeinvestigator.compiler.analysis.DurableComposableKeyAnalyzer
89
import land.sungbin.composeinvestigator.compiler.lower.InvalidationProcessTracingFirstTransformer
910
import land.sungbin.composeinvestigator.compiler.lower.InvalidationTraceTableInstanceTransformer
@@ -61,9 +62,8 @@ public class ComposeInvestigatorFirstPhaseExtension(
6162
performBasicIrValidation(
6263
moduleFragment,
6364
pluginContext.irBuiltIns,
64-
phaseName = "Before ComposeInvestigator First Phase",
65-
checkProperties = true,
66-
checkTypes = false, // TODO KT-68663
65+
"Before ComposeInvestigator First Phase",
66+
DefaultIrValidatorConfig,
6767
)
6868
}
6969

@@ -81,9 +81,8 @@ public class ComposeInvestigatorFirstPhaseExtension(
8181
performBasicIrValidation(
8282
moduleFragment,
8383
pluginContext.irBuiltIns,
84-
phaseName = "After ComposeInvestigator First Phase",
85-
checkProperties = true,
86-
checkTypes = false, // TODO KT-68663
84+
"After ComposeInvestigator First Phase",
85+
DefaultIrValidatorConfig,
8786
)
8887
}
8988
}

compiler/src/main/kotlin/land/sungbin/composeinvestigator/compiler/ComposeInvestigatorLastPhaseExtension.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package land.sungbin.composeinvestigator.compiler
44

55
import java.util.EnumSet
6+
import land.sungbin.composeinvestigator.compiler.ComposeInvestigatorPluginRegistrar.Companion.DefaultIrValidatorConfig
67
import land.sungbin.composeinvestigator.compiler.lower.InvalidationSkipTracingLastTransformer
78
import land.sungbin.composeinvestigator.compiler.lower.InvalidationTraceTableInstanceTransformer
89
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
@@ -43,9 +44,8 @@ public class ComposeInvestigatorLastPhaseExtension(
4344
performBasicIrValidation(
4445
moduleFragment,
4546
pluginContext.irBuiltIns,
46-
phaseName = "Before ComposeInvestigator Last Phase",
47-
checkProperties = true,
48-
checkTypes = false, // TODO KT-68663
47+
"Before ComposeInvestigator Last Phase",
48+
DefaultIrValidatorConfig,
4949
)
5050
}
5151

@@ -59,9 +59,8 @@ public class ComposeInvestigatorLastPhaseExtension(
5959
performBasicIrValidation(
6060
moduleFragment,
6161
pluginContext.irBuiltIns,
62-
phaseName = "After ComposeInvestigator Last Phase",
63-
checkProperties = true,
64-
checkTypes = false, // There is implicit type downcasting: InvalidationType.Skipped -> InvalidationType
62+
"After ComposeInvestigator Last Phase",
63+
DefaultIrValidatorConfig,
6564
)
6665
}
6766
}

compiler/src/main/kotlin/land/sungbin/composeinvestigator/compiler/ComposeInvestigatorPluginRegistrar.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package land.sungbin.composeinvestigator.compiler
66

77
import java.util.EnumSet
8+
import org.jetbrains.kotlin.backend.common.IrValidatorConfig
89
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
910
import org.jetbrains.kotlin.cli.jvm.compiler.CompileEnvironmentException
1011
import org.jetbrains.kotlin.com.intellij.mock.MockProject
@@ -60,5 +61,11 @@ public class ComposeInvestigatorPluginRegistrar : ComponentRegistrar {
6061
public companion object {
6162
public val DefaultEnabledFeatureFlags: EnumSet<FeatureFlag> =
6263
EnumSet.allOf(FeatureFlag::class.java).apply { remove(FeatureFlag.StateInitializerTracking) }
64+
65+
public val DefaultIrValidatorConfig: IrValidatorConfig =
66+
IrValidatorConfig(
67+
checkProperties = true,
68+
checkTypes = false, // TODO KT-68663
69+
)
6370
}
6471
}

compiler/src/main/kotlin/land/sungbin/composeinvestigator/compiler/analysis/DurableComposableKeyAnalyzer.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import androidx.compose.compiler.plugins.kotlin.EmptyModuleMetrics
66
import androidx.compose.compiler.plugins.kotlin.FeatureFlags
77
import androidx.compose.compiler.plugins.kotlin.analysis.StabilityInferencer
88
import androidx.compose.compiler.plugins.kotlin.irTrace
9-
import androidx.compose.compiler.plugins.kotlin.lower.ComposableSymbolRemapper
109
import androidx.compose.compiler.plugins.kotlin.lower.DurableKeyTransformer
1110
import androidx.compose.compiler.plugins.kotlin.lower.DurableKeyVisitor
1211
import land.sungbin.composeinvestigator.compiler.ComposeInvestigatorCommandLineProcessor.Companion.PLUGIN_ID
@@ -38,7 +37,6 @@ public class DurableComposableKeyAnalyzer(
3837
) : DurableKeyTransformer(
3938
context = context,
4039
keyVisitor = DurableKeyVisitor(),
41-
symbolRemapper = ComposableSymbolRemapper(),
4240
stabilityInferencer = stabilityInferencer,
4341
metrics = EmptyModuleMetrics,
4442
featureFlags = featureFlags,

compiler/src/test/kotlin/land/sungbin/composeinvestigator/compiler/_compilation/KotlinK2Compiler.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.config.languageVersionSettings
3333
import org.jetbrains.kotlin.config.messageCollector
3434
import org.jetbrains.kotlin.diagnostics.DiagnosticReporterFactory
3535
import org.jetbrains.kotlin.diagnostics.impl.BaseDiagnosticsCollector
36+
import org.jetbrains.kotlin.diagnostics.impl.BaseDiagnosticsCollector.RawReporter
3637
import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory
3738
import org.jetbrains.kotlin.fir.BinaryModuleData
3839
import org.jetbrains.kotlin.fir.DependencyListForCliModule
@@ -149,7 +150,11 @@ class KotlinK2Compiler private constructor(private val environment: KotlinCoreEn
149150
projectEnvironment = projectEnvironment,
150151
)
151152

152-
val reporter = DiagnosticReporterFactory.createReporter()
153+
val reporter = DiagnosticReporterFactory.createReporter(
154+
RawReporter { message, severity ->
155+
if (severity.isError) error(message) else println("[${severity.name}] $message")
156+
},
157+
)
153158
val analysis = buildResolveAndCheckFirFromKtFiles(session, listOf(file.toKtFile(project)), reporter)
154159

155160
return FirAnalysisResult(FirResult(listOf(analysis)), reporter)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SONATYPE_AUTOMATIC_RELEASE=true
2626
RELEASE_SIGNING_ENABLED=true
2727

2828
GROUP=in.sungb.composeinvestigator
29-
VERSION_NAME=2.1.0-Beta1-1.0.0-b1
29+
VERSION_NAME=2.1.0-1.0.0.a1
3030

3131
POM_DESCRIPTION=Trace the recomposition of a Composable with its cause without boilerplate code.
3232
POM_INCEPTION_YEAR=2024

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ gradle-android = "8.7.3"
55
gradle-publish-maven = "0.30.0"
66
gradle-test-logging = "4.0.0"
77

8-
kotlin-core = "2.1.0-Beta1"
8+
kotlin-core = "2.1.0"
99
kotlin-dokka = "2.0.0-Beta"
1010
kotlin-coroutines = "1.9.0"
1111

1212
androidx-activity = "1.9.3"
1313
androidx-annotation = "1.9.1"
1414

1515
compose-activity = "1.9.3"
16-
compose-multiplatform = "1.7.0"
16+
compose-multiplatform = "1.7.1"
1717

1818
spotless = "6.25.0"
1919
ktlint = "1.5.0"

runtime/build.gradle.kts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Copyright 2024 Ji Sungbin
22
// SPDX-License-Identifier: Apache-2.0
3-
import org.gradle.kotlin.dsl.dokka
4-
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
5-
63
plugins {
74
kotlin("multiplatform")
85
alias(libs.plugins.kotlin.dokka)
@@ -24,7 +21,6 @@ dokka {
2421
}
2522
}
2623

27-
@OptIn(ExperimentalKotlinGradlePluginApi::class)
2824
kotlin {
2925
explicitApi()
3026
jvmToolchain(libs.versions.jdk.get().toInt())
@@ -38,9 +34,11 @@ kotlin {
3834

3935
jvm()
4036

41-
iosArm64()
42-
iosX64()
43-
iosSimulatorArm64()
37+
// FIXME Task :runtime:linkDebugTestIosSimulatorArm64 FAILED
38+
// e: java.lang.NullPointerException
39+
// iosArm64()
40+
// iosX64()
41+
// iosSimulatorArm64()
4442

4543
sourceSets {
4644
commonMain {

0 commit comments

Comments
 (0)