Change package names zero->boot
* actuator -> boot-ops * cli -> boot-cli * launcher -> boot-load * autoconfig -> boot-config * bootstrap -> boot-strap * starters -> boot-up [#54095231] [bs-253] Refactor Zero->Boot
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
def run = { msg ->
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${msg}"
|
||||
}
|
||||
|
||||
run
|
||||
18
spring-boot-cli/src/test/resources/commands/command.groovy
Normal file
18
spring-boot-cli/src/test/resources/commands/command.groovy
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.test.command
|
||||
|
||||
class TestCommand implements Command {
|
||||
|
||||
String name = "foo"
|
||||
|
||||
String description = "My script command"
|
||||
|
||||
String help = "No options"
|
||||
|
||||
String usageHelp = "Not very useful"
|
||||
|
||||
void run(String... args) {
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${args[0]}"
|
||||
}
|
||||
|
||||
}
|
||||
19
spring-boot-cli/src/test/resources/commands/handler.groovy
Normal file
19
spring-boot-cli/src/test/resources/commands/handler.groovy
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.test.command
|
||||
|
||||
@Grab("org.eclipse.jgit:org.eclipse.jgit:2.3.1.201302201838-r")
|
||||
import org.eclipse.jgit.api.Git
|
||||
|
||||
class TestCommand extends OptionHandler {
|
||||
|
||||
void options() {
|
||||
option "foo", "Foo set"
|
||||
}
|
||||
|
||||
void run(OptionSet options) {
|
||||
// Demonstrate use of Grape.grab to load dependencies before running
|
||||
println "Clean : " + Git.open(".." as File).status().call().isClean()
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')}"
|
||||
}
|
||||
|
||||
}
|
||||
6
spring-boot-cli/src/test/resources/commands/mixin.groovy
Normal file
6
spring-boot-cli/src/test/resources/commands/mixin.groovy
Normal file
@@ -0,0 +1,6 @@
|
||||
void options() {
|
||||
option "foo", "Foo set"
|
||||
}
|
||||
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')}"
|
||||
11
spring-boot-cli/src/test/resources/commands/runnable.groovy
Normal file
11
spring-boot-cli/src/test/resources/commands/runnable.groovy
Normal file
@@ -0,0 +1,11 @@
|
||||
class TestCommand implements Runnable {
|
||||
def msg
|
||||
TestCommand(String msg) {
|
||||
this.msg = msg
|
||||
}
|
||||
void run() {
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${msg}"
|
||||
}
|
||||
}
|
||||
new TestCommand(args[0])
|
||||
@@ -0,0 +1 @@
|
||||
println "Hello ${args[0]}"
|
||||
7
spring-boot-cli/src/test/resources/commands/test.groovy
Normal file
7
spring-boot-cli/src/test/resources/commands/test.groovy
Normal file
@@ -0,0 +1,7 @@
|
||||
options {
|
||||
option "foo", "Foo set"
|
||||
option "bar", "Bar has an argument of type int" withOptionalArg() ofType Integer
|
||||
}
|
||||
|
||||
org.springframework.boot.cli.command.ScriptCommandTests.executed = true
|
||||
println "Hello ${options.nonOptionArguments()}: ${options.has('foo')} ${options.valueOf('bar')}"
|
||||
Reference in New Issue
Block a user