Replace kotlin-test project dependencies in dist
KT-61969
This commit is contained in:
committed by
Space Team
parent
c40de28775
commit
653fc03cbc
@@ -65,6 +65,7 @@
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-js-runner" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-junit" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-junit5" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-testng" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-wasm-js" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-test-wasm-wasi" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
<trust group="org.jetbrains.kotlin" name="kotlin-tooling-core" version="1\.9\.3[0-9](-.+)?|2\.0\.0(-.+)?" regex="true"/>
|
||||
|
||||
@@ -9,6 +9,8 @@ plugins {
|
||||
// HACK: java plugin makes idea import dependencies on this project as source (with empty sources however),
|
||||
// this prevents reindexing of kotlin-compiler.jar after build on every change in compiler modules
|
||||
`java-library`
|
||||
// required to disambiguate attributes of non-jvm Kotlin libraries
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +52,9 @@ val libraries by configurations.creating {
|
||||
|
||||
val librariesStripVersion by configurations.creating
|
||||
|
||||
// for sbom only
|
||||
val librariesKotlinTest by configurations.creating
|
||||
|
||||
// Compiler plugins should be copied without `kotlin-` prefix
|
||||
val compilerPlugins by configurations.creating {
|
||||
exclude("org.jetbrains.kotlin", "kotlin-stdlib-common")
|
||||
@@ -105,10 +110,6 @@ val distLibraryProjects = listOfNotNull(
|
||||
":kotlin-scripting-compiler-impl",
|
||||
":kotlin-scripting-jvm",
|
||||
":js:js.engines",
|
||||
":kotlin-test:kotlin-test-junit",
|
||||
":kotlin-test:kotlin-test-junit5",
|
||||
":kotlin-test:kotlin-test-jvm",
|
||||
":kotlin-test:kotlin-test-testng",
|
||||
":libraries:tools:mutability-annotations-compat",
|
||||
":plugins:android-extensions-compiler",
|
||||
":plugins:jvm-abi-gen"
|
||||
@@ -133,9 +134,6 @@ val distCompilerPluginProjectsCompat = listOf(
|
||||
val distSourcesProjects = listOfNotNull(
|
||||
":kotlin-annotations-jvm",
|
||||
":kotlin-script-runtime",
|
||||
":kotlin-test:kotlin-test-junit",
|
||||
":kotlin-test:kotlin-test-junit5",
|
||||
":kotlin-test:kotlin-test-testng"
|
||||
)
|
||||
|
||||
configurations.all {
|
||||
@@ -162,10 +160,10 @@ dependencies {
|
||||
}
|
||||
|
||||
libraries(kotlinStdlib("jdk8"))
|
||||
librariesKotlinTest(kotlinTest("junit"))
|
||||
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
libraries(kotlinStdlib(classifier = "distJsJar"))
|
||||
libraries(kotlinStdlib(classifier = "distJsKlib"))
|
||||
libraries(project(":kotlin-test:kotlin-test-js-ir", configuration = "jsRuntimeElements"))
|
||||
}
|
||||
|
||||
librariesStripVersion(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
|
||||
@@ -205,8 +203,6 @@ dependencies {
|
||||
sources(project(":kotlin-stdlib", configuration = "distSources"))
|
||||
sources(project(":kotlin-stdlib", configuration = "distJsSourcesJar"))
|
||||
sources(project(":kotlin-reflect", configuration = "sources"))
|
||||
sources(project(":kotlin-test", "combinedJvmSourcesJar"))
|
||||
sources(project(":kotlin-test:kotlin-test-js-ir", configuration = "jsSourcesElements"))
|
||||
|
||||
distStdlibMinimalForTests(project(":kotlin-stdlib-jvm-minimal-for-test"))
|
||||
|
||||
@@ -248,13 +244,21 @@ dependencies {
|
||||
fatJarContentsStripVersions(commonDependency("one.util:streamex")) { isTransitive = false }
|
||||
}
|
||||
|
||||
val librariesKotlinTestFiles = files(
|
||||
listOf(null, "junit", "junit5", "testng", "js").map { suffix ->
|
||||
listOf(null, "sources").map { classifier ->
|
||||
configurations.detachedConfiguration(dependencies.create(kotlinTest(suffix, classifier))).apply { isTransitive = false }
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
publish()
|
||||
|
||||
// sbom for dist
|
||||
val distSbomTask = configureSbom(
|
||||
target = "Dist",
|
||||
documentName = "Kotlin Compiler Distribution",
|
||||
setOf(configurations.runtimeClasspath.name, libraries.name, librariesStripVersion.name, compilerPlugins.name)
|
||||
setOf(configurations.runtimeClasspath.name, libraries.name, librariesKotlinTest.name, librariesStripVersion.name, compilerPlugins.name)
|
||||
)
|
||||
|
||||
val packCompiler by task<Jar> {
|
||||
@@ -397,6 +401,7 @@ val distKotlinc = distTask<Sync>("distKotlinc") {
|
||||
into("lib") {
|
||||
from(jarFiles) { rename { "$compilerBaseName.jar" } }
|
||||
from(librariesFiles)
|
||||
from(librariesKotlinTestFiles)
|
||||
from(librariesStripVersionFiles) {
|
||||
rename {
|
||||
it.replace(Regex("-\\d.*\\.jar\$"), ".jar")
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-compiler</artifactId>
|
||||
@@ -59,7 +58,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlinx</groupId>
|
||||
<artifactId>kotlinx-coroutines-core</artifactId>
|
||||
<artifactId>kotlinx-coroutines-core-jvm</artifactId>
|
||||
<version>1.5.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -74,7 +74,7 @@ fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): An
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun Project.kotlinTest(suffix: String? = null, classifier: String? = null): Any {
|
||||
return if (kotlinBuildProperties.isJpsBuildEnabled) {
|
||||
return if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
kotlinDep(listOfNotNull("test", suffix?.lowercase()).joinToString("-"), bootstrapKotlinVersion, classifier)
|
||||
} else {
|
||||
val elementsType = when (classifier) {
|
||||
|
||||
Reference in New Issue
Block a user