diff options
author | kosgan10 <kosgan10@gmail.com> | 2015-08-31 19:31:00 +0300 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-09-02 07:01:46 +1000 |
commit | 7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89 (patch) | |
tree | e8cf44092482e734f60b25cb516ef9087a3a3c6f | |
parent | 00c9da2167f25e85cdac960a1213f2a9e87d6b31 (diff) | |
download | buildtools-7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89.tar buildtools-7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89.tar.gz buildtools-7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89.tar.lz buildtools-7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89.tar.xz buildtools-7750a2f992e3b85c2b3c26c5e6aaf69f3901cb89.zip |
Add a simple GUI for double-clickers
-rw-r--r-- | src/main/java/org/spigotmc/builder/Builder.java | 18 |
1 files changed, 17 insertions, 1 deletions
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; |