make jps-plugin testable from IJ infrastructure
^KTIJ-20456
This commit is contained in:
@@ -285,6 +285,7 @@ extra["compilerArtifactsForIde"] = listOf(
|
||||
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-common-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-plugin-classpath",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-plugin-tests-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide",
|
||||
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide",
|
||||
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide",
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.jetbrains.kotlin.preloading.ClassPreloadingUtils
|
||||
import org.jetbrains.kotlin.preloading.Preloader
|
||||
import org.jetbrains.kotlin.test.KtAssert.assertTrue
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.utils.KotlinPaths
|
||||
import org.jetbrains.kotlin.utils.KotlinPathsFromHomeDir
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
@@ -26,6 +28,9 @@ import java.util.regex.Pattern
|
||||
import java.util.zip.ZipOutputStream
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
val PathUtil.kotlinPathsForDistDirectoryForTests: KotlinPaths
|
||||
get() = System.getProperty("jps.kotlin.home")?.let(::File)?.let(::KotlinPathsFromHomeDir) ?: kotlinPathsForDistDirectory
|
||||
|
||||
object MockLibraryUtil {
|
||||
private var compilerClassLoader = SoftReference<ClassLoader>(null)
|
||||
|
||||
@@ -230,7 +235,7 @@ object MockLibraryUtil {
|
||||
@Synchronized
|
||||
private fun createCompilerClassLoader(): ClassLoader {
|
||||
return ClassPreloadingUtils.preloadClasses(
|
||||
listOf(PathUtil.kotlinPathsForDistDirectory.compilerPath),
|
||||
listOf(PathUtil.kotlinPathsForDistDirectoryForTests.compilerPath),
|
||||
Preloader.DEFAULT_CLASS_NUMBER_ESTIMATE, null, null
|
||||
)
|
||||
}
|
||||
|
||||
+8
-14
@@ -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.jps.build
|
||||
@@ -66,6 +55,7 @@ import org.jetbrains.kotlin.platform.idePlatformKind
|
||||
import org.jetbrains.kotlin.platform.impl.isJavaScript
|
||||
import org.jetbrains.kotlin.platform.impl.isJvm
|
||||
import org.jetbrains.kotlin.platform.orDefault
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
@@ -325,11 +315,15 @@ abstract class AbstractIncrementalJpsTest(
|
||||
}
|
||||
|
||||
protected open fun doTest(testDataPath: String) {
|
||||
KotlinTestUtils.runTest(this::executeTest, this, testDataPath)
|
||||
}
|
||||
|
||||
private fun executeTest(testDataPath: String) {
|
||||
testDataDir = File(testDataPath)
|
||||
workDir = FileUtilRt.createTempDirectory(TEMP_DIRECTORY_TO_USE, "aijt-jps-build", null)
|
||||
additionalCommandLineArguments = parseAdditionalArgs(File(testDataPath))
|
||||
val buildLogFile = buildLogFinder.findBuildLog(testDataDir)
|
||||
Disposer.register(testRootDisposable, Disposable { FileUtilRt.delete(workDir) })
|
||||
Disposer.register(testRootDisposable) { FileUtilRt.delete(workDir) }
|
||||
|
||||
val modulesTxt = configureModules()
|
||||
if (modulesTxt?.muted == true) return
|
||||
|
||||
+3
-15
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.jps.build
|
||||
@@ -23,7 +12,6 @@ import org.jetbrains.jps.model.java.JpsJavaLibraryType
|
||||
import org.jetbrains.jps.model.library.JpsLibrary
|
||||
import org.jetbrains.jps.model.library.JpsOrderRootType
|
||||
import org.jetbrains.jps.model.module.JpsModule
|
||||
import org.jetbrains.jps.util.JpsPathUtil
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
|
||||
@@ -60,7 +48,7 @@ abstract class AbstractKotlinJpsBuildTestCase : BaseKotlinJpsBuildTestCase() {
|
||||
}
|
||||
|
||||
companion object {
|
||||
val TEST_DATA_PATH = "jps/jps-plugin/testData/"
|
||||
val TEST_DATA_PATH get() = System.getProperty("pass.jps.testData.home") ?: "jps/jps-plugin/testData/"
|
||||
|
||||
@JvmStatic
|
||||
protected fun addKotlinStdlibDependency(modules: Collection<JpsModule>, exported: Boolean = false): JpsLibrary {
|
||||
|
||||
+4
-14
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.jps.build
|
||||
@@ -44,6 +33,7 @@ import org.jetbrains.kotlin.jps.build.fixtures.EnableICFixture
|
||||
import org.jetbrains.kotlin.jps.incremental.createTestingCompilerEnvironment
|
||||
import org.jetbrains.kotlin.jps.incremental.runJSCompiler
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.utils.JsMetadataVersion
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.*
|
||||
@@ -167,7 +157,7 @@ abstract class AbstractJsLookupTrackerTest : AbstractLookupTrackerTest() {
|
||||
}
|
||||
|
||||
protected open val jsStdlibFile: File
|
||||
get() = PathUtil.kotlinPathsForDistDirectory.jsStdLibJarPath
|
||||
get() = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath
|
||||
|
||||
protected open fun configureAdditionalArgs(args: K2JSCompilerArguments) {
|
||||
args.outputFile = File(outDir, "out.js").canonicalPath
|
||||
|
||||
@@ -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.jps.build
|
||||
@@ -66,6 +55,7 @@ import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.MockLibraryUtilExt
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.kotlin.utils.Printer
|
||||
@@ -243,7 +233,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
|
||||
fun testKotlinJavaScriptProjectWithDirectoryAsStdlib() {
|
||||
initProject()
|
||||
setupKotlinJSFacet()
|
||||
val jslibJar = PathUtil.kotlinPathsForDistDirectory.jsStdLibJarPath
|
||||
val jslibJar = PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath
|
||||
val jslibDir = File(workDir, "KotlinJavaScript")
|
||||
try {
|
||||
Decompressor.Zip(jslibJar).extract(jslibDir)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 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.
|
||||
*/
|
||||
|
||||
@@ -9,40 +9,56 @@ import org.jetbrains.jps.model.JpsProject
|
||||
import org.jetbrains.jps.model.java.JpsJavaLibraryType
|
||||
import org.jetbrains.jps.model.library.JpsLibrary
|
||||
import org.jetbrains.jps.model.library.JpsOrderRootType
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.File
|
||||
|
||||
enum class KotlinJpsLibrary(val id: String, vararg val roots: File) {
|
||||
enum class KotlinJpsLibrary(val id: String, roots: () -> Array<File>) {
|
||||
MockRuntime(
|
||||
"kotlin-mock-runtime",
|
||||
PathUtil.kotlinPathsForDistDirectory.stdlibPath,
|
||||
File(PathUtil.kotlinPathsForDistDirectory.libPath, "annotations-13.0.jar")
|
||||
{
|
||||
arrayOf(
|
||||
PathUtil.kotlinPathsForDistDirectoryForTests.stdlibPath,
|
||||
File(PathUtil.kotlinPathsForDistDirectoryForTests.libPath, "annotations-13.0.jar"),
|
||||
)
|
||||
}
|
||||
),
|
||||
|
||||
JvmStdLib(
|
||||
"kotlin-stdlib",
|
||||
PathUtil.kotlinPathsForDistDirectory.stdlibPath,
|
||||
File(PathUtil.kotlinPathsForDistDirectory.libPath, "annotations-13.0.jar")
|
||||
{
|
||||
arrayOf(
|
||||
PathUtil.kotlinPathsForDistDirectoryForTests.stdlibPath,
|
||||
File(PathUtil.kotlinPathsForDistDirectoryForTests.libPath, "annotations-13.0.jar"),
|
||||
)
|
||||
}
|
||||
),
|
||||
|
||||
JvmTest(
|
||||
"kotlin-test",
|
||||
PathUtil.kotlinPathsForDistDirectory.kotlinTestPath
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.kotlinTestPath) },
|
||||
),
|
||||
|
||||
JsStdLib(
|
||||
"KotlinJavaScript",
|
||||
PathUtil.kotlinPathsForDistDirectory.jsStdLibJarPath
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsStdLibJarPath) }
|
||||
),
|
||||
JsTest(
|
||||
"KotlinJavaScriptTest",
|
||||
PathUtil.kotlinPathsForDistDirectory.jsKotlinTestJarPath
|
||||
{ arrayOf(PathUtil.kotlinPathsForDistDirectoryForTests.jsKotlinTestJarPath) }
|
||||
),
|
||||
Lombok(
|
||||
"lombok",
|
||||
PathUtil.kotlinPathsForDistDirectory.stdlibPath,
|
||||
File(lombok.Lombok::class.java.protectionDomain.codeSource.location.toURI().path)
|
||||
{
|
||||
arrayOf(
|
||||
PathUtil.kotlinPathsForDistDirectoryForTests.stdlibPath,
|
||||
File(lombok.Lombok::class.java.protectionDomain.codeSource.location.toURI().path),
|
||||
)
|
||||
}
|
||||
);
|
||||
|
||||
val roots: Array<File> by lazy(roots)
|
||||
|
||||
fun create(project: JpsProject): JpsLibrary {
|
||||
val library = project.addLibrary(id, JpsJavaLibraryType.INSTANCE)
|
||||
|
||||
|
||||
+8
-16
@@ -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.jps.incremental
|
||||
@@ -23,16 +12,19 @@ import org.jetbrains.kotlin.cli.js.K2JSCompiler
|
||||
import org.jetbrains.kotlin.compilerRunner.*
|
||||
import org.jetbrains.kotlin.config.Services
|
||||
import org.jetbrains.kotlin.jps.build.KotlinBuilder
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.*
|
||||
import java.io.BufferedReader
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.PrintStream
|
||||
import java.io.StringReader
|
||||
|
||||
fun createTestingCompilerEnvironment(
|
||||
messageCollector: MessageCollector,
|
||||
outputItemsCollector: OutputItemsCollectorImpl,
|
||||
services: Services
|
||||
): JpsCompilerEnvironment {
|
||||
val paths = PathUtil.kotlinPathsForDistDirectory
|
||||
|
||||
val paths = PathUtil.kotlinPathsForDistDirectoryForTests
|
||||
val wrappedMessageCollector = MessageCollectorToOutputItemsCollectorAdapter(messageCollector, outputItemsCollector)
|
||||
return JpsCompilerEnvironment(
|
||||
paths,
|
||||
|
||||
+7
-17
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.jvm.compiler
|
||||
@@ -19,12 +8,12 @@ package org.jetbrains.kotlin.jvm.compiler
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType
|
||||
import org.jetbrains.kotlin.build.JvmSourceRoot
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation
|
||||
import org.jetbrains.kotlin.jps.build.AbstractKotlinJpsBuildTestCase
|
||||
import org.jetbrains.kotlin.modules.KotlinModuleXmlBuilder
|
||||
import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.test.kotlinPathsForDistDirectoryForTests
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.junit.Ignore
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -34,7 +23,8 @@ import java.io.File
|
||||
*/
|
||||
class ClasspathOrderTest : TestCaseWithTmpdir() {
|
||||
companion object {
|
||||
private val sourceDir = File(KtTestUtil.getTestDataPathBase() + "/classpathOrder").absoluteFile
|
||||
private val sourceDir
|
||||
get() = File(AbstractKotlinJpsBuildTestCase.TEST_DATA_PATH + "/../../../compiler/testData/classpathOrder").absoluteFile
|
||||
}
|
||||
|
||||
fun testClasspathOrderForCLI() {
|
||||
@@ -47,7 +37,7 @@ class ClasspathOrderTest : TestCaseWithTmpdir() {
|
||||
File(tmpdir, "output").absolutePath,
|
||||
listOf(sourceDir),
|
||||
listOf(JvmSourceRoot(sourceDir)),
|
||||
listOf(PathUtil.kotlinPathsForDistDirectory.stdlibPath),
|
||||
listOf(PathUtil.kotlinPathsForDistDirectoryForTests.stdlibPath),
|
||||
emptyList(),
|
||||
null,
|
||||
JavaModuleBuildTargetType.PRODUCTION.typeId,
|
||||
|
||||
+10
-19
@@ -1,17 +1,6 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.modules;
|
||||
@@ -20,15 +9,17 @@ import junit.framework.TestCase;
|
||||
import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
|
||||
import org.jetbrains.kotlin.build.JvmSourceRoot;
|
||||
import org.jetbrains.kotlin.config.IncrementalCompilation;
|
||||
import org.jetbrains.kotlin.jps.build.AbstractKotlinJpsBuildTestCase;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class KotlinModuleXmlGeneratorTest extends TestCase {
|
||||
private final static String testDataPath = "jps/jps-plugin/testData/modules.xml";
|
||||
private static String getTestDataPath() {
|
||||
return AbstractKotlinJpsBuildTestCase.Companion.getTEST_DATA_PATH() + "/modules.xml";
|
||||
}
|
||||
|
||||
public void testBasic() {
|
||||
String actual = new KotlinModuleXmlBuilder().addModule(
|
||||
@@ -45,7 +36,7 @@ public class KotlinModuleXmlGeneratorTest extends TestCase {
|
||||
Collections.emptyList(),
|
||||
IncrementalCompilation.isEnabledForJvm()
|
||||
).asText().toString();
|
||||
KotlinTestUtils.assertEqualsToFile(new File(testDataPath + "/basic.xml"), actual);
|
||||
KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/basic.xml"), actual);
|
||||
}
|
||||
|
||||
public void testFiltered() {
|
||||
@@ -63,7 +54,7 @@ public class KotlinModuleXmlGeneratorTest extends TestCase {
|
||||
Collections.emptyList(),
|
||||
IncrementalCompilation.isEnabledForJvm()
|
||||
).asText().toString();
|
||||
KotlinTestUtils.assertEqualsToFile(new File(testDataPath + "/filtered.xml"), actual);
|
||||
KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/filtered.xml"), actual);
|
||||
}
|
||||
|
||||
public void testMultiple() {
|
||||
@@ -97,7 +88,7 @@ public class KotlinModuleXmlGeneratorTest extends TestCase {
|
||||
IncrementalCompilation.isEnabledForJvm()
|
||||
);
|
||||
String actual = builder.asText().toString();
|
||||
KotlinTestUtils.assertEqualsToFile(new File(testDataPath + "/multiple.xml"), actual);
|
||||
KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/multiple.xml"), actual);
|
||||
}
|
||||
|
||||
public void testModularJdkRoot() {
|
||||
@@ -115,6 +106,6 @@ public class KotlinModuleXmlGeneratorTest extends TestCase {
|
||||
Collections.emptyList(),
|
||||
IncrementalCompilation.isEnabledForJvm()
|
||||
).asText().toString();
|
||||
KotlinTestUtils.assertEqualsToFile(new File(testDataPath + "/modularJdkRoot.xml"), actual);
|
||||
KotlinTestUtils.assertEqualsToFile(new File(getTestDataPath() + "/modularJdkRoot.xml"), actual);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.jps.build
|
||||
@@ -636,11 +625,11 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
// When JPS is run on TeamCity, it can not rely on Kotlin plugin layout,
|
||||
// so the path to Kotlin is specified in a system property
|
||||
private fun computeKotlinPathsForJpsPlugin(messageCollector: MessageCollectorAdapter): KotlinPaths? {
|
||||
if (System.getProperty("kotlin.jps.tests").equals("true", ignoreCase = true)) {
|
||||
val jpsKotlinHome = System.getProperty(JPS_KOTLIN_HOME_PROPERTY)?.let { File(it) }
|
||||
if (System.getProperty("kotlin.jps.tests").equals("true", ignoreCase = true) && jpsKotlinHome == null) {
|
||||
return PathUtil.kotlinPathsForDistDirectory
|
||||
}
|
||||
|
||||
val jpsKotlinHome = System.getProperty(JPS_KOTLIN_HOME_PROPERTY)?.let { File(it) }
|
||||
return when {
|
||||
jpsKotlinHome == null -> {
|
||||
messageCollector.report(ERROR, "Make sure that '$JPS_KOTLIN_HOME_PROPERTY' system property is set in JPS process")
|
||||
|
||||
@@ -19,7 +19,9 @@ idePluginDependency {
|
||||
"compiler/testData/diagnostics/helpers",
|
||||
"compiler/tests-spec/testData",
|
||||
"compiler/testData/diagnostics/testsWithStdLib",
|
||||
"compiler/fir/raw-fir/psi2fir/testData"
|
||||
"compiler/fir/raw-fir/psi2fir/testData",
|
||||
"jps/jps-plugin/testData",
|
||||
"compiler/testData/classpathOrder",
|
||||
).forEach {
|
||||
from(rootDir.resolve(it)) {
|
||||
into(it)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
publishTestJarsForIde(
|
||||
listOf(
|
||||
":jps:jps-plugin",
|
||||
)
|
||||
)
|
||||
@@ -352,6 +352,7 @@ if (!buildProperties.inJpsBuildIdeaSync) {
|
||||
":prepare:ide-plugin-dependencies:kotlin-gradle-statistics-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-common-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-plugin-classpath",
|
||||
":prepare:ide-plugin-dependencies:kotlin-jps-plugin-tests-for-ide",
|
||||
":prepare:ide-plugin-dependencies:kotlinx-serialization-compiler-plugin-for-ide",
|
||||
":prepare:ide-plugin-dependencies:noarg-compiler-plugin-for-ide",
|
||||
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide",
|
||||
|
||||
Reference in New Issue
Block a user