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

fix: correctly default compositeProjects build setting #1107

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

ianbotsf
Copy link
Contributor

@ianbotsf ianbotsf commented Nov 7, 2023

Issue #

(none)

Description of changes

Our settings.gradle.kts build logic for composite projects doesn't correctly handle the situation where a local.properties file exists but does not contain a compositeProjects key. This change now handles that case by defaulting to ../smithy-kotlin.

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

@ianbotsf ianbotsf added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label Nov 7, 2023
@ianbotsf ianbotsf requested a review from a team as a code owner November 7, 2023 19:05
Copy link

sonarqubecloud bot commented Nov 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

?.map { file(it) } // Create file from path
?.toList()
?: emptyList()
val propertyVal = localProperties.getProperty("compositeProjects") ?: "../smithy-kotlin"
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to throw an exception if there is no compositeProjects property (such as with checkNotNull { ... }) so it can fallback to the catch (e: Throwable) logic on L96? It would remove the (small) duplication

Copy link
Contributor

Choose a reason for hiding this comment

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

local.properties is heavily used for Android development so it's entirely reasonable that the file may not have this key.

Copy link
Member

Choose a reason for hiding this comment

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

if it's missing, that's fine, it will still default to ../smithy-kotlin, just in a different way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, shipped as soon as I saw approvals but before I saw comments. Yes, it would've probably been better to clean up the duplication.

Copy link

github-actions bot commented Nov 7, 2023

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK

@ianbotsf ianbotsf merged commit 3c4a599 into main Nov 7, 2023
17 of 18 checks passed
@ianbotsf ianbotsf deleted the fix-composite-build-default branch November 7, 2023 20: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