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

"Generating a client" instructions outdated? #454

Closed
glb opened this issue Oct 16, 2021 · 1 comment · Fixed by #501
Closed

"Generating a client" instructions outdated? #454

glb opened this issue Oct 16, 2021 · 1 comment · Fixed by #501

Comments

@glb
Copy link
Contributor

glb commented Oct 16, 2021

I followed the instructions in the README for generating a client; as instructed I have a build.gradle.kts, a smithy-build.json, and a model folder with the model file in it.

I get the following error when I run gradle build:

Failed build output
foo-client % gradle build
Starting a Gradle Daemon (subsequent builds will be faster)
(assuming Smithy CLI version 0.9.7)
> Task :smithyBuildJar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':smithyBuildJar'.
> Could not resolve all files for configuration ':smithyCli'.
   > Cannot resolve external dependency software.amazon.smithy:smithy-typescript-codegen:0.1.0 because no repositories are defined.
     Required by:
         project :
   > Cannot resolve external dependency software.amazon.smithy:smithy-cli:0.9.7 because no repositories are defined.
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
1 actionable task: 1 executed

Expected output:

Successful build output
foo-client-3 % gradle build                          
(detected Smithy CLI version 1.12.0)
Building Smithy model sources: [/.../foo-client/model]
Loading Smithy configs: [/.../foo-client/smithy-build.json]
Validation result: 0 ERROR(s), 0 DANGER(s), 0 WARNING(s), 0 NOTE(s)
Validated 370 shapes in model
Completed projection source (370 shapes): /.../foo-client/build/smithyprojections/foo-client/source
Smithy built 1 projection(s), 4 plugin(s), and 20 artifacts

> Task :smithyBuildJar
Running smithy build
Validating Smithy model sources: []
Validation result: 0 ERROR(s), 0 DANGER(s), 0 WARNING(s), 0 NOTE(s)
Validated 370 shapes in model
Smithy validation complete

> Task :smithyValidate
Running smithy validate

BUILD SUCCESSFUL in 1s
4 actionable tasks: 4 executed

The build is successful if I update the build.gradle.kts file:

diff
--- a/foo-client/build.gradle.kts
+++ b/foo-client/build.gradle.kts
@@ -1,7 +1,18 @@
 plugins {
-    id("software.amazon.smithy").version("0.4.3")
+    id("software.amazon.smithy").version("0.5.3")
+}
+
+repositories {
+    mavenLocal()
+    mavenCentral()
 }
 
 dependencies {
-    implementation("software.amazon.smithy:smithy-typescript-codegen:0.1.0")
+    implementation("software.amazon.smithy.typescript:smithy-typescript-codegen:0.6.0")
+
+    implementation("software.amazon.smithy:smithy-model:1.12.0")
+
+    // These are just examples of dependencies. This model has a dependency on
+    // a "common" model package and uses the external AWS traits.
+    implementation("software.amazon.smithy:smithy-aws-traits:1.12.0")
 }

I'm not sure what else might need to be changed, but this seems like a start.

Would you be open to a PR that updates the README?

@JordonPhillips
Copy link
Contributor

Absolutely! Yeah we wrote that when we first started the project and just haven't kept it very up to date. We should add a task to update it whenever we do a release

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 a pull request may close this issue.

2 participants