mirror of https://github.com/sbt/sbt.git
Merge pull request #7854 from Friendseeker/return-1-when-failed
[1.x] Return exit code `1` when client crashes & add smoke test for client
This commit is contained in:
commit
c5c094ee21
|
|
@ -160,6 +160,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
# test building sbtn on Linux
|
# test building sbtn on Linux
|
||||||
sbt "-Dsbt.io.virtual=false" nativeImage
|
sbt "-Dsbt.io.virtual=false" nativeImage
|
||||||
|
# smoke test native Image
|
||||||
|
./client/target/bin/sbtn shutdown
|
||||||
# test launcher script
|
# test launcher script
|
||||||
echo build using JDK 8 test using JDK 8 and JDK 11
|
echo build using JDK 8 test using JDK 8 and JDK 11
|
||||||
cd launcher-package
|
cd launcher-package
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,21 @@
|
||||||
package sbt.client;
|
package sbt.client;
|
||||||
|
|
||||||
import sbt.internal.client.NetworkClient;
|
import sbt.internal.client.NetworkClient;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import org.fusesource.jansi.AnsiConsole;
|
import org.fusesource.jansi.AnsiConsole;
|
||||||
|
|
||||||
public class Client {
|
public class Client {
|
||||||
public static void main(final String[] args) {
|
public static void main(final String[] args) {
|
||||||
boolean isWin = System.getProperty("os.name").toLowerCase().startsWith("win");
|
boolean isWin = System.getProperty("os.name").toLowerCase().startsWith("win");
|
||||||
|
boolean hadError = false;
|
||||||
try {
|
try {
|
||||||
if (isWin) AnsiConsole.systemInstall();
|
if (isWin) AnsiConsole.systemInstall();
|
||||||
NetworkClient.main(args);
|
NetworkClient.main(args);
|
||||||
} catch (final Throwable t) {
|
} catch (final Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
|
hadError = true;
|
||||||
} finally {
|
} finally {
|
||||||
if (isWin) AnsiConsole.systemUninstall();
|
if (isWin) AnsiConsole.systemUninstall();
|
||||||
|
if (hadError) System.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue