[kotlin-test] kpsm.json patching KT-61969

Adds source set relationships for additional variants
and also slightly stretches common source sets included into jvm variant
This commit is contained in:
Ilya Gorbunov
2023-11-24 04:51:53 +01:00
committed by Space Team
parent 5c4f0a70e0
commit 446cd1eec9
3 changed files with 271 additions and 0 deletions
+27
View File
@@ -269,6 +269,33 @@ tasks {
val allTests by existing {
dependsOn(jvmTestTasks)
}
val generateProjectStructureMetadata by existing {
val outputFile = file("build/kotlinProjectStructureMetadata/kotlin-project-structure-metadata.json")
val outputTestFile = file("kotlin-project-structure-metadata.beforePatch.json")
val patchedFile = file("kotlin-project-structure-metadata.json")
inputs.file(patchedFile)
inputs.file(outputTestFile)
doLast {
/*
Check that the generated 'outputFile' by default matches our expectations stored in the .beforePatch file
This will fail if the kotlin-project-structure-metadata.json file would change unnoticed (w/o updating our patched file)
*/
run {
val outputFileText = outputFile.readText().trim()
val expectedFileContent = outputTestFile.readText().trim()
if (outputFileText != expectedFileContent)
error(
"${outputFile.path} file content does not match expected content\n\n" +
"expected:\n\n$expectedFileContent\n\nactual:\n\n$outputFileText"
)
}
patchedFile.copyTo(outputFile, overwrite = true)
}
}
}
configurations {
@@ -0,0 +1,96 @@
{
"projectStructure": {
"formatVersion": "0.3.3",
"isPublishedAsRoot": "true",
"variants": [
{
"name": "jsApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jsRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jvmApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain"
]
},
{
"name": "jvmRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain"
]
},
{
"name": "wasmJsApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmJsRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmWasiApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmWasiRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
}
],
"sourceSets": [
{
"name": "annotationsCommonMain",
"dependsOn": [
"commonMain"
],
"moduleDependency": [],
"binaryLayout": "klib"
},
{
"name": "assertionsCommonMain",
"dependsOn": [
"commonMain"
],
"moduleDependency": [],
"binaryLayout": "klib"
},
{
"name": "commonMain",
"dependsOn": [],
"moduleDependency": [
"org.jetbrains.kotlin:kotlin-stdlib"
],
"binaryLayout": "klib"
}
]
}
}
@@ -0,0 +1,148 @@
{
"projectStructure": {
"formatVersion": "0.3.3",
"isPublishedAsRoot": "true",
"variants": [
{
"name": "jsApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jsRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jvmApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jvmRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "jvmJUnitApiElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "jvmJUnitRuntimeElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "jvmJUnit5ApiElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "jvmJUnit5RuntimeElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "jvmTestNGApiElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "jvmTestNGRuntimeElements",
"sourceSet": [
"annotationsCommonMain",
"commonMain"
]
},
{
"name": "nativeApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmJsApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmJsRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmWasiApiElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
},
{
"name": "wasmWasiRuntimeElements",
"sourceSet": [
"assertionsCommonMain",
"commonMain",
"annotationsCommonMain"
]
}
],
"sourceSets": [
{
"name": "annotationsCommonMain",
"dependsOn": [
"commonMain"
],
"moduleDependency": [],
"binaryLayout": "klib"
},
{
"name": "assertionsCommonMain",
"dependsOn": [
"commonMain"
],
"moduleDependency": [],
"binaryLayout": "klib"
},
{
"name": "commonMain",
"dependsOn": [],
"moduleDependency": [
"org.jetbrains.kotlin:kotlin-stdlib"
],
"binaryLayout": "klib"
}
]
}
}