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

Converting existing gradle DSL from groovy to kotlin. #2453

Merged
merged 2 commits into from
Nov 15, 2024

Conversation

yasmewad
Copy link
Contributor

@yasmewad yasmewad commented Nov 12, 2024

Why is this needed ?
This is the first step in moving to a more consistent and composable experience for gradle configuration in the smithy repository. Writing it in kotlin to make it more expressive as compared to groovy. This commit just converts the existing gradle build from groovy to kotlin.

Next steps:
Once this change is merged, few other PRs will follow to introduce nice features such as buildSrc plugins to enhance configurability of how each sub project builds in this package. It will introduce flexibility in things such as allowing each subproject to compile with different JVM toolchain, and much more.

Testing

  • gradle clean && gradle build.
  • Any more testing?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yasmewad yasmewad requested a review from a team as a code owner November 12, 2024 19:21
@yasmewad yasmewad marked this pull request as draft November 12, 2024 19:22
Comment on lines +8 to +11
plugins {
val smithyGradleVersion : String by settings
id("software.amazon.smithy.gradle.smithy-jar") version smithyGradleVersion
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously we would pin the version in specific subprojects' build.gradle.kts like this:

plugins {
     id("software.amazon.smithy.gradle.smithy-jar") version smithyGradleVersion
}
		

However I found that the correct way to do version pinning for dependencies from gradle.properties is this.

This is also temporary while we move to the versions.toml approach like other projects and buildSrc based plugins in future PRs.

References:

@yasmewad yasmewad marked this pull request as ready for review November 12, 2024 21:38
smithy-aws-apigateway-traits/build.gradle.kts Outdated Show resolved Hide resolved
smithy-model/build.gradle.kts Outdated Show resolved Hide resolved
smithy-protocol-tests/build.gradle.kts Outdated Show resolved Hide resolved
smithy-syntax/build.gradle.kts Outdated Show resolved Hide resolved
smithy-trait-codegen/build.gradle.kts Outdated Show resolved Hide resolved
smithy-trait-codegen/build.gradle.kts Outdated Show resolved Hide resolved
smithy-trait-codegen/build.gradle.kts Outdated Show resolved Hide resolved
smithy-validation-model/build.gradle.kts Show resolved Hide resolved
build.gradle.kts Show resolved Hide resolved
settings.gradle.kts Outdated Show resolved Hide resolved
@JordonPhillips
Copy link
Contributor

We deliberately switched to groovy from kotlin, though I don't remember the context on why. @kstich did it iirc and he might remember.

** Why is this needed ? **
This is the first step in moving to a more consistent and composable experience for gradle configuration in the smithy repository. Writing it in kotlin to make it more expressive as compared to groovy. This commit just converts the existing gradle build from groovy to kotlin.

** Next steps: **
Once this change is merged, few other PRs will follow to introduce nice features such as `buildSrc` plugins to enhance configurability of how each sub project builds in this package. It will introduce flexibility in things such as allowing each subproject to compile with different JVM toolchain, and much more.
@yasmewad yasmewad merged commit 449da56 into smithy-lang:main Nov 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants