Java component template using Gradle, the Gradle Kotlin DSL, and the Gradle wrapper #17
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.
NOTE: This template will not work until Gradle Kotlin DSL support and Gradle wrapper support are added into GDK
Description of changes:
This adds a template that uses Gradle, the Gradle Kotlin DSL, and the Gradle wrapper
Why is this change necessary:
I have a lot of code that uses the Gradle Kotlin DSL and the Gradle wrapper and I'd like to use it with GDK
How was this change tested:
I published my own simple Hello World component with it
Any additional information or context required to review the change:
This build script adds a little extra intelligence when building and publishing to let the user know where to go to find information about the values they need to set. I do think it's useful but I could see it being removed if we want a more minimal script.
When executing
./gradlew buildthis code will correctly set the component version number by reading it from thegdk-config.jsonso it doesn't need to be in the gdk configuration and the build script. If the version is set toNEXT_PATCHthe JAR will use1.0.0as the version number so gdk can find it.When executing
./gradlew publishthis code will also run the build task so the user doesn't need to do./gradlew buildorgdk component buildand thengdk component publish. They still have the option of publishing without building by usinggdk component publishdirectly. But generally in my development process I want to do both at the same time.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.