Skip to content

Conversation

@lauzadis
Copy link
Member

Issue #

Description of changes

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

@lauzadis lauzadis requested a review from a team as a code owner April 24, 2025 18:55
@lauzadis lauzadis added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Apr 24, 2025
@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

.withProjectDir(testProjectDir)
.withPluginClasspath()
.withGradleVersion("8.5") // TODO parameterize
.withGradleDistribution("https://d2pjps8lqszrgq.cloudfront.net/gradle-8.12.1-bin.zip") // TODO Parameterize Gradle versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Do we need to parameterize the Gradle version or do we really want to match the Gradle version already running? Because our CI updates gradle/wrapper/gradle-wrapper.properties with the distribution URL. It seems like we could reuse that for this runner configuration:

private fun detectGradleWrapperDistro(): URI {
    val propertiesFile = File("../../../gradle/wrapper/gradle-wrapper.properties")

    val properties = propertiesFile
        .readLines()
        .map { it.trim() }
        .filterNot { it.isBlank() || it.startsWith("#") }
        .associate { it.split("=", limit = 2).run { get(0).trim() to getOrNull(1)?.trim() } }

    return URI(requireNotNull(properties["distributionUrl"]))
}

...

runner = GradleRunner
    .create()
    .withProjectDir(testProjectDir)
    .withPluginClasspath()
    .withGradleDistribution(detectGradleWrapperDistro())
    .forwardOutput()
    .withArguments("--info", "build")

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you originally gave me feedback that we should test across multiple Gradle versions to ensure compatibility. I'm not too concerned about that, but I think synchronizing with gradle-wrapper.properties would be good

Copy link
Member Author

Choose a reason for hiding this comment

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

Nevermind, you gave the same feedback back then that you just did now 😆
#1385 (comment)

I'll try to update this to pull the version from gradle-wrapper.properties

Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if we don't use withGradleVersion or withGradleDistribution. According to the Gradle runner docs:

By default, the runner will attempt to find a Gradle distribution based on where the GradleRunner class was loaded from

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice suggestion, it seems to work locally, let's try it in CI...

@sonarqubecloud
Copy link

@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@github-actions
Copy link

Affected Artifacts

No artifacts changed size

@lauzadis lauzadis merged commit f65b997 into main Apr 25, 2025
20 checks passed
@lauzadis lauzadis deleted the fix-gradle-dynamodbmapper branch April 25, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants