Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ internal val ALLOWED_KOTLIN_NATIVE_PUBLICATION_NAMES = setOf(
// Group names which are allowed to publish K/N artifacts
private val ALLOWED_KOTLIN_NATIVE_GROUP_NAMES = setOf(
"aws.sdk.kotlin.crt",
"aws.smithy.kotlin",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to allow software.amazon.smithy.kotlin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, codegen is JVM-only

)

// Optional override to the above set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PublishTest {
}

@Test
fun `smithy-kotlin cannot publish Kotlin Native artifacts`() = runTest {
fun `smithy-kotlin can publish Kotlin Native artifacts`() = runTest {
val project = ProjectBuilder.builder().withName("aws-smithy-kotlin").build()
project.group = "aws.smithy.kotlin"
project.version = "1.2.3"
Expand All @@ -99,25 +99,25 @@ class PublishTest {
version = "1.2.3"
artifactId = "runtime"
}
assertFalse(isAvailableForPublication(project, nativeRuntimePublication))
assertTrue(isAvailableForPublication(project, nativeRuntimePublication))
}
}
}

@Test
fun `users can override smithy-kotlin publication`() = runTest {
val project = ProjectBuilder.builder().withName("aws-smithy-kotlin").build()
project.group = "aws.smithy.kotlin"
project.group = "aws.sdk.kotlin"
project.version = "1.2.3"
project.extra.set(OVERRIDE_KOTLIN_NATIVE_GROUP_NAME_VALIDATION, "true")

project.configurePublishing("smithy-kotlin", "smithy-lang")
project.configurePublishing("aws-sdk-kotlin", "aws")

val publishing = project.extensions.getByType(PublishingExtension::class.java)
publishing.publications {
ALLOWED_PUBLICATION_NAMES.forEach {
val jvmRuntimePublication = create(it, MavenPublication::class.java).apply {
groupId = "aws.smithy.kotlin"
groupId = "aws.sdk.kotlin"
version = "1.2.3"
artifactId = "runtime"
}
Expand All @@ -126,7 +126,7 @@ class PublishTest {

ALLOWED_KOTLIN_NATIVE_PUBLICATION_NAMES.forEach {
val nativeRuntimePublication = create(it, MavenPublication::class.java).apply {
groupId = "aws.smithy.kotlin"
groupId = "aws.sdk.kotlin"
version = "1.2.3"
artifactId = "runtime"
}
Expand All @@ -138,17 +138,17 @@ class PublishTest {
@Test
fun `override only works when set to true`() = runTest {
val project = ProjectBuilder.builder().withName("aws-smithy-kotlin").build()
project.group = "aws.smithy.kotlin"
project.group = "aws.sdk.kotlin"
project.version = "1.2.3"
project.extra.set(OVERRIDE_KOTLIN_NATIVE_GROUP_NAME_VALIDATION, "this is not true")

project.configurePublishing("smithy-kotlin", "smithy-lang")
project.configurePublishing("aws-sdk-kotlin", "aws")

val publishing = project.extensions.getByType(PublishingExtension::class.java)
publishing.publications {
ALLOWED_PUBLICATION_NAMES.forEach {
val jvmRuntimePublication = create(it, MavenPublication::class.java).apply {
groupId = "aws.smithy.kotlin"
groupId = "aws.sdk.kotlin"
version = "1.2.3"
artifactId = "runtime"
}
Expand All @@ -157,7 +157,7 @@ class PublishTest {

ALLOWED_KOTLIN_NATIVE_PUBLICATION_NAMES.forEach {
val nativeRuntimePublication = create(it, MavenPublication::class.java).apply {
groupId = "aws.smithy.kotlin"
groupId = "aws.sdk.kotlin"
version = "1.2.3"
artifactId = "runtime"
}
Expand Down
Loading