Ignore compose experimental modules during artifacts check

The check can be improved in the future, so not only parent directory
is checked.
This commit is contained in:
Nikolay Krasko
2023-08-04 18:25:20 +02:00
committed by Space Team
parent 887dc18719
commit a1250e838b
@@ -22,6 +22,16 @@ class ArtifactsTest {
private val localRepoPath = Paths.get(mavenLocal, "org/jetbrains/kotlin")
private val expectedRepoPath = Paths.get("repo/artifacts-tests/src/test/resources/org/jetbrains/kotlin")
/**
* Experimental projects that might be published locally but are not epxected to be published by default.
* They still might be added to TeamCity maven.zip final artifacts with an additional code.
*/
private val experimentalProjects = setOf(
"compiler-hosted",
"compiler-daemon",
"compiler",
)
private val excludedProjects = setOf(
"annotation-processor-example",
"android-test-fixes",
@@ -51,12 +61,16 @@ class ArtifactsTest {
})
actualPoms.forEach { actual ->
val expectedPomPath = actual.toExpectedPath()
if ("${expectedPomPath.parent.fileName}" !in excludedProjects) {
val actualString = actual.toFile().readText().replace(kotlinVersion, "ArtifactsTest.version")
assertEqualsToFile(expectedPomPath, actualString)
visitedPoms.add(expectedPomPath)
} else {
if (isTeamCityBuild) fail("Excluded project in actual artifacts: $actual")
val parentDirName = expectedPomPath.parent.fileName.toString()
if (parentDirName !in experimentalProjects) {
if (parentDirName !in excludedProjects) {
val actualString = actual.toFile().readText().replace(kotlinVersion, "ArtifactsTest.version")
assertEqualsToFile(expectedPomPath, actualString)
visitedPoms.add(expectedPomPath)
} else {
if (isTeamCityBuild) fail("Excluded project in actual artifacts: $actual")
}
}
}