From 7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89 Mon Sep 17 00:00:00 2001 From: kosgan10 Date: Mon, 31 Aug 2015 19:31:00 +0300 Subject: Add a simple GUI for double-clickers --- src/main/java/org/spigotmc/builder/Builder.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java index dfdc551..1ea7a4f 100644 --- a/src/main/java/org/spigotmc/builder/Builder.java +++ b/src/main/java/org/spigotmc/builder/Builder.java @@ -13,6 +13,7 @@ import com.google.common.io.Resources; import com.google.gson.Gson; import difflib.DiffUtils; import difflib.Patch; +import java.awt.Desktop; import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -27,6 +28,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintStream; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.security.KeyManagementException; @@ -45,7 +47,8 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; - +import javax.swing.JFrame; +import javax.swing.JLabel; import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpec; @@ -71,6 +74,19 @@ public class Builder public static void main(String[] args) throws Exception { + if ( System.console() == null ) + { + JFrame jFrame = new JFrame(); + jFrame.setTitle( "SpigotMC - BuildTools" ); + jFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); + jFrame.getContentPane().add( new JLabel( "You have to run BuildTools through bash (msysgit). Please read our wiki." ) ); + jFrame.pack(); + jFrame.setVisible( true ); + + Desktop.getDesktop().browse( new URI( "https://www.spigotmc.org/wiki/buildtools/" ) ); + return; + } + // May be null String buildVersion = Builder.class.getPackage().getImplementationVersion(); int buildNumber = -1; -- cgit v1.2.3