Fix promptBoolean + Update build script
This commit is contained in:
parent
6ed31db7dc
commit
f037c6a724
@ -12,9 +12,8 @@ Move the executable somewhere in your $PATH
|
|||||||
Or build a native image with GraalVM
|
Or build a native image with GraalVM
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./gradlew installShadowDist
|
./gradlew buildNative
|
||||||
cd app/build/install/app-shadow/lib
|
cd app/build/native
|
||||||
native-image --no-fallback -R:MaxNewSize=32 --language:js -jar scaffold.jar
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
@ -22,3 +22,21 @@ tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
|
|||||||
archiveClassifier.set("")
|
archiveClassifier.set("")
|
||||||
archiveVersion.set("")
|
archiveVersion.set("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task("buildNative") {
|
||||||
|
dependsOn("installShadowDist")
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
exec {
|
||||||
|
commandLine(
|
||||||
|
"native-image",
|
||||||
|
"--no-fallback",
|
||||||
|
"-R:MaxNewSize=32",
|
||||||
|
"--language:js",
|
||||||
|
"-jar",
|
||||||
|
"${project.buildDir}/install/app-shadow/lib/scaffold.jar",
|
||||||
|
"${project.buildDir}/native/scaffold"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -46,7 +46,17 @@ class GenerateCommand(private val generators: Generators) : CliktCommand("genera
|
|||||||
null -> "[y/n]"
|
null -> "[y/n]"
|
||||||
}
|
}
|
||||||
|
|
||||||
return this@GenerateCommand.prompt("$text $suffix", default = "$default", showDefault = false) {
|
val defaultAsString = when (default) {
|
||||||
|
true -> "y"
|
||||||
|
false -> "n"
|
||||||
|
null -> null
|
||||||
|
}
|
||||||
|
|
||||||
|
return this@GenerateCommand.prompt(
|
||||||
|
"$text $suffix",
|
||||||
|
default = defaultAsString,
|
||||||
|
showDefault = false
|
||||||
|
) {
|
||||||
when (it.toLowerCase()) {
|
when (it.toLowerCase()) {
|
||||||
"y" -> true
|
"y" -> true
|
||||||
"n" -> false
|
"n" -> false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user