[Gradle, Test] Test that sourcesJar is available during configuration
^KT-55230
This commit is contained in:
committed by
Space Team
parent
5477e2073f
commit
290e50eebf
+19
-4
@@ -18,10 +18,7 @@ import org.gradle.api.publish.PublishingExtension
|
||||
import org.gradle.api.publish.maven.MavenPublication
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
import kotlin.test.fail
|
||||
import kotlin.test.*
|
||||
|
||||
class MppPublicationTest {
|
||||
|
||||
@@ -129,6 +126,24 @@ class MppPublicationTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
fun `sourcesJar task should be available during configuration time`() {
|
||||
kotlin.linuxX64("linux")
|
||||
|
||||
val sourcesJars = listOf(
|
||||
"sourcesJar", // sources of common source sets i.e. root module
|
||||
"jvmSourcesJar",
|
||||
"jsSourcesJar",
|
||||
"linuxSourcesJar"
|
||||
)
|
||||
|
||||
for (sourcesJarTaskName in sourcesJars) {
|
||||
val sourcesJar = project.tasks.findByName(sourcesJarTaskName)
|
||||
assertNotNull(sourcesJar, "Task '$sourcesJarTaskName' should exist during project configuration time")
|
||||
}
|
||||
}
|
||||
|
||||
private fun SoftwareComponent.attributesOfUsageContext(usageContextName: String): AttributeContainer {
|
||||
this as SoftwareComponentInternal
|
||||
return usages.first { it.name == usageContextName }.attributes
|
||||
|
||||
Reference in New Issue
Block a user