-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: Support more services on Java #504
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
323b919
Quick fixes to name discovery
robin-aws 8018081
Fix a case that needs pascalCase
robin-aws 19a7bdc
Another case
robin-aws 7c53e2a
Avoid typeforListSetOrMapNoEnum for now
robin-aws ea422d1
More correct unCapitalize
robin-aws a04a1bd
Disable Input -> Request rules for now
robin-aws d1548c7
Enable glue and lakeformation in CI on Java
robin-aws b997983
operation + Request/Response instead
robin-aws 9a2107f
Try different solution to list of enums
robin-aws d9c08d2
Fix most unit tests
robin-aws 222e20a
Merge branch 'main-1.x' of github.com:smithy-lang/smithy-dafny into r…
robin-aws f82dfe8
Merge branch 'main-1.x' into robin-aws/support-more-services-on-java
robin-aws dd9f308
Makefile tweak
robin-aws e557380
Filter out operation that uses streaming, typo
robin-aws ec2b23d
Fix dotnet
robin-aws b0ae9f9
Rename Model to model (1/2)
robin-aws 0394f53
Rename Model to model (2/2)
robin-aws 23089b5
Fixes
robin-aws d94e8fd
Formatting
robin-aws 7110728
Fix build file
robin-aws 496df4c
Remove dead code
robin-aws 3819333
Unused imports
robin-aws 3ae96db
Merge branch 'main-1.x' into robin-aws/support-more-services-on-java
robin-aws 0ff9a8d
Removing hooks for AWS service limitations
robin-aws f87f309
Make Native abstract
robin-aws 8a07215
Formatting
robin-aws 1e3d68f
Merge branch 'main-1.x' into robin-aws/support-more-services-on-java
robin-aws 69c149a
Revert "Make Native abstract"
robin-aws a8b7347
Add exception message instead
robin-aws f9ecbd8
Merge branch 'robin-aws/support-more-services-on-java' of github.com:…
robin-aws 6edde6d
Formatting
robin-aws File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
plugins { | ||
id("software.amazon.smithy").version("0.6.0") | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("software.amazon.smithy:smithy-model:1.28.0") | ||
implementation("software.amazon.smithy:smithy-aws-traits:1.28.0") | ||
implementation("software.amazon.smithy:smithy-rules-engine:1.28.0") | ||
|
||
// Must be built and published to the local Maven repo | ||
implementation("software.amazon.smithy.dafny:smithy-dafny-codegen:0.1.0") | ||
} | ||
|
||
tasks.register("polymorphDafny") { | ||
dependsOn("build") | ||
doLast { | ||
// if needed, specify a projection to use instead | ||
// default (no projection) is "source" | ||
val projectionName = "operation-subset" | ||
copy { | ||
from(layout.buildDirectory.dir("smithyprojections/" + project.name + "/" + projectionName + "/dafny-client-codegen/project.properties")) | ||
into(".") | ||
} | ||
copy { | ||
from(layout.buildDirectory.dir("smithyprojections/" + project.name + "/" + projectionName + "/dafny-client-codegen/Model/")) | ||
into("model") | ||
} | ||
exec { | ||
// need to adjust the relative import, since we're copying it away | ||
// the commandLine method does not play nice with sed, | ||
// so we have to execute it through bash :( | ||
commandLine("bash", "-c", "sed '4s|../../../../../../../../dafny-dependencies/StandardLibrary/src/Index.dfy|../../../dafny-dependencies/StandardLibrary/src/Index.dfy|' model/ComAmazonawsLakeformationTypes.dfy > model/tmp && mv model/tmp model/ComAmazonawsLakeformationTypes.dfy") | ||
} | ||
} | ||
} | ||
|
||
tasks.register("polymorphDotnet") { | ||
dependsOn("build") | ||
doLast { | ||
// if needed, specify a projection to use instead | ||
// default (no projection) is "source" | ||
val projectionName = "operation-subset" | ||
copy { | ||
from(layout.buildDirectory.dir("smithyprojections/" + project.name + "/" + projectionName + "/dafny-client-codegen/runtimes/net")) | ||
into("runtimes/net") | ||
} | ||
exec { | ||
// need to adjust the relative import, since we're copying it away | ||
// the commandLine method does not play nice with sed, | ||
// so we have to execute it through bash :( | ||
commandLine("bash", "-c", "sed 's|../../../../../../../../../dafny-dependencies/StandardLibrary/runtimes/net/STD.csproj|../../../../dafny-dependencies/StandardLibrary/runtimes/net/STD.csproj|' runtimes/net/LakeFormation.csproj > runtimes/net/tmp && mv runtimes/net/tmp runtimes/net/LakeFormation.csproj") | ||
} | ||
} | ||
} | ||
|
||
tasks.register("polymorphJava") { | ||
dependsOn("build") | ||
doLast { | ||
// if needed, specify a projection to use instead | ||
// default (no projection) is "source" | ||
val projectionName = "operation-subset" | ||
// We can't just copy runtimes/java over unfortunately, | ||
// because we need a fresher software.amazon.awssdk:kms version | ||
// than what's in the template. | ||
copy { | ||
from(layout.buildDirectory.dir("smithyprojections/" + project.name + "/" + projectionName + "/dafny-client-codegen/runtimes/java")) | ||
into("runtimes/java") | ||
} | ||
} | ||
} | ||
|
||
buildscript { | ||
val smithyVersion: String by project | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
"classpath"("software.amazon.smithy:smithy-cli:$smithyVersion") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
smithyVersion=1.27.2 | ||
smithyGradleVersion=0.6.0 | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": "1.0", | ||
"projections": { | ||
"operation-subset": { | ||
"transforms": [ | ||
{ | ||
"name": "excludeShapesBySelector", | ||
"args": { | ||
"selector": "operation [id|name = GetWorkUnitResults]" | ||
} | ||
}, | ||
{ | ||
"name": "removeUnusedShapes", | ||
"args": {} | ||
} | ||
], | ||
"plugins": { | ||
"dafny-client-codegen": { | ||
"edition": "2023", | ||
"service": "com.amazonaws.lakeformation#AWSLakeFormation", | ||
"dafnyVersion": "${DAFNY_VERSION}", | ||
"targetLanguages": ["dotnet", "java"], | ||
"includeDafnyFile": "../../dafny-dependencies/StandardLibrary/src/Index.dfy" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
If you run
mkdir
against an existing directory, does it succeed?Or does it fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It succeeds -
-p
makes it recursively create all missing directories, so it's perfectly happy if all already existThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice the same thing is already on the
runtimes/java/src/test
directory. I actually don't know how we got away without this fix for so long. :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you did not use to generate the template files,
and we had to manually stub the __default.java files in the Java extern source path.
Thus, we always had a directory.