Skip to content

Commit a5fc827

Browse files
committed
fix: javaVersion convention, no implicit idea-ext, debug fails if Java version is lower
1 parent 7252c9a commit a5fc827

13 files changed

Lines changed: 99 additions & 68 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ An intelligent Gradle plugin for developing plugins for Spigot, BungeeCord, and
2424

2525
```groovy
2626
plugins {
27-
id 'io.typst.spigradle' version '3.7.1'
27+
id 'io.typst.spigradle' version '3.7.2'
2828
}
2929
3030
repositories {
@@ -158,7 +158,7 @@ spigot {
158158

159159
For a contributor, internal usage:
160160

161-
- **Implementation**: [`SubclassDetection`](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-subclass-detection/index.html) task
161+
- **Implementation**: [`SubclassDetection`](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-subclass-detection/index.html) task
162162
- **Detection framework**: `io.typst.spigradle.detection` package
163163
- `ClassDefinition` - Represents class metadata
164164
- `DetectionContext` - Manages detection state and class graph
@@ -235,7 +235,7 @@ Spigradle provides shortcuts for common Minecraft plugin dependencies. Each shor
235235
| bukkit() | org.bukkit:bukkit:$version | 1.21.8-R0.1-SNAPSHOT | mavenLocal(), BuildTools |
236236
| craftbukkit() | org.bukkit:craftbukkit:$version | 1.21.8-R0.1-SNAPSHOT | mavenLocal(), BuildTools |
237237
| lombok() | org.projectlombok:lombok:$version | 1.18.38 | mavenCentral() |
238-
| spigradle() | io.typst:spigradle:$version | 3.7.1 | mavenCentral() |
238+
| spigradle() | io.typst:spigradle:$version | 3.7.2 | mavenCentral() |
239239
| protocolLib() | com.comphenix.protocol:ProtocolLib:$version | 5.3.0 | protocolLib() |
240240
| vault() | com.github.MilkBowl:VaultAPI:$version | 1.7 | jitpack() |
241241
| vaultAll() | com.github.MilkBowl:Vault:$version | 1.7.3 | jitpack() |

docs/bungeecord_plugin.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ Groovy DSL
4848

4949
```groovy
5050
plugins {
51-
id 'io.typst.spigradle.bungee' version '3.7.1'
51+
id 'io.typst.spigradle.bungee' version '3.7.2'
5252
}
5353
```
5454
Kotlin DSL
5555

5656
```kotlin
5757
plugins {
58-
id("io.typst.spigradle.bungee") version "3.7.1"
58+
id("io.typst.spigradle.bungee") version "3.7.2"
5959
}
6060
```
6161

@@ -68,7 +68,7 @@ buildscript {
6868
gradlePluginPortal()
6969
}
7070
dependencies {
71-
classpath 'io.typst:spigradle:3.7.1'
71+
classpath 'io.typst:spigradle:3.7.2'
7272
}
7373
}
7474
@@ -86,7 +86,7 @@ buildscript {
8686
gradlePluginPortal()
8787
}
8888
dependencies {
89-
classpath("io.typst:spigradle:3.7.1")
89+
classpath("io.typst:spigradle:3.7.2")
9090
}
9191
}
9292
@@ -132,7 +132,7 @@ For more details, see the [Main Class Detection](../README.md#main-class-detecti
132132

133133
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
134134

135-
### bungee - [BungeeExtension](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle.bungee/-bungee-extension/index.html)
135+
### bungee - [BungeeExtension](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle.bungee/-bungee-extension/index.html)
136136

137137
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
138138

@@ -226,13 +226,13 @@ tasks {
226226

227227
</details>
228228

229-
### detectBungeeMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
229+
### detectBungeeMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-subclass-detection/index.html)
230230

231231
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
232232

233233
Finds the main class extends [net.md_5.bungee.api.plugin.Plugin](https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/net/md_5/bungee/api/plugin/Plugin.html).
234234

235-
### generateBungeeDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
235+
### generateBungeeDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-yaml-generate/index.html)
236236

237237
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
238238

docs/multimodule.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Multi-module projects offer several benefits for Minecraft plugin development:
5050
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
5151

5252
- Gradle 8.0+ (the latest version is recommended)
53-
- Spigradle 3.7.1 or higher
53+
- Spigradle 3.7.2 or higher
5454
- Basic understanding of Gradle multi-module projects
5555

5656
To update your gradle wrapper:
@@ -227,7 +227,7 @@ java {
227227

228228
```groovy
229229
plugins {
230-
id 'io.typst.spigradle' version '3.7.1'
230+
id 'io.typst.spigradle' version '3.7.2'
231231
}
232232
233233
repositories {
@@ -276,7 +276,7 @@ tasks.jar {
276276
import io.typst.spigradle.spigot.*
277277

278278
plugins {
279-
id("io.typst.spigradle") version "3.7.1"
279+
id("io.typst.spigradle") version "3.7.2"
280280
}
281281

282282
repositories {
@@ -325,7 +325,7 @@ tasks.jar {
325325

326326
```groovy
327327
plugins {
328-
id 'io.typst.spigradle.bungee' version '3.7.1'
328+
id 'io.typst.spigradle.bungee' version '3.7.2'
329329
}
330330
331331
dependencies {
@@ -363,7 +363,7 @@ java {
363363
import io.typst.spigradle.bungee.*
364364

365365
plugins {
366-
id("io.typst.spigradle.bungee") version "3.7.1"
366+
id("io.typst.spigradle.bungee") version "3.7.2"
367367
}
368368

369369
dependencies {
@@ -469,7 +469,7 @@ For plugins that expose a public API for other developers:
469469
**Groovy DSL (api/build.gradle):**
470470
```groovy
471471
plugins {
472-
id 'io.typst.spigradle.base' version '3.7.1'
472+
id 'io.typst.spigradle.base' version '3.7.2'
473473
id 'java'
474474
}
475475
@@ -493,7 +493,7 @@ java {
493493
**Kotlin DSL (api/build.gradle.kts):**
494494
```kotlin
495495
plugins {
496-
id("io.typst.spigradle.base") version "3.7.1"
496+
id("io.typst.spigradle.base") version "3.7.2"
497497
id("java")
498498
}
499499

@@ -655,8 +655,8 @@ repositories {
655655

656656
dependencies {
657657
// Add Spigradle plugin to convention plugin classpath
658-
implementation("io.typst.spigradle:io.typst.spigradle.gradle.plugin:3.7.1")
659-
implementation("io.typst.spigradle.bungee:io.typst.spigradle.bungee.gradle.plugin:3.7.1")
658+
implementation("io.typst.spigradle:io.typst.spigradle.gradle.plugin:3.7.2")
659+
implementation("io.typst.spigradle.bungee:io.typst.spigradle.bungee.gradle.plugin:3.7.2")
660660
}
661661
```
662662

@@ -910,7 +910,7 @@ For Bukkit plugin, use the `libraries` option in plugin.yml instead of shadowJar
910910
```groovy
911911
// spigot/build.gradle
912912
plugins {
913-
id 'io.typst.spigradle' version '3.7.1'
913+
id 'io.typst.spigradle' version '3.7.2'
914914
}
915915
916916
// ...
@@ -933,7 +933,7 @@ spigot {
933933
```kotlin
934934
// spigot/build.gradle.kts
935935
plugins {
936-
id("io.typst.spigradle") version "3.7.1"
936+
id("io.typst.spigradle") version "3.7.2"
937937
}
938938

939939
// ...
@@ -959,7 +959,7 @@ When using Shadow plugin to bundle dependencies:
959959
// bungee/build.gradle
960960
plugins {
961961
id("com.gradleup.shadow") version "9.2.2"
962-
id 'io.typst.spigradle.bungee' version '3.7.1'
962+
id 'io.typst.spigradle.bungee' version '3.7.2'
963963
}
964964
965965
shadowJar {
@@ -978,7 +978,7 @@ tasks {
978978
// bungee/build.gradle.kts
979979
plugins {
980980
id("com.gradleup.shadow") version "9.2.2"
981-
id("io.typst.spigradle.bungee") version "3.7.1"
981+
id("io.typst.spigradle.bungee") version "3.7.2"
982982
}
983983

984984
tasks.shadowJar {

docs/nukkit_plugin.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ Groovy DSL
4848

4949
```groovy
5050
plugins {
51-
id 'io.typst.spigradle.nukkit' version '3.7.1'
51+
id 'io.typst.spigradle.nukkit' version '3.7.2'
5252
}
5353
```
5454
Kotlin DSL
5555

5656
```kotlin
5757
plugins {
58-
id("io.typst.spigradle.nukkit") version "3.7.1"
58+
id("io.typst.spigradle.nukkit") version "3.7.2"
5959
}
6060
```
6161

@@ -68,7 +68,7 @@ buildscript {
6868
gradlePluginPortal()
6969
}
7070
dependencies {
71-
classpath 'io.typst:spigradle:3.7.1'
71+
classpath 'io.typst:spigradle:3.7.2'
7272
}
7373
}
7474
@@ -86,7 +86,7 @@ buildscript {
8686
gradlePluginPortal()
8787
}
8888
dependencies {
89-
classpath("io.typst:spigradle:3.7.1")
89+
classpath("io.typst:spigradle:3.7.2")
9090
}
9191
}
9292
@@ -132,7 +132,7 @@ For more details, see the [Main Class Detection](../README.md#main-class-detecti
132132

133133
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
134134

135-
### nukkit - [NukkitExtension](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle.nukkit/-nukkit-extension/index.html)
135+
### nukkit - [NukkitExtension](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle.nukkit/-nukkit-extension/index.html)
136136

137137
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
138138

@@ -267,13 +267,13 @@ tasks {
267267

268268
</details>
269269

270-
### detectNukkitMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
270+
### detectNukkitMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-subclass-detection/index.html)
271271

272272
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
273273

274274
Finds the main class extends [cn.nukkit.plugin.PluginBase](https://ci.nukkitx.com/job/NukkitX/job/Nukkit/job/master/javadoc/index.html?overview-summary.html).
275275

276-
### generateNukkitDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
276+
### generateNukkitDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-yaml-generate/index.html)
277277

278278
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
279279

docs/spigot_plugin.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
44

5-
kdoc(javadoc): [SpigotPlugin.kt](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle.spigot/-spigot-plugin/index.html)
5+
kdoc(javadoc): [SpigotPlugin.kt](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle.spigot/-spigot-plugin/index.html)
66

77
The [Spigot](https://www.spigotmc.org/wiki/about-spigot/) plugin provides the following features:
88

@@ -60,15 +60,15 @@ Groovy DSL
6060

6161
```groovy
6262
plugins {
63-
id 'io.typst.spigradle' version '3.7.1'
63+
id 'io.typst.spigradle' version '3.7.2'
6464
}
6565
```
6666

6767
Kotlin DSL
6868

6969
```kotlin
7070
plugins {
71-
id("io.typst.spigradle") version "3.7.1"
71+
id("io.typst.spigradle") version "3.7.2"
7272
}
7373
```
7474

@@ -81,7 +81,7 @@ buildscript {
8181
gradlePluginPortal()
8282
}
8383
dependencies {
84-
classpath 'io.typst:spigradle:3.7.1'
84+
classpath 'io.typst:spigradle:3.7.2'
8585
}
8686
}
8787
@@ -99,7 +99,7 @@ buildscript {
9999
gradlePluginPortal()
100100
}
101101
dependencies {
102-
classpath("io.typst:spigradle:3.7.1")
102+
classpath("io.typst:spigradle:3.7.2")
103103
}
104104
}
105105
@@ -149,7 +149,7 @@ For more details, see the [Main Class Detection](../README.md#main-class-detecti
149149

150150
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
151151

152-
### spigot extension - [SpigotExtension](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
152+
### spigot extension - [SpigotExtension](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
153153

154154
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
155155

@@ -239,7 +239,7 @@ configure<SpigotExtension> {
239239

240240
</details>
241241

242-
### debugSpigot extension - [DebugExtension](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle.debug/-debug-extension/index.html)
242+
### debugSpigot extension - [DebugExtension](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle.debug/-debug-extension/index.html)
243243

244244
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
245245

@@ -263,14 +263,14 @@ debugSpigot {
263263
All tasks
264264
supports [UP-TO-DATE check](https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks).
265265

266-
### detectSpigotMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
266+
### detectSpigotMain - [SubclassDetection](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-subclass-detection/index.html)
267267

268268
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
269269

270270
Finds the main class
271271
extends [org.bukkit.plugin.java.JavaPlugin](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/java/JavaPlugin.html).
272272

273-
### generateSpigotDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
273+
### generateSpigotDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.7.2/spigradle/io.typst.spigradle/-yaml-generate/index.html)
274274

275275
[comment]: <> (!! Do not edit this file but 'docs/templates' or 'docs/root-templates', See [CONTRIBUTING.md] !!)
276276

@@ -300,7 +300,7 @@ Runs a local Paper server with your plugin for debugging. This task orchestrates
300300

301301
**IntelliJ IDEA Run Configurations:**
302302

303-
Spigradle automatically creates two run configurations:
303+
Spigradle automatically creates two run configurations (NOTE: These are only generated if the plugin `org.jetbrains.gradle.plugin.idea-ext` is applied):
304304

305305
1. **`Debug${ProjectName}` - Remote JVM Debug****Recommended**
306306
- **Type:** Remote JVM Debug configuration

docs/templates/template_spigot_plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Runs a local Paper server with your plugin for debugging. This task orchestrates
274274

275275
**IntelliJ IDEA Run Configurations:**
276276

277-
Spigradle automatically creates two run configurations:
277+
Spigradle automatically creates two run configurations (NOTE: These are only generated if the plugin `org.jetbrains.gradle.plugin.idea-ext` is applied):
278278

279279
1. **`Debug\${ProjectName}` - Remote JVM Debug****Recommended**
280280
- **Type:** Remote JVM Debug configuration

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# matched with the version of kotlin-dsl `embeddedKotlinVersion`
44
kotlin = "2.0.21"
55
dokka = "2.1.0"
6-
asm = "9.8"
6+
# NOTE: required consistent maintenance
7+
asm = "9.9"
78
ideaExt = "1.3"
89
spigot = "1.21.4-R0.1-SNAPSHOT"
910
junit = "5.12.1"

src/main/kotlin/io/typst/spigradle/SpigradlePlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fun Project.getPluginMainPathFile(type: String) =
4444
class SpigradlePlugin : Plugin<Project> {
4545
override fun apply(project: Project) {
4646
with(project) {
47-
pluginManager.apply("java")
47+
pluginManager.apply("java") // TODO: bad practice? https://docs.gradle.org/current/userguide/implementing_gradle_plugins_binary.html#reacting_to_plugins
4848
setupGroovyExtensions()
4949
}
5050
}

src/main/kotlin/io/typst/spigradle/debug/DebugExtension.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ open class DebugExtension(project: Project) {
199199
val javaVersion: Property<JavaLanguageVersion> = project.objects.property(JavaLanguageVersion::class.java)
200200
.convention(project.provider {
201201
val javaExt = project.extensions.getByType(JavaPluginExtension::class.java)
202-
javaExt.toolchain.languageVersion.get()
202+
val toolchainSpec = javaExt.toolchain
203+
val javaToolchains = project.extensions.getByType(JavaToolchainService::class.java)
204+
val launcherProvider = javaToolchains.launcherFor(toolchainSpec)
205+
launcherProvider.get().metadata.languageVersion
203206
})
204207

205208
/**

src/main/kotlin/io/typst/spigradle/debug/DebugRegistrationContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import java.io.File
3131

3232
data class DebugRegistrationContext(
3333
val platformName: String,
34-
val platformVersion: Provider<String>,
34+
val platformVersion: Property<String>,
3535
val downloadURI: String,
3636
val debugArtifactRelativeDir: String,
3737
val jarTask: Provider<Jar>,

0 commit comments

Comments
 (0)