Commits
md_5 authored abb3b7a699c
52 52 | |
53 53 | public class Builder |
54 54 | { |
55 55 | |
56 56 | public static final String LOG_FILE = "BuildTools.log.txt"; |
57 57 | public static final boolean IS_WINDOWS = System.getProperty( "os.name" ).startsWith( "Windows" ); |
58 58 | public static final File CWD = new File( "." ); |
59 59 | public static final String MC_VERSION = "1.8"; |
60 60 | private static boolean dontUpdate; |
61 61 | private static boolean skipCompile; |
62 + | private static boolean generateSource; |
63 + | private static boolean generateDocs; |
62 64 | |
63 65 | public static void main(String[] args) throws Exception |
64 66 | { |
65 67 | for ( String s : args ) |
66 68 | { |
67 69 | if ( "--disable-certificate-check".equals( s ) ) |
68 70 | { |
69 71 | disableHttpsCertificateCheck(); |
70 72 | } |
71 73 | if ( "--dont-update".equals( s ) ) |
72 74 | { |
73 75 | dontUpdate = true; |
74 76 | } |
75 77 | if ( "--skip-compile".endsWith( s ) ) |
76 78 | { |
77 79 | skipCompile = true; |
78 80 | } |
81 + | if ( "--generate-source".equals( s ) ) |
82 + | { |
83 + | generateSource = true; |
84 + | } |
85 + | if ( "--generate-docs".equals( s ) ) |
86 + | { |
87 + | generateDocs = true; |
88 + | } |
79 89 | } |
80 90 | |
81 91 | logOutput(); |
82 92 | |
83 93 | if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 ) |
84 94 | { |
85 95 | System.err.println( "*** ERROR *** BuildTools should be run with Java 7 or above." ); |
86 96 | System.err.println( "*** ERROR *** Use java -version to check your Java version." ); |
87 97 | return; |
88 98 | } |
293 303 | { |
294 304 | clone( "file://" + craftBukkit.getAbsolutePath(), spigotServer ); |
295 305 | } |
296 306 | |
297 307 | // Git spigotApiGit = Git.open( spigotApi ); |
298 308 | // Git spigotServerGit = Git.open( spigotServer ); |
299 309 | if ( !skipCompile ) |
300 310 | { |
301 311 | System.out.println( "Compiling Bukkit" ); |
302 312 | runProcess( bukkit, "sh", mvn, "clean", "install" ); |
313 + | if ( generateDocs ) |
314 + | { |
315 + | runProcess( bukkit, "sh", mvn, "javadoc:jar" ); |
316 + | } |
317 + | if ( generateSource ) |
318 + | { |
319 + | runProcess( bukkit, "sh", mvn, "source:jar" ); |
320 + | } |
303 321 | |
304 322 | System.out.println( "Compiling CraftBukkit" ); |
305 323 | runProcess( craftBukkit, "sh", mvn, "clean", "install" ); |
306 324 | } |
307 325 | |
308 326 | try |
309 327 | { |
310 328 | runProcess( spigot, "bash", "applyPatches.sh" ); |
311 329 | System.out.println( "*** Spigot patches applied!" ); |
312 330 | System.out.println( "Compiling Spigot & Spigot-API" ); |