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

Add maven conguration to smithy-build.json #34

Merged
merged 1 commit into from Apr 15, 2022

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Apr 6, 2022

This CR updates SmithyBuildExtensions to use the following smithy-build.json format to allow setting Maven repositories and dependencies.

"maven": {
    "dependencies": ["com.foo.bar:custom-trait:0.0.1"],
    "repositories": [{
        "url": "https://url.to.maven.repo"
    }]
}

Existing smithy-build.json files will map mavenDependency and mavenRepositories arrays to the updated maven configuration. Configuration from the new maven key will be preferred over anything set in the deprecated mavenDependency and mavenRepositories keys.

Deprecation warnings with upgrade instructions are emitted to .smithy.lsp.log when the deprecated keys are encountered in smithy-build.json.

The MavenConfig and MavenRepository classes could eventually be moved to live with the existing SmithyBuildConfig model classes in aws-labs/smithy/smithy-build.

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

@srchase srchase requested a review from a team as a code owner April 6, 2022 15:29
import software.amazon.smithy.utils.SmithyBuilder;
import software.amazon.smithy.utils.ToSmithyBuilder;

public final class SmithyBuildExtensions implements ToSmithyBuilder<SmithyBuildExtensions> {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this an LSP feature and not part of smithy-build?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It definitely could be. My plan was to assure it meets the LSP's needs here before moving this functionality to smithy-build later on.

Copy link
Member

Choose a reason for hiding this comment

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

What API guarantees do we make in this repo? Can we yank this all out when it's moved to smithy-build?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the IDE/Editor client side, there will just be a watcher that detects changes to smithy-build.json and notifies the server of updates to the file. No one should need to use SmithyBuildExtensions directly.

@srchase srchase merged commit ba49b39 into smithy-lang:main Apr 15, 2022
@srchase srchase deleted the smithy-build-maven branch April 15, 2022 19:44
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.

None yet

3 participants