Commits

kosgan10 authored and md_5 committed 7750a2f992e
Add a simple GUI for double-clickers
No tags

src/main/java/org/spigotmc/builder/Builder.java

Modified
6 6 import com.google.common.collect.Iterables;
7 7 import com.google.common.hash.Hasher;
8 8 import com.google.common.hash.Hashing;
9 9 import com.google.common.io.ByteStreams;
10 10 import com.google.common.io.CharStreams;
11 11 import com.google.common.io.Files;
12 12 import com.google.common.io.Resources;
13 13 import com.google.gson.Gson;
14 14 import difflib.DiffUtils;
15 15 import difflib.Patch;
16 +import java.awt.Desktop;
16 17 import java.io.BufferedOutputStream;
17 18 import java.io.BufferedReader;
18 19 import java.io.BufferedWriter;
19 20 import java.io.File;
20 21 import java.io.FileDescriptor;
21 22 import java.io.FileNotFoundException;
22 23 import java.io.FileOutputStream;
23 24 import java.io.FileWriter;
24 25 import java.io.FilenameFilter;
25 26 import java.io.IOException;
26 27 import java.io.InputStream;
27 28 import java.io.InputStreamReader;
28 29 import java.io.OutputStream;
29 30 import java.io.PrintStream;
31 +import java.net.URI;
30 32 import java.net.URL;
31 33 import java.net.URLConnection;
32 34 import java.security.KeyManagementException;
33 35 import java.security.NoSuchAlgorithmException;
34 36 import java.security.SecureRandom;
35 37 import java.security.cert.X509Certificate;
36 38 import java.util.Arrays;
37 39 import java.util.Date;
38 40 import java.util.Enumeration;
39 41 import java.util.List;
40 42 import java.util.zip.ZipEntry;
41 43 import java.util.zip.ZipFile;
42 44 import javax.net.ssl.HostnameVerifier;
43 45 import javax.net.ssl.HttpsURLConnection;
44 46 import javax.net.ssl.SSLContext;
45 47 import javax.net.ssl.SSLSession;
46 48 import javax.net.ssl.TrustManager;
47 49 import javax.net.ssl.X509TrustManager;
48 -
50 +import javax.swing.JFrame;
51 +import javax.swing.JLabel;
49 52 import joptsimple.OptionParser;
50 53 import joptsimple.OptionSet;
51 54 import joptsimple.OptionSpec;
52 55 import lombok.RequiredArgsConstructor;
53 56 import org.apache.commons.io.FileUtils;
54 57 import org.apache.commons.io.output.TeeOutputStream;
55 58 import org.eclipse.jgit.api.Git;
56 59 import org.eclipse.jgit.api.ResetCommand;
57 60 import org.eclipse.jgit.api.errors.GitAPIException;
58 61 import org.eclipse.jgit.revwalk.RevCommit;
64 67 public static final boolean IS_WINDOWS = System.getProperty( "os.name" ).startsWith( "Windows" );
65 68 public static final File CWD = new File( "." );
66 69 private static boolean dontUpdate;
67 70 private static boolean skipCompile;
68 71 private static boolean generateSource;
69 72 private static boolean generateDocs;
70 73 private static boolean dev;
71 74
72 75 public static void main(String[] args) throws Exception
73 76 {
77 + if ( System.console() == null )
78 + {
79 + JFrame jFrame = new JFrame();
80 + jFrame.setTitle( "SpigotMC - BuildTools" );
81 + jFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
82 + jFrame.getContentPane().add( new JLabel( "You have to run BuildTools through bash (msysgit). Please read our wiki." ) );
83 + jFrame.pack();
84 + jFrame.setVisible( true );
85 +
86 + Desktop.getDesktop().browse( new URI( "https://www.spigotmc.org/wiki/buildtools/" ) );
87 + return;
88 + }
89 +
74 90 // May be null
75 91 String buildVersion = Builder.class.getPackage().getImplementationVersion();
76 92 int buildNumber = -1;
77 93 if ( buildVersion != null )
78 94 {
79 95 String[] split = buildVersion.split( "-" );
80 96 if ( split.length == 4 )
81 97 {
82 98 try
83 99 {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut