-
Notifications
You must be signed in to change notification settings - Fork 286
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
build(api-client): generate java, go clients #2973
build(api-client): generate java, go clients #2973
Conversation
f31112a
to
34fbee2
Compare
Primary Changes --------------- 1. Updated package.json of packages to include the new codegen scripts 2. Added a new workflow to create and upload the jars from the newly added code Changes required to incorporate 1) --------------------------------- 3. Added replace package to assist the codegen scripts written in package.json Fixes hyperledger-cacti#393 Signed-off-by: jagpreetsinghsasan <[email protected]> Signed-off-by: Peter Somogyvari <[email protected]>
34fbee2
to
f0af659
Compare
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.
@jagpreetsinghsasan Thank you for this! In general, LGTM.
Any reason why we can't use the kotlin based templates (I can imagine many, but we should documetn the decision and the reasons for it in the commit message)
P.S.: The custom-checks were broken because the package.json files became unsorted, I remedied the situation and did a force push to your branch. Please make sure not to accidentally erase those changes!
Here we are generating the java client code and their corresponding artifacts, so
Everything seems fine after your force push, compiling correctly, so no issues there. |
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.
Sorry, I forgot about this PR and introduced more connector packages in the meantime :( Could you please generate the new client for them as well?
- https://github.com/hyperledger/cacti/tree/main/packages/cactus-plugin-ledger-connector-aries
- https://github.com/hyperledger/cacti/tree/main/packages/cactus-plugin-ledger-connector-cdl
Everything else looks great, thank you very much!
@jagpreetsinghsasan I'd say we transpile from the JSON spec to the target language (of our choice) directly in each case (be that java or kotlin). |
@jagpreetsinghsasan This works for me on the main branch, so maybe these issues are only happening for the yarn install
yarn configure
yarn codegen
cd packages/cactus-cmd-api-server/src/main/kotlin/generated/openapi/kotlin-client $ gradle build
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
BUILD SUCCESSFUL in 21s
3 actionable tasks: 3 executed $ gradle jar
BUILD SUCCESSFUL in 496ms
3 actionable tasks: 3 up-to-date $ ls -alt build/libs/kotlin-client-1.0.0.jar
-rw-r--r-- 1 peter peter 74501 Jan 31 17:33 build/libs/kotlin-client-1.0.0.jar |
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.
@jagpreetsinghsasan ^^ Please see my comments above and pass it back for review as applicable!
@petermetz I would prefer not to generate jars from kotlin (for the java code), because generating the jar artifact is sort of a confirmation that the generated code is correct. |
@jagpreetsingsasan Yeah my point is to do kotlin everywhere. That's why I said |
We are already generating kotlin code sepearetly with |
@jagpreetsinghsasan Yeah that's what I'd do. The kotlin code can be used to produce the JVM .jar files anyway so we don't need the java generated code IMO at all. |
Closing this PR. Will create a new one |
Commit to be reviewed
build(api-client): generate java, go clients
Fixes #393
Pull Request Requirements
upstream/main
branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.-s
flag when usinggit commit
command. You may refer to this link for more information.Character Limit
A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.