Created
July 8, 2023 07:15
-
-
Save maxandersen/698334f17b82249eac15d37330c97a51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS info.picocli:picocli:4.6.3 | |
//DEPS morpher.java | |
import picocli.CommandLine; | |
import picocli.CommandLine.Command; | |
import picocli.CommandLine.Parameters; | |
import java.util.concurrent.Callable; | |
@Command(name = "hello", mixinStandardHelpOptions = true, version = "hello 0.1", | |
description = "hello made with jbang") | |
class hello implements Callable<Integer> { | |
@Parameters(index = "0", description = "The greeting to print", defaultValue = "World!") | |
private String greeting; | |
public static void main(String... args) { | |
int exitCode = new CommandLine(new hello()).execute(args); | |
System.exit(exitCode); | |
} | |
@Override | |
public Integer call() throws Exception { // your business logic goes here... | |
System.out.println("Hello " + greeting); | |
return 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//FILES META-INF/jbang-integration.list=morpher.list | |
import static java.lang.System.*; | |
import java.nio.file.Path; | |
import java.util.Collections; | |
import java.util.List; | |
import java.util.Map; | |
public class morpher { | |
public static Map<String, Object> postBuild(Path temporaryJar, | |
Path pomFile, | |
List<Map.Entry<String, String>> repositories, | |
List<Map.Entry<String, Path>> dependencies, | |
List<String> comments, | |
boolean nativeImage) { | |
System.out.println("Integration... (out)"); | |
System.err.println("Integration... (err)"); | |
if (System.getProperty("failintegration") != null) { | |
throw new RuntimeException("Failing integration..."); | |
} else { | |
System.out.println("Integration OK (out)"); | |
System.err.println("Integration OK (err)"); | |
return Collections.emptyMap(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
morpher |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment