diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 56f90cff742..6133291570b 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -223,7 +223,7 @@ fun main(args: Array) { } } - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testGroup("plugins/sam-with-receiver/tests-gen", "plugins/sam-with-receiver/testData") { testClass { model("diagnostics") } diff --git a/plugins/sam-with-receiver/build.gradle.kts b/plugins/sam-with-receiver/build.gradle.kts new file mode 100644 index 00000000000..1f47cead904 --- /dev/null +++ b/plugins/sam-with-receiver/build.gradle.kts @@ -0,0 +1,57 @@ +description = "Kotlin SamWithReceiver Compiler Plugin" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + embedded(project(":kotlin-sam-with-receiver-compiler-plugin.common")) + embedded(project(":kotlin-sam-with-receiver-compiler-plugin.k1")) + embedded(project(":kotlin-sam-with-receiver-compiler-plugin.k2")) + embedded(project(":kotlin-sam-with-receiver-compiler-plugin.cli")) + + testApi(project(":compiler:backend")) + testApi(project(":compiler:cli")) + testApi(project(":kotlin-sam-with-receiver-compiler-plugin.cli")) + testCompileOnly(project(":kotlin-compiler")) + testImplementation(project(":kotlin-scripting-jvm-host-unshaded")) + + testApiJUnit5(vintageEngine = true) + + testApi(projectTests(":compiler:tests-common-new")) + testApi(projectTests(":compiler:test-infrastructure")) + testApi(projectTests(":compiler:test-infrastructure-utils")) + + testImplementation(projectTests(":compiler:tests-common")) + testImplementation(commonDependency("junit:junit")) + + testCompileOnly(project(":kotlin-reflect-api")) + testRuntimeOnly(project(":kotlin-reflect")) + testRuntimeOnly(project(":core:descriptors.runtime")) + testRuntimeOnly(project(":compiler:fir:fir-serialization")) + + + testApi(intellijCore()) +} + +sourceSets { + "main" { none() } + "test" { + projectDefault() + generatedTestDir() + } +} + +publish() + +runtimeJar() +sourcesJar() +javadocJar() +testsJar() + +projectTest(parallel = true) { + dependsOn(":dist") + workingDir = rootDir + useJUnitPlatform() +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts deleted file mode 100644 index 140690de56a..00000000000 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -description = "Kotlin SamWithReceiver Compiler Plugin" - -plugins { - kotlin("jvm") - id("jps-compatible") -} - -dependencies { - compileOnly(project(":core:descriptors")) - compileOnly(project(":compiler:frontend")) - compileOnly(project(":compiler:frontend.java")) - compileOnly(project(":compiler:plugin-api")) - compileOnly(intellijCore()) - - testApi(project(":compiler:backend")) - testApi(project(":compiler:cli")) - testApi(projectTests(":compiler:tests-common")) - testApi(commonDependency("junit:junit")) - testCompileOnly(project(":kotlin-compiler")) - testCompileOnly(intellijCore()) - testApi(project(":kotlin-scripting-jvm-host-unshaded")) - testRuntimeOnly(intellijCore()) -} - -sourceSets { - "main" { projectDefault() } - "test" { projectDefault() } -} - -publish() - -runtimeJar() -sourcesJar() -javadocJar() -testsJar() - -projectTest(parallel = true) { - dependsOn(":dist") - workingDir = rootDir -} diff --git a/plugins/sam-with-receiver/sam-with-receiver.cli/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver.cli/build.gradle.kts new file mode 100644 index 00000000000..8cac09c1ca9 --- /dev/null +++ b/plugins/sam-with-receiver/sam-with-receiver.cli/build.gradle.kts @@ -0,0 +1,25 @@ +description = "Kotlin SamWithReceiver Compiler Plugin (CLI)" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + api(project(":kotlin-sam-with-receiver-compiler-plugin.common")) + api(project(":kotlin-sam-with-receiver-compiler-plugin.k1")) + api(project(":kotlin-sam-with-receiver-compiler-plugin.k2")) + compileOnly(project(":compiler:util")) + compileOnly(project(":compiler:plugin-api")) + compileOnly(project(":compiler:fir:entrypoint")) + compileOnly(intellijCore()) +} + +sourceSets { + "main" { projectDefault() } + "test" { none() } +} + +runtimeJar() +sourcesJar() +javadocJar() diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor b/plugins/sam-with-receiver/sam-with-receiver.cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor rename to plugins/sam-with-receiver/sam-with-receiver.cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar b/plugins/sam-with-receiver/sam-with-receiver.cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar rename to plugins/sam-with-receiver/sam-with-receiver.cli/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverPlugin.kt b/plugins/sam-with-receiver/sam-with-receiver.cli/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverPlugin.kt similarity index 65% rename from plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverPlugin.kt rename to plugins/sam-with-receiver/sam-with-receiver.cli/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverPlugin.kt index 0cbb78d3ae5..8f678291bdd 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverPlugin.kt +++ b/plugins/sam-with-receiver/sam-with-receiver.cli/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverPlugin.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.samWithReceiver @@ -31,8 +20,7 @@ import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverConfigurationKeys.ANN import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverConfigurationKeys.PRESET object SamWithReceiverConfigurationKeys { - val ANNOTATION: CompilerConfigurationKey> = - CompilerConfigurationKey.create("annotation qualified name") + val ANNOTATION: CompilerConfigurationKey> = CompilerConfigurationKey.create("annotation qualified name") val PRESET: CompilerConfigurationKey> = CompilerConfigurationKey.create("annotation preset") } @@ -41,11 +29,15 @@ class SamWithReceiverCommandLineProcessor : CommandLineProcessor { companion object { val SUPPORTED_PRESETS = emptyMap>() - val ANNOTATION_OPTION = CliOption("annotation", "", "Annotation qualified names", - required = false, allowMultipleOccurrences = true) + val ANNOTATION_OPTION = CliOption( + "annotation", "", "Annotation qualified names", + required = false, allowMultipleOccurrences = true + ) - val PRESET_OPTION = CliOption("preset", "", "Preset name (${SUPPORTED_PRESETS.keys.joinToString()})", - required = false, allowMultipleOccurrences = true) + val PRESET_OPTION = CliOption( + "preset", "", "Preset name (${SUPPORTED_PRESETS.keys.joinToString()})", + required = false, allowMultipleOccurrences = true + ) val PLUGIN_ID = "org.jetbrains.kotlin.samWithReceiver" } @@ -72,10 +64,14 @@ class SamWithReceiverComponentRegistrar : ComponentRegistrar { } } -class CliSamWithReceiverComponentContributor(val annotations: List): StorageComponentContainerContributor { - override fun registerModuleComponents(container: StorageComponentContainer, platform: TargetPlatform, moduleDescriptor: ModuleDescriptor) { +class CliSamWithReceiverComponentContributor(val annotations: List) : StorageComponentContainerContributor { + override fun registerModuleComponents( + container: StorageComponentContainer, + platform: TargetPlatform, + moduleDescriptor: ModuleDescriptor + ) { if (!platform.isJvm()) return container.useInstance(SamWithReceiverResolverExtension(annotations)) } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver.common/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver.common/build.gradle.kts new file mode 100644 index 00000000000..d4bb8fcee5e --- /dev/null +++ b/plugins/sam-with-receiver/sam-with-receiver.common/build.gradle.kts @@ -0,0 +1,20 @@ +description = "Kotlin SamWithReceiver Compiler Plugin (Common)" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + compileOnly(project(":compiler:util")) + compileOnly(project(":core:compiler.common")) +} + +sourceSets { + "main" { projectDefault() } + "test" { none() } +} + +runtimeJar() +javadocJar() +sourcesJar() diff --git a/plugins/sam-with-receiver/sam-with-receiver.k1/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver.k1/build.gradle.kts new file mode 100644 index 00000000000..619b23c57d0 --- /dev/null +++ b/plugins/sam-with-receiver/sam-with-receiver.k1/build.gradle.kts @@ -0,0 +1,22 @@ +description = "Kotlin SamWithReceiver Compiler Plugin (K1)" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + compileOnly(project(":compiler:frontend")) + compileOnly(project(":compiler:frontend.java")) + compileOnly(intellijCore()) +} + +sourceSets { + "main" { projectDefault() } + "test" { projectDefault() } +} + +runtimeJar() +sourcesJar() +javadocJar() + diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverResolverExtension.kt b/plugins/sam-with-receiver/sam-with-receiver.k1/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverResolverExtension.kt similarity index 53% rename from plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverResolverExtension.kt rename to plugins/sam-with-receiver/sam-with-receiver.k1/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverResolverExtension.kt index 140481de7b5..5e53364d00f 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/src/SamWithReceiverResolverExtension.kt +++ b/plugins/sam-with-receiver/sam-with-receiver.k1/src/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverResolverExtension.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.samWithReceiver @@ -23,11 +12,11 @@ import org.jetbrains.kotlin.resolve.sam.SamWithReceiverResolver import org.jetbrains.kotlin.psi.KtModifierListOwner class SamWithReceiverResolverExtension( - private val annotations: List + private val annotations: List ) : SamWithReceiverResolver, AnnotationBasedExtension { override fun getAnnotationFqNames(modifierListOwner: KtModifierListOwner?) = annotations override fun shouldConvertFirstSamParameterToReceiver(function: FunctionDescriptor): Boolean { return (function.containingDeclaration as? ClassDescriptor)?.hasSpecialAnnotation(null) ?: false } -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver.k2/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver.k2/build.gradle.kts new file mode 100644 index 00000000000..ddfa6360cd6 --- /dev/null +++ b/plugins/sam-with-receiver/sam-with-receiver.k2/build.gradle.kts @@ -0,0 +1,27 @@ +description = "Kotlin SamWithReceiver Compiler Plugin (K2)" + +plugins { + kotlin("jvm") + id("jps-compatible") +} + +dependencies { + compileOnly(project(":compiler:fir:cones")) + compileOnly(project(":compiler:fir:tree")) + compileOnly(project(":compiler:fir:resolve")) + compileOnly(project(":compiler:fir:checkers")) + compileOnly(project(":compiler:ir.backend.common")) + compileOnly(project(":compiler:fir:entrypoint")) + + compileOnly(intellijCore()) + runtimeOnly(kotlinStdlib()) +} + +sourceSets { + "main" { projectDefault() } + "test" { none() } +} + +runtimeJar() +sourcesJar() +javadocJar() diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt similarity index 85% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt rename to plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt index 4cbdec7694f..03ffe20d3f1 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt +++ b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptNewDefTest.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.samWithReceiver diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt similarity index 72% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt rename to plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt index 0f993805671..a35d80f2b19 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt +++ b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverScriptTest.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.samWithReceiver diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt similarity index 57% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt rename to plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt index f84c0b4474e..e76cbfcbe34 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt +++ b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/AbstractSamWithReceiverTest.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.samWithReceiver diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java similarity index 87% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java rename to plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java index ad2cf1b4fd2..c7f00d42bbe 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java +++ b/plugins/sam-with-receiver/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptNewDefTestGenerated.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("plugins/sam-with-receiver/sam-with-receiver-cli/testData/script") -@TestDataPath("$PROJECT_ROOT") +@TestDataPath("/") @RunWith(JUnit3RunnerWithInners.class) public class SamWithReceiverScriptNewDefTestGenerated extends AbstractSamWithReceiverScriptNewDefTest { private void runTest(String testDataFilePath) throws Exception { @@ -30,6 +30,6 @@ public class SamWithReceiverScriptNewDefTestGenerated extends AbstractSamWithRec @TestMetadata("samConversionSimple.kts") public void testSamConversionSimple() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.kts"); + runTest("plugins/sam-with-receiver/testData/script/samConversionSimple.kts"); } } diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.kt b/plugins/sam-with-receiver/testData/diagnostics/noParameters.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.kt rename to plugins/sam-with-receiver/testData/diagnostics/noParameters.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt b/plugins/sam-with-receiver/testData/diagnostics/noParameters.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.txt rename to plugins/sam-with-receiver/testData/diagnostics/noParameters.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt b/plugins/sam-with-receiver/testData/diagnostics/noReturnType.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt rename to plugins/sam-with-receiver/testData/diagnostics/noReturnType.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt b/plugins/sam-with-receiver/testData/diagnostics/noReturnType.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.txt rename to plugins/sam-with-receiver/testData/diagnostics/noReturnType.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.kt b/plugins/sam-with-receiver/testData/diagnostics/samConversionNoParameters.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.kt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionNoParameters.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt b/plugins/sam-with-receiver/testData/diagnostics/samConversionNoParameters.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.txt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionNoParameters.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt b/plugins/sam-with-receiver/testData/diagnostics/samConversionSimple.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionSimple.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt b/plugins/sam-with-receiver/testData/diagnostics/samConversionSimple.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.txt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionSimple.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt b/plugins/sam-with-receiver/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt b/plugins/sam-with-receiver/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt rename to plugins/sam-with-receiver/testData/diagnostics/samConversionSimpleWithoutAnnotation.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt b/plugins/sam-with-receiver/testData/diagnostics/samWithAnnotation.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt rename to plugins/sam-with-receiver/testData/diagnostics/samWithAnnotation.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt b/plugins/sam-with-receiver/testData/diagnostics/samWithAnnotation.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.txt rename to plugins/sam-with-receiver/testData/diagnostics/samWithAnnotation.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt b/plugins/sam-with-receiver/testData/diagnostics/samWithoutAnnotation.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt rename to plugins/sam-with-receiver/testData/diagnostics/samWithoutAnnotation.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt b/plugins/sam-with-receiver/testData/diagnostics/samWithoutAnnotation.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.txt rename to plugins/sam-with-receiver/testData/diagnostics/samWithoutAnnotation.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt b/plugins/sam-with-receiver/testData/diagnostics/singleParameter.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt rename to plugins/sam-with-receiver/testData/diagnostics/singleParameter.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt b/plugins/sam-with-receiver/testData/diagnostics/singleParameter.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.txt rename to plugins/sam-with-receiver/testData/diagnostics/singleParameter.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt b/plugins/sam-with-receiver/testData/diagnostics/singleParameterWithoutAnnotation.kt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt rename to plugins/sam-with-receiver/testData/diagnostics/singleParameterWithoutAnnotation.kt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt b/plugins/sam-with-receiver/testData/diagnostics/singleParameterWithoutAnnotation.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.txt rename to plugins/sam-with-receiver/testData/diagnostics/singleParameterWithoutAnnotation.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.kts b/plugins/sam-with-receiver/testData/script/samConversionSimple.kts similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.kts rename to plugins/sam-with-receiver/testData/script/samConversionSimple.kts diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt b/plugins/sam-with-receiver/testData/script/samConversionSimple.txt similarity index 100% rename from plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.txt rename to plugins/sam-with-receiver/testData/script/samConversionSimple.txt diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java b/plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java similarity index 79% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java rename to plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java index f563d124508..41419e0d4ad 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java +++ b/plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverScriptTestGenerated.java @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("plugins/sam-with-receiver/sam-with-receiver-cli/testData/script") +@TestMetadata("plugins/sam-with-receiver/testData/script") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class SamWithReceiverScriptTestGenerated extends AbstractSamWithReceiverScriptTest { @@ -26,11 +26,11 @@ public class SamWithReceiverScriptTestGenerated extends AbstractSamWithReceiverS } public void testAllFilesPresentInScript() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/sam-with-receiver/sam-with-receiver-cli/testData/script"), Pattern.compile("^(.+)\\.kts$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/sam-with-receiver/testData/script"), Pattern.compile("^(.+)\\.kts$"), null, true); } @TestMetadata("samConversionSimple.kts") public void testSamConversionSimple() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/script/samConversionSimple.kts"); + runTest("plugins/sam-with-receiver/testData/script/samConversionSimple.kts"); } } diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java b/plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java similarity index 63% rename from plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java rename to plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java index a9a606fcbf3..0a4a5d09678 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/test/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java +++ b/plugins/sam-with-receiver/tests-gen/org/jetbrains/kotlin/samWithReceiver/SamWithReceiverTestGenerated.java @@ -17,7 +17,7 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics") +@TestMetadata("plugins/sam-with-receiver/testData/diagnostics") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class SamWithReceiverTestGenerated extends AbstractSamWithReceiverTest { @@ -26,51 +26,51 @@ public class SamWithReceiverTestGenerated extends AbstractSamWithReceiverTest { } public void testAllFilesPresentInDiagnostics() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/sam-with-receiver/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true); } @TestMetadata("noParameters.kt") public void testNoParameters() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noParameters.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/noParameters.kt"); } @TestMetadata("noReturnType.kt") public void testNoReturnType() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/noReturnType.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/noReturnType.kt"); } @TestMetadata("samConversionNoParameters.kt") public void testSamConversionNoParameters() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionNoParameters.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/samConversionNoParameters.kt"); } @TestMetadata("samConversionSimple.kt") public void testSamConversionSimple() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimple.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/samConversionSimple.kt"); } @TestMetadata("samConversionSimpleWithoutAnnotation.kt") public void testSamConversionSimpleWithoutAnnotation() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/samConversionSimpleWithoutAnnotation.kt"); } @TestMetadata("samWithAnnotation.kt") public void testSamWithAnnotation() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithAnnotation.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/samWithAnnotation.kt"); } @TestMetadata("samWithoutAnnotation.kt") public void testSamWithoutAnnotation() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/samWithoutAnnotation.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/samWithoutAnnotation.kt"); } @TestMetadata("singleParameter.kt") public void testSingleParameter() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameter.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/singleParameter.kt"); } @TestMetadata("singleParameterWithoutAnnotation.kt") public void testSingleParameterWithoutAnnotation() throws Exception { - runTest("plugins/sam-with-receiver/sam-with-receiver-cli/testData/diagnostics/singleParameterWithoutAnnotation.kt"); + runTest("plugins/sam-with-receiver/testData/diagnostics/singleParameterWithoutAnnotation.kt"); } } diff --git a/settings.gradle b/settings.gradle index a0cff89ca28..124cd8e16a2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -206,7 +206,12 @@ include ":kotlin-noarg-compiler-plugin", ":kotlin-noarg-compiler-plugin.cli" include ":kotlin-sam-with-receiver-compiler-plugin", - ":kotlin-imports-dumper-compiler-plugin", + ":kotlin-sam-with-receiver-compiler-plugin.common", + ":kotlin-sam-with-receiver-compiler-plugin.k1", + ":kotlin-sam-with-receiver-compiler-plugin.k2", + ":kotlin-sam-with-receiver-compiler-plugin.cli" + +include ":kotlin-imports-dumper-compiler-plugin", ":kotlin-script-runtime", ":plugins:fir-plugin-prototype", ":plugins:fir-plugin-prototype:plugin-annotations", @@ -718,7 +723,12 @@ project(':kotlin-noarg-compiler-plugin.k2').projectDir = "$rootDir/plugins/noarg project(':kotlin-noarg-compiler-plugin.backend').projectDir = "$rootDir/plugins/noarg/noarg.backend" as File project(':kotlin-noarg-compiler-plugin.cli').projectDir = "$rootDir/plugins/noarg/noarg.cli" as File -project(':kotlin-sam-with-receiver-compiler-plugin').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver-cli" as File +project(':kotlin-sam-with-receiver-compiler-plugin').projectDir = "$rootDir/plugins/sam-with-receiver" as File +project(':kotlin-sam-with-receiver-compiler-plugin.common').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.common" as File +project(':kotlin-sam-with-receiver-compiler-plugin.k1').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.k1" as File +project(':kotlin-sam-with-receiver-compiler-plugin.k2').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.k2" as File +project(':kotlin-sam-with-receiver-compiler-plugin.cli').projectDir = "$rootDir/plugins/sam-with-receiver/sam-with-receiver.cli" as File + project(':tools:kotlinp').projectDir = "$rootDir/libraries/tools/kotlinp" as File project(':kotlin-project-model').projectDir = "$rootDir/libraries/tools/kotlin-project-model" as File project(':kotlin-gradle-plugin-api').projectDir = "$rootDir/libraries/tools/kotlin-gradle-plugin-api" as File