[Gradle] Check that *sourcesElements is not exposed withSourcesJar(publish=false)
^KT-57652 In Progress
This commit is contained in:
committed by
Space Team
parent
39d466b695
commit
1833347a7d
+12
@@ -201,6 +201,18 @@ class MppPublicationTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test that no sourcesElements should be exposed when sources are not published`() {
|
||||||
|
kotlin.linuxX64("linux")
|
||||||
|
kotlin.withSourcesJar(publish = false)
|
||||||
|
|
||||||
|
project.evaluate()
|
||||||
|
kotlin.targets.forEach {
|
||||||
|
if (it.sourcesElementsConfigurationName in project.configurations.names)
|
||||||
|
fail("Configuration '${it.sourcesElementsConfigurationName}' should not be created")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun SoftwareComponent.attributesOfUsageContext(usageContextName: String): AttributeContainer {
|
private fun SoftwareComponent.attributesOfUsageContext(usageContextName: String): AttributeContainer {
|
||||||
this as SoftwareComponentInternal
|
this as SoftwareComponentInternal
|
||||||
return usages.first { it.name == usageContextName }.attributes
|
return usages.first { it.name == usageContextName }.attributes
|
||||||
|
|||||||
Reference in New Issue
Block a user