Skip to content

Commit 801c70e

Browse files
authored
Merge pull request #100 from typst-io/next
feat: idea runconf JarApp, fix linux/mac debug
2 parents 26a3787 + 06bb58e commit 801c70e

10 files changed

Lines changed: 176 additions & 72 deletions

File tree

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ An intelligent Gradle plugin used to develop plugins for Spigot, Bungeecord and
1414

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

17-
- [Description file](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
17+
- [Description file](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
1818
generation: `plugin.yml` and/or `bungee.yml`
1919

2020
- Main class detection
@@ -26,7 +26,7 @@ An intelligent Gradle plugin used to develop plugins for Spigot, Bungeecord and
2626
```groovy
2727
plugins {
2828
id 'java'
29-
id 'io.typst.spigradle' version '3.4.1'
29+
id 'io.typst.spigradle' version '3.5.0'
3030
}
3131
3232
group 'org.sample'
@@ -102,7 +102,7 @@ Groovy DSL
102102
```groovy
103103
plugins {
104104
id 'java'
105-
id 'io.typst.spigradle' version '3.4.1'
105+
id 'io.typst.spigradle' version '3.5.0'
106106
}
107107
108108
repositories {
@@ -139,7 +139,7 @@ import io.typst.spigradle.spigot.*
139139

140140
plugins {
141141
kotlin("jvm") version "2.1.20"
142-
id("io.typst.spigradle") version "3.4.1"
142+
id("io.typst.spigradle") version "3.5.0"
143143
}
144144

145145
repositories {
@@ -149,6 +149,7 @@ repositories {
149149
}
150150

151151
dependencies {
152+
implementation(kotlin("stdlib"))
152153
compileOnly(paper("1.21.8"))
153154
}
154155

@@ -180,7 +181,7 @@ buildscript {
180181
gradlePluginPortal()
181182
}
182183
dependencies {
183-
classpath 'io.typst:spigradle:3.4.1'
184+
classpath 'io.typst:spigradle:3.5.0'
184185
}
185186
}
186187
@@ -198,7 +199,7 @@ buildscript {
198199
gradlePluginPortal()
199200
}
200201
dependencies {
201-
classpath("io.typst:spigradle:3.4.1")
202+
classpath("io.typst:spigradle:3.5.0")
202203
}
203204
}
204205
@@ -225,7 +226,7 @@ Groovy DSL
225226
```groovy
226227
plugins {
227228
id 'java'
228-
id 'io.typst.spigradle.bungee' version '3.4.1'
229+
id 'io.typst.spigradle.bungee' version '3.5.0'
229230
}
230231
231232
repositories {
@@ -243,7 +244,7 @@ dependencies {
243244
```kotlin
244245
plugins {
245246
kotlin("jvm") version "2.1.20"
246-
id("io.typst.spigradle.bungee") version "3.4.1"
247+
id("io.typst.spigradle.bungee") version "3.5.0"
247248
}
248249

249250
repositories {
@@ -267,7 +268,7 @@ buildscript {
267268
gradlePluginPortal()
268269
}
269270
dependencies {
270-
classpath 'io.typst:spigradle:3.4.1'
271+
classpath 'io.typst:spigradle:3.5.0'
271272
}
272273
}
273274
@@ -285,7 +286,7 @@ buildscript {
285286
gradlePluginPortal()
286287
}
287288
dependencies {
288-
classpath("io.typst:spigradle:3.4.1")
289+
classpath("io.typst:spigradle:3.5.0")
289290
}
290291
}
291292
@@ -312,7 +313,7 @@ Groovy DSL
312313
```groovy
313314
plugins {
314315
id 'java'
315-
id 'io.typst.spigradle.nukkit' version '3.4.1'
316+
id 'io.typst.spigradle.nukkit' version '3.5.0'
316317
}
317318
318319
repositories {
@@ -330,7 +331,7 @@ dependencies {
330331
```kotlin
331332
plugins {
332333
kotlin("jvm") version "2.1.20"
333-
id("io.typst.spigradle.nukkit") version "3.4.1"
334+
id("io.typst.spigradle.nukkit") version "3.5.0"
334335
}
335336

336337
repositories {
@@ -354,7 +355,7 @@ buildscript {
354355
gradlePluginPortal()
355356
}
356357
dependencies {
357-
classpath 'io.typst:spigradle:3.4.1'
358+
classpath 'io.typst:spigradle:3.5.0'
358359
}
359360
}
360361
@@ -372,7 +373,7 @@ buildscript {
372373
gradlePluginPortal()
373374
}
374375
dependencies {
375-
classpath("io.typst:spigradle:3.4.1")
376+
classpath("io.typst:spigradle:3.5.0")
376377
}
377378
}
378379
@@ -447,7 +448,7 @@ repositories {
447448
| bukkit() | org.bukkit:bukkit:$version | 1.21.8-R0.1-SNAPSHOT | mavenLocal(), BuildTools |
448449
| craftbukkit() | org.bukkit:craftbukkit:$version | 1.21.8-R0.1-SNAPSHOT | mavenLocal(), BuildTools |
449450
| lombok() | org.projectlombok:lombok:$version | 1.18.38 | mavenCentral() |
450-
| spigradle() | io.typst:spigradle:$version | 3.4.1 | mavenCentral() |
451+
| spigradle() | io.typst:spigradle:$version | 3.5.0 | mavenCentral() |
451452
| protocolLib() | com.comphenix.protocol:ProtocolLib:$version | 5.3.0 | protocolLib() |
452453
| vault() | com.github.MilkBowl:VaultAPI:$version | 1.7 | jitpack() |
453454
| 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.4.1'
51+
id 'io.typst.spigradle.bungee' version '3.5.0'
5252
}
5353
```
5454
Kotlin DSL
5555

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

@@ -68,7 +68,7 @@ buildscript {
6868
gradlePluginPortal()
6969
}
7070
dependencies {
71-
classpath 'io.typst:spigradle:3.4.1'
71+
classpath 'io.typst:spigradle:3.5.0'
7272
}
7373
}
7474
@@ -86,7 +86,7 @@ buildscript {
8686
gradlePluginPortal()
8787
}
8888
dependencies {
89-
classpath("io.typst:spigradle:3.4.1")
89+
classpath("io.typst:spigradle:3.5.0")
9090
}
9191
}
9292
@@ -115,7 +115,7 @@ The plugin automatically finds the main class extends [Plugin](https://ci.md-5.n
115115

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

118-
### bungee - [BungeeExtension](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.bungee/-bungee-extension/index.html)
118+
### bungee - [BungeeExtension](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.bungee/-bungee-extension/index.html)
119119

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

@@ -209,13 +209,13 @@ tasks {
209209

210210
</details>
211211

212-
### detectBungeeMain - [SubclassDetection](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
212+
### detectBungeeMain - [SubclassDetection](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-subclass-detection/index.html)
213213

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

216216
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).
217217

218-
### generateBungeeDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
218+
### generateBungeeDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-yaml-generate/index.html)
219219

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

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.4.1'
51+
id 'io.typst.spigradle.nukkit' version '3.5.0'
5252
}
5353
```
5454
Kotlin DSL
5555

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

@@ -68,7 +68,7 @@ buildscript {
6868
gradlePluginPortal()
6969
}
7070
dependencies {
71-
classpath 'io.typst:spigradle:3.4.1'
71+
classpath 'io.typst:spigradle:3.5.0'
7272
}
7373
}
7474
@@ -86,7 +86,7 @@ buildscript {
8686
gradlePluginPortal()
8787
}
8888
dependencies {
89-
classpath("io.typst:spigradle:3.4.1")
89+
classpath("io.typst:spigradle:3.5.0")
9090
}
9191
}
9292
@@ -115,7 +115,7 @@ The plugin automatically finds the main class extends [PluginBase](https://ci.nu
115115

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

118-
### nukkit - [NukkitExtension](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.nukkit/-nukkit-extension/index.html)
118+
### nukkit - [NukkitExtension](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.nukkit/-nukkit-extension/index.html)
119119

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

@@ -250,13 +250,13 @@ tasks {
250250

251251
</details>
252252

253-
### detectNukkitMain - [SubclassDetection](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
253+
### detectNukkitMain - [SubclassDetection](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-subclass-detection/index.html)
254254

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

257257
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).
258258

259-
### generateNukkitDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
259+
### generateNukkitDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-yaml-generate/index.html)
260260

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

docs/spigot_plugin.md

Lines changed: 9 additions & 9 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-
doc: [SpigotPlugin.kt](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.spigot/-spigot-plugin/index.html)
5+
doc: [SpigotPlugin.kt](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.spigot/-spigot-plugin/index.html)
66

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

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

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

6767
Kotlin DSL
6868

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

@@ -81,7 +81,7 @@ buildscript {
8181
gradlePluginPortal()
8282
}
8383
dependencies {
84-
classpath 'io.typst:spigradle:3.4.1'
84+
classpath 'io.typst:spigradle:3.5.0'
8585
}
8686
}
8787
@@ -99,7 +99,7 @@ buildscript {
9999
gradlePluginPortal()
100100
}
101101
dependencies {
102-
classpath("io.typst:spigradle:3.4.1")
102+
classpath("io.typst:spigradle:3.5.0")
103103
}
104104
}
105105
@@ -134,7 +134,7 @@ main' property to the class found.
134134

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

137-
### spigot - [SpigotExtension](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
137+
### spigot - [SpigotExtension](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.spigot/-spigot-extension/index.html)
138138

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

@@ -224,7 +224,7 @@ configure<SpigotExtension> {
224224

225225
</details>
226226

227-
### debugSpigot - [DebugExtension](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle.debug/-debug-extension/index.html)
227+
### debugSpigot - [DebugExtension](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle.debug/-debug-extension/index.html)
228228

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

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

247-
### detectSpigotMain - [SubclassDetection](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-subclass-detection/index.html)
247+
### detectSpigotMain - [SubclassDetection](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-subclass-detection/index.html)
248248

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

251251
Finds the main class
252252
extends [org.bukkit.plugin.java.JavaPlugin](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/plugin/java/JavaPlugin.html).
253253

254-
### generateSpigotDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.4.1/spigradle/io.typst.spigradle/-yaml-generate/index.html)
254+
### generateSpigotDescription - [YamlGenerate](https://docs.typst.io/spigradle/3.5.0/spigradle/io.typst.spigradle/-yaml-generate/index.html)
255255

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

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,13 @@ open class CreateJavaDebugScriptTask : DefaultTask() {
6363
""".trimIndent()
6464
)
6565
val shFile = dir.resolve("starter")
66-
shFile.writeText(
67-
"""
68-
#!/usr/bin/env bash
69-
"$javaFilePath" $jvmArgsStr -jar "$jarFilePath" $programArgsStr
70-
""".trimIndent()
71-
)
7266
try {
7367
Files.setPosixFilePermissions(
7468
shFile.toPath(),
7569
setOf(
7670
PosixFilePermission.OWNER_EXECUTE,
7771
PosixFilePermission.OWNER_READ,
72+
PosixFilePermission.OWNER_WRITE,
7873
PosixFilePermission.GROUP_EXECUTE,
7974
PosixFilePermission.GROUP_READ,
8075
PosixFilePermission.OTHERS_EXECUTE,
@@ -84,5 +79,11 @@ open class CreateJavaDebugScriptTask : DefaultTask() {
8479
} catch (th: Throwable) {
8580
// ignore
8681
}
82+
shFile.writeText(
83+
"""
84+
#!/usr/bin/env bash
85+
"$javaFilePath" $jvmArgsStr -jar "$jarFilePath" $programArgsStr
86+
""".trimIndent()
87+
)
8788
}
8889
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import org.gradle.api.provider.Property
3131
open class DebugExtension(project: Project) {
3232
val version: Property<String> = project.objects.property(String::class.java)
3333
val eula: Property<Boolean> = project.objects.property(Boolean::class.java).convention(false)
34+
val jvmDebugPort: Property<Int> = project.objects.property(Int::class.java).convention(5005)
3435
val downloadSoftDepends: Property<Boolean> = project.objects.property(Boolean::class.java).convention(false)
3536
val jvmArgs: ListProperty<String> = project.objects.listProperty(String::class.java)
3637
val programArgs: ListProperty<String> = project.objects.listProperty(String::class.java)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.gradle.api.Task
2323
import org.gradle.api.file.Directory
2424
import org.gradle.api.file.RegularFile
2525
import org.gradle.api.provider.ListProperty
26+
import org.gradle.api.provider.Property
2627
import org.gradle.api.provider.Provider
2728
import org.gradle.api.tasks.TaskProvider
2829
import org.gradle.api.tasks.bundling.Jar
@@ -36,6 +37,7 @@ data class DebugRegistrationContext(
3637
val jarTask: Provider<Jar>,
3738
val jvmArgs: ListProperty<String>,
3839
val programArgs: ListProperty<String>,
40+
val jvmDebugPort: Property<Int>,
3941
val overwrite: Boolean = false,
4042
val eula: Provider<Boolean>? = null,
4143
val downloadTask: TaskProvider<out Task>? = null,

0 commit comments

Comments
 (0)