Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ idea {
}

val annotationsRuntimeClasspath: Configuration by configurations.creating { isTransitive = false }
val testArtifacts: Configuration by configurations.creating

dependencies {
compileOnly(libs.kotlin.compiler)
Expand All @@ -35,11 +36,12 @@ dependencies {
annotationsRuntimeClasspath(project(":plugin-annotations"))

// Dependencies required to run the internal test framework.
testRuntimeOnly(libs.junit)
testRuntimeOnly(libs.kotlin.reflect)
testRuntimeOnly(libs.kotlin.test)
testRuntimeOnly(libs.kotlin.script.runtime)
testRuntimeOnly(libs.kotlin.annotations.jvm)
testArtifacts(libs.kotlin.stdlib)
testArtifacts(libs.kotlin.stdlib.jdk8)
testArtifacts(libs.kotlin.reflect)
testArtifacts(libs.kotlin.test)
testArtifacts(libs.kotlin.script.runtime)
testArtifacts(libs.kotlin.annotations.jvm)
}

buildConfig {
Expand Down Expand Up @@ -95,10 +97,8 @@ tasks.compileTestKotlin {
}

fun Test.setLibraryProperty(propName: String, jarName: String) {
val path = project.configurations
.testRuntimeClasspath.get()
.files
.find { """$jarName-\d.*jar""".toRegex().matches(it.name) }
val path = testArtifacts.files
.find { """$jarName-\d.*""".toRegex().matches(it.name) }
?.absolutePath
?: return
systemProperty(propName, path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import org.jetbrains.kotlin.config.CompilerConfiguration

@Suppress("unused") // Used via reflection.
class SimpleCommandLineProcessor : CommandLineProcessor {
override val pluginId: String = BuildConfig.KOTLIN_PLUGIN_ID

override val pluginOptions: Collection<CliOption> = emptyList()
override val pluginId: String
get() = BuildConfig.KOTLIN_PLUGIN_ID
override val pluginOptions: Collection<CliOption>
get() = emptyList()

override fun processOption(option: AbstractCliOption, value: String, configuration: CompilerConfiguration) {
error("Unexpected config option: '${option.optionName}'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import org.jetbrains.kotlin.compiler.plugin.template.ir.SimpleIrGenerationExtens
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter

class SimplePluginComponentRegistrar: CompilerPluginRegistrar() {
class SimplePluginComponentRegistrar : CompilerPluginRegistrar() {
override val pluginId: String
get() = BuildConfig.KOTLIN_PLUGIN_ID
override val supportsK2: Boolean
get() = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.jetbrains.kotlin.compiler.plugin.template

import org.jetbrains.kotlin.compiler.plugin.template.runners.AbstractJvmBoxTest
import org.jetbrains.kotlin.compiler.plugin.template.runners.AbstractJvmDiagnosticTest
import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
import org.jetbrains.kotlin.generators.dsl.junit5.generateTestGroupSuiteWithJUnit5

fun main() {
generateTestGroupSuiteWithJUnit5 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Test;

Expand All @@ -18,7 +17,7 @@
public class JvmBoxTestGenerated extends AbstractJvmBoxTest {
@Test
public void testAllFilesPresentInBox() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler-plugin/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler-plugin/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, true);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Test;

Expand All @@ -18,7 +17,7 @@
public class JvmDiagnosticTestGenerated extends AbstractJvmDiagnosticTest {
@Test
public void testAllFilesPresentInDiagnostics() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler-plugin/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler-plugin/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true);
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/testData/box/anotherBoxTest.fir.ir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ FILE fqName:<root> fileName:/anotherBoxTest.kt
then: STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="Fail: "
GET_VAR 'val result: kotlin.Int declared in <root>.box' type=kotlin.Int origin=null
FILE fqName:foo.bar fileName:__GENERATED DECLARATIONS__.kt
FILE fqName:foo.bar fileName:foo/bar/MyClass.kt
CLASS GENERATED[org.jetbrains.kotlin.compiler.plugin.template.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]
thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.jetbrains.kotlin.compiler.plugin.template.fir.SimpleClassGenerator.Key] visibility:public returnType:foo.bar.MyClass
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/testData/box/anotherBoxTest.fir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ FILE: anotherBoxTest.kt
}

}
FILE: __GENERATED DECLARATIONS__.kt
FILE: foo/bar/MyClass.kt
package foo.bar

public final class MyClass : R|kotlin/Any| {
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/testData/box/simple.fir.ir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FILE fqName:foo.bar fileName:/simple.kt
STRING_CONCATENATION type=kotlin.String
CONST String type=kotlin.String value="Fail: "
GET_VAR 'val result: kotlin.String declared in foo.bar.box' type=kotlin.String origin=null
FILE fqName:foo.bar fileName:__GENERATED DECLARATIONS__.kt
FILE fqName:foo.bar fileName:foo/bar/MyClass.kt
CLASS GENERATED[org.jetbrains.kotlin.compiler.plugin.template.fir.SimpleClassGenerator.Key] CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]
thisReceiver: VALUE_PARAMETER INSTANCE_RECEIVER kind:DispatchReceiver name:<this> type:foo.bar.MyClass
CONSTRUCTOR GENERATED[org.jetbrains.kotlin.compiler.plugin.template.fir.SimpleClassGenerator.Key] visibility:public returnType:foo.bar.MyClass
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/testData/box/simple.fir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FILE: simple.kt
}

}
FILE: __GENERATED DECLARATIONS__.kt
FILE: foo/bar/MyClass.kt
package foo.bar

public final class MyClass : R|kotlin/Any| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FILE: foo.kt
public final fun test(): R|kotlin/Unit| {
R|foo/takeInt|(Int(10))
}
FILE: __GENERATED DECLARATIONS__.kt
FILE: foo/bar/MyClass.kt
package foo.bar

public final class MyClass : R|kotlin/Any| {
Expand All @@ -24,7 +24,7 @@ FILE: bar.kt
R|foo/takeInt|(Int(10))
R|foo/takeInt<Inapplicable(INAPPLICABLE): foo/takeInt>#|(String(Hello))
}
FILE: __GENERATED DECLARATIONS__.kt
FILE: foo/bar/MyClass.kt
package foo.bar

public final class MyClass : R|kotlin/Any| {
Expand Down
2 changes: 1 addition & 1 deletion compiler-plugin/testData/diagnostics/simple.fir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FILE: simple.kt
lval s: R|kotlin/String| = R|foo/bar/MyClass|().R|foo/bar/MyClass.foo|()
R|<local>/s|.<Unresolved name: inc>#()
}
FILE: __GENERATED DECLARATIONS__.kt
FILE: foo/bar/MyClass.kt
package foo.bar

public final class MyClass : R|kotlin/Any| {
Expand Down
9 changes: 3 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[versions]
# https://github.com/JetBrains/kotlin
kotlin = "2.2.20"
kotlin = "2.3.0-RC"

# https://github.com/Kotlin/binary-compatibility-validator
kotlin-binaryCompatibilityValidator = "0.16.3"

# https://github.com/junit-team/junit4
junit = "4.13.2"

# https://github.com/gmazzo/gradle-buildconfig-plugin
buildconfig = "5.6.5"


[libraries]
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }
kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" }
kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" }
kotlin-test-junit5 = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit5", version.ref = "kotlin" }
Expand All @@ -22,8 +21,6 @@ kotlin-compiler = { group = "org.jetbrains.kotlin", name = "kotlin-compiler", ve
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
kotlin-gradle-plugin-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }

junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down
16 changes: 8 additions & 8 deletions kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ js-yaml@^4.1.0:
dependencies:
argparse "^2.0.1"

kotlin-web-helpers@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-2.1.0.tgz#6cd4b0f0dc3baea163929c8638155b8d19c55a74"
integrity sha512-NAJhiNB84tnvJ5EQx7iER3GWw7rsTZkX9HVHZpe7E3dDBD/dhTzqgSwNU3MfQjniy2rB04bP24WM9Z32ntUWRg==
kotlin-web-helpers@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/kotlin-web-helpers/-/kotlin-web-helpers-3.0.0.tgz#3ed6b48f694f74bb60a737a9d7e2c0e3b29abdb9"
integrity sha512-kdQO4AJQkUPvpLh9aglkXDRyN+CfXO7pKq+GESEnxooBFkQpytLrqZis3ABvmFN1cGw/ZQ/K38u5sRGW+NfBnw==
dependencies:
format-util "^1.0.5"

Expand Down Expand Up @@ -288,10 +288,10 @@ minimatch@^9.0.4, minimatch@^9.0.5:
resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.1.2.tgz#93a9626ce5e5e66bd4db86849e7515e92340a707"
integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==

[email protected].1:
version "11.7.1"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-11.7.1.tgz#91948fecd624fb4bd154ed260b7e1ad3910d7c7a"
integrity sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==
[email protected].2:
version "11.7.2"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-11.7.2.tgz#3c0079fe5cc2f8ea86d99124debcc42bb1ab22b5"
integrity sha512-lkqVJPmqqG/w5jmmFtiRvtA2jkDyNVUcefFJKb2uyX4dekk8Okgqop3cgbFiaIvj8uCRJVTP5x9dfxGyXm2jvQ==
dependencies:
browser-stdout "^1.3.1"
chokidar "^4.0.1"
Expand Down