77[ ![ Kotlin release] [ kt_img ]] [ kt_url ]
88
99Gradle project and settings [ plugins] ( https://docs.gradle.org/current/samples/sample_convention_plugins.html ) to
10- simplify the bootstrapping of ` Kotlin/Java ` projects targeting JVM, Multiplatform (Native/JS/Wasm), and GraalVM
10+ simplify the bootstrapping of ` Kotlin/Java ` projects targeting JVM, Multiplatform (Native/JS/Wasm/Wasi ), and GraalVM
1111native-image. The plugin will take care of configuring most common build tasks, including:
1212
1313* ` Maven Central ` & ` GHCR ` publishing for artifacts & Container image (` Jib ` )
14- * Code coverage supporting JVM, Kotlin Multiplatform projects
15- * Project Versioning (` SemVer ` ) based on Git tags
14+ * Code coverage supporting ` JVM ` , ` Kotlin Multiplatform ` projects
15+ * Project Versioning (` SemVer ` ) based on ` Git tags `
1616* Code Formatting to enforce a consistent code style
1717* Artifact Signing
1818* Java/Kotlin Toolchains configuration
19- * Target platforms (` JVM ` , ` JS ` , ` WASM ` , ` Native ` ) configuration
19+ * Target platforms (` JVM ` , ` JS ` , ` WASM ` , ` WASI ` , ` Native ` ) configuration
2020* Testing & Reports
2121* ` KSP ` & Annotation processors
22- * GraalVM Native Image
22+ * ` GraalVM Native ` Image
2323* Documentation (` JavaDoc ` , ` Dokka ` )
2424* Benchmarking (` JMH ` )
2525* API binary compatibility validation
@@ -59,7 +59,7 @@ Kotlin/Java projects, handling the boilerplate and common tasks so you can get s
5959> For a better, faster experience, use the latest version of [ IntelliJ IDEA] ( https://www.jetbrains.com/idea/download ) .
6060> Upgrade now!
6161
62- ### Build & Testing
62+ ## Build & Testing
6363
6464 ``` bash
6565 $ ./gradlew build
@@ -77,7 +77,7 @@ For testing, a separate [sandbox project](/sandbox) is available with the plugin
7777 $ ./gradlew -p sandbox :dependencyUpdates --no-configuration-cache
7878 ```
7979
80- ### Publishing
80+ ## Publishing
8181
8282Push a new tag to trigger the release workflow and publish the plugin
8383to [ maven central] ( https://repo1.maven.org/maven2/dev/suresh/build/ ) . That's it 🎉.
@@ -91,9 +91,13 @@ The next version will be based on the semantic version scope (`major`, `minor`,
9191
9292 # Print the new version
9393 # ./gradlew printSemver "-Psemver.scope=patch"
94+
95+ # For a specific version
96+ # git tag -am "v1.2.3 release" v1.2.3
97+ # git push origin --tags
9498 ```
9599
96- ### Published Plugins
100+ ## Published Plugins
97101
98102| ** Gradle Plugin ID** | ** Version** |
99103| --------------------------------------| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -108,7 +112,65 @@ The next version will be based on the semantic version scope (`major`, `minor`,
108112| ` dev.suresh.plugin.repos ` | [ ![ ] ( https://img.shields.io/maven-central/v/dev.suresh.plugin.repos/dev.suresh.plugin.repos.gradle.plugin?logo=gradle&logoColor=white&color=00B4E6 )] [ plugins_url ] |
109113| ` dev.suresh.plugin.catalog ` | [ ![ ] ( https://img.shields.io/maven-central/v/dev.suresh.plugin.catalog/dev.suresh.plugin.catalog.gradle.plugin?logo=gradle&logoColor=white&color=00B4E6 )] [ plugins_url ] |
110114
111- ### Verifying Artifacts
115+ ## How to use it?
116+
117+ - Apply the following config to ` settings.gradle.kts ` of your project
118+
119+ ``` kotlin
120+ pluginManagement {
121+ resolutionStrategy {
122+ eachPlugin {
123+ if (requested.id.id.startsWith(" dev.suresh.plugin" )) {
124+ useVersion(" <plugin version>" )
125+ }
126+ }
127+ }
128+
129+ repositories {
130+ gradlePluginPortal()
131+ mavenCentral()
132+ }
133+ }
134+
135+ plugins { id(" dev.suresh.plugin.repos" ) }
136+ ```
137+
138+ - Apply the required plugins to ` root ` or ` sub ` project ` build.gradle.kts `
139+
140+ ``` kotlin
141+ // Kotlin JVM
142+ plugins {
143+ id(" dev.suresh.plugin.root" )
144+ id(" dev.suresh.plugin.kotlin.jvm" )
145+ id(" dev.suresh.plugin.publishing" )
146+ // id("dev.suresh.plugin.graalvm")
147+ application
148+ }
149+
150+ // Kotlin Multiplatform
151+ plugins {
152+ id(" dev.suresh.plugin.root" )
153+ id(" dev.suresh.plugin.kotlin.mpp" )
154+ id(" dev.suresh.plugin.publishing" )
155+ application
156+ }
157+
158+ kotlin {
159+ jvmTarget(project)
160+ jsTarget(project)
161+ wasmJsTarget(project)
162+ wasmWasiTarget(project)
163+ nativeTargets(project) {}
164+ }
165+ ```
166+
167+ - Use the version catalog by copying [ gradle/libs.versions.toml] ( gradle/libs.versions.toml ) and change the
168+ project-related metadata like ` group ` , ` app-mainclass ` etc.
169+
170+ > [ !IMPORTANT]
171+ > ** Don't change** the existing version names in the catalog as it's being referenced in the plugins.
172+
173+ ## Verifying Artifacts
112174
113175The published artifacts are signed using this [ key] [ signing_key ] . The best way to verify artifacts
114176is [ automatically with Gradle] [ gradle_verification ] .
@@ -146,7 +208,7 @@ is [automatically with Gradle][gradle_verification].
146208
147209</details >
148210
149- ### References
211+ ## References
150212
151213- [ Kotlin DSL Plugin] ( https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin )
152214- [ Pre-compiled Script Plugins] ( https://docs.gradle.org/current/userguide/implementing_gradle_plugins_precompiled.html#sec:applying_external_plugins )
0 commit comments