Skip to content

Commit

Permalink
fix: finally fix this whole mess
Browse files Browse the repository at this point in the history
  • Loading branch information
0marperez committed Jan 8, 2025
1 parent 77ec52c commit 9a46dbc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 17 deletions.
37 changes: 20 additions & 17 deletions tests/codegen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@ plugins {
val libraries = libs

subprojects {
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
showStackTraces = true
showExceptions = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}

/*
Don't apply the rest of the configuration to the code generated smoke test services!
Those use the KMP plugin not JVM.
*/
if (project.path.startsWith(":tests:codegen:smoke-tests:services")) return@subprojects

apply(plugin = libraries.plugins.aws.kotlin.repo.tools.smithybuild.get().pluginId)
apply(plugin = libraries.plugins.kotlin.jvm.get().pluginId)

Expand All @@ -32,17 +49,14 @@ subprojects {
}
}

val codegen by configurations
val implementation by configurations
val api by configurations
val testImplementation by configurations
dependencies {
codegen(project(":codegen:aws-sdk-codegen"))
codegen(libraries.smithy.cli)
codegen(libraries.smithy.model)
}

val implementation by configurations
val api by configurations
val testImplementation by configurations
dependencies {
implementation(project(":codegen:aws-sdk-codegen"))
implementation(libraries.smithy.kotlin.codegen)

Expand All @@ -66,15 +80,4 @@ subprojects {
testImplementation(libraries.smithy.kotlin.telemetry.api)
testImplementation(libraries.smithy.kotlin.http.test)
}

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
showStandardStreams = true
showStackTraces = true
showExceptions = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
}
32 changes: 32 additions & 0 deletions tests/codegen/smoke-tests/services/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
alias(libs.plugins.kotlin.multiplatform)
}

val libraries = libs
subprojects {
apply(plugin = libraries.plugins.kotlin.multiplatform.get().pluginId)

val optinAnnotations = listOf(
"aws.smithy.kotlin.runtime.InternalApi",
"aws.sdk.kotlin.runtime.InternalSdkApi",
"kotlin.RequiresOptIn",
)
kotlin.sourceSets.all {
optinAnnotations.forEach { languageSettings.optIn(it) }
}

kotlin {
sourceSets {
commonMain {
kotlin.srcDir("generated-src/main/kotlin")

dependencies {
implementation(libraries.kotlin.test)
}
}
commonTest {
kotlin.srcDir("generated-src/test/kotlin")
}
}
}
}

0 comments on commit 9a46dbc

Please sign in to comment.