Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: upstream plugin changes #1195

Merged
merged 3 commits into from
Feb 5, 2024
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
2 changes: 1 addition & 1 deletion aws-runtime/aws-config/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir
import org.jetbrains.dokka.gradle.DokkaTaskPartial

plugins {
id("aws.sdk.kotlin.gradle.smithybuild")
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
}

description = "Support for AWS configuration"
Expand Down
2 changes: 2 additions & 0 deletions aws-runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ description = "AWS client runtime support for generated service clients"
plugins {
alias(libs.plugins.dokka)
alias(libs.plugins.kotlinx.binary.compatibility.validator)
alias(libs.plugins.aws.kotlin.repo.tools.kmp) apply false
jacoco
}

Expand All @@ -28,6 +29,7 @@ subprojects {
apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("org.jetbrains.dokka")
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
}

configurePublishing("aws-sdk-kotlin")
Expand Down
13 changes: 2 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,14 @@ buildscript {
// only need to add e.g. atomic-fu and build-plugins here for imports and plugins to be available in subprojects.
dependencies {
classpath(libs.kotlinx.atomicfu.plugin)

// FIXME - we need the ClassLoader used for Model and any traits to be the same. Unfortunately our
// build plugin has a transitive dependency on `smithy-model` which means our :codegen:sdk project
// that uses both in it's build logic won't work correctly. We "fix" this by placing them both
// into the root buildscript classpath and force them to share a class loader.
classpath(libs.smithy.model)
classpath(libs.smithy.aws.traits)
// Add our custom gradle build logic to buildscript classpath
classpath(libs.aws.kotlin.repo.tools.build.support)
}
}

plugins {
alias(libs.plugins.dokka)
// configures (KMP) subprojects with our own KMP conventions and some default dependencies
alias(libs.plugins.aws.kotlin.repo.tools.kmp)

// ensure the correct version of KGP ends up on our buildscript classpath
// since build-plugins also has <some> version in its dependency closure
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.jvm) apply false
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/protocol-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionPath
import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir

plugins {
kotlin("jvm") // FIXME - configuration doesn't resolve without this
id("aws.sdk.kotlin.gradle.smithybuild")
kotlin("jvm")
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Does the FIXME still apply?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it because there isn't really anything to fix. It was a placeholder but everything works as intended so I don't see the value in keeping it if it's not actionable.

alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
}

description = "Smithy protocol test suite"
Expand Down
4 changes: 2 additions & 2 deletions codegen/sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.*
import kotlin.streams.toList

plugins {
kotlin("jvm") // FIXME - codegen configuration doesn't resolve without this
id("aws.sdk.kotlin.gradle.smithybuild")
kotlin("jvm")
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
id("sdk-bootstrap")
}

Expand Down
9 changes: 4 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
kotlin-version = "1.9.21"
dokka-version = "1.9.10"

aws-kotlin-repo-tools-version = "0.3.2"
aws-kotlin-repo-tools-version = "0.4.0"

# libs
coroutines-version = "1.7.3"
Expand All @@ -14,7 +14,6 @@ smithy-kotlin-codegen-version = "0.30.12"

# codegen
smithy-version = "1.42.0"
smithy-gradle-version = "0.7.0"

# testing
junit-version = "5.10.1"
Expand All @@ -26,6 +25,8 @@ slf4j-version = "2.0.9"


[libraries]
aws-kotlin-repo-tools-build-support = { module="aws.sdk.kotlin.gradle:build-support", version.ref = "aws-kotlin-repo-tools-version" }

kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-version"}
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin-version"}
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-version" }
Expand Down Expand Up @@ -91,7 +92,6 @@ smithy-aws-iam-traits = { module = "software.amazon.smithy:smithy-aws-iam-traits
smithy-aws-cloudformation-traits = { module = "software.amazon.smithy:smithy-aws-cloudformation-traits", version.ref = "smithy-version" }
smithy-model = { module = "software.amazon.smithy:smithy-model", version.ref = "smithy-version" }
smithy-protocol-test-traits = { module = "software.amazon.smithy:smithy-protocol-test-traits", version.ref = "smithy-version" }
smithy-gradle-plugin = { module = "software.amazon.smithy:smithy-gradle-plugin", version.ref = "smithy-gradle-version" }
smithy-smoke-test-traits = { module = "software.amazon.smithy:smithy-smoke-test-traits", version.ref = "smithy-version" }

junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-version" }
Expand Down Expand Up @@ -131,6 +131,5 @@ kotlin-multiplatform = {id = "org.jetbrains.kotlin.multiplatform", version.ref =
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark-version" }
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version"}
smithy-gradle = { id = "software.amazon.smithy", version.ref = "smithy-gradle-version" }
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.kmp", version.ref = "aws-kotlin-repo-tools-version" }
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
aws-kotlin-repo-tools-smithybuild = { id = "aws.sdk.kotlin.gradle.smithybuild", version.ref = "aws-kotlin-repo-tools-version" }
2 changes: 2 additions & 0 deletions services/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import java.time.LocalDateTime
plugins {
`maven-publish`
alias(libs.plugins.dokka)
alias(libs.plugins.aws.kotlin.repo.tools.kmp) apply false
}

val sdkVersion: String by project
Expand All @@ -31,6 +32,7 @@ subprojects {
apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("org.jetbrains.dokka")
plugin(libraries.plugins.aws.kotlin.repo.tools.kmp.get().pluginId)
}

logger.info("configuring: $project")
Expand Down
1 change: 1 addition & 0 deletions tests/benchmarks/service-benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import aws.sdk.kotlin.gradle.dsl.skipPublishing

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.aws.kotlin.repo.tools.kmp)
application
}

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/event-stream/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import aws.sdk.kotlin.gradle.codegen.smithyKotlinProjectionSrcDir

plugins {
alias(libs.plugins.kotlin.jvm)
id("aws.sdk.kotlin.gradle.smithybuild")
alias(libs.plugins.aws.kotlin.repo.tools.smithybuild)
}

description = "Event stream codegen integration test suite"
Expand Down
Loading