Commits
Nothixal authored and md_5 committed 7157aadff5b
44 44 | import java.text.MessageFormat; |
45 45 | import java.util.ArrayList; |
46 46 | import java.util.Arrays; |
47 47 | import java.util.Collections; |
48 48 | import java.util.Date; |
49 49 | import java.util.EnumSet; |
50 50 | import java.util.Enumeration; |
51 51 | import java.util.LinkedList; |
52 52 | import java.util.List; |
53 53 | import java.util.Set; |
54 + | import java.util.concurrent.TimeUnit; |
54 55 | import java.util.function.Predicate; |
55 56 | import java.util.jar.JarFile; |
56 57 | import java.util.zip.ZipEntry; |
57 58 | import java.util.zip.ZipFile; |
58 59 | import javax.net.ssl.HttpsURLConnection; |
59 60 | import javax.net.ssl.SSLContext; |
60 61 | import javax.net.ssl.TrustManager; |
61 62 | import javax.net.ssl.X509TrustManager; |
62 63 | import joptsimple.OptionParser; |
63 64 | import joptsimple.OptionSet; |
64 65 | import joptsimple.OptionSpec; |
65 66 | import joptsimple.util.EnumConverter; |
66 67 | import lombok.RequiredArgsConstructor; |
67 68 | import org.apache.commons.io.FileUtils; |
68 69 | import org.apache.commons.io.output.TeeOutputStream; |
70 + | import org.apache.commons.lang3.time.DurationFormatUtils; |
69 71 | import org.eclipse.jgit.api.Git; |
70 72 | import org.eclipse.jgit.api.ResetCommand; |
71 73 | import org.eclipse.jgit.api.errors.GitAPIException; |
72 74 | import org.eclipse.jgit.api.errors.JGitInternalException; |
73 75 | import org.eclipse.jgit.lib.GpgConfig; |
74 76 | import org.eclipse.jgit.lib.StoredConfig; |
75 77 | import org.eclipse.jgit.revwalk.RevCommit; |
76 78 | import org.eclipse.jgit.transport.FetchResult; |
77 79 | import org.eclipse.jgit.transport.RefSpec; |
78 80 | import org.spigotmc.mapper.MapUtil; |
97 99 | private static String applyPatchesShell = "sh"; |
98 100 | private static boolean didClone = false; |
99 101 | // |
100 102 | private static BuildInfo buildInfo = BuildInfo.DEV; |
101 103 | // |
102 104 | private static File msysDir; |
103 105 | private static File maven; |
104 106 | |
105 107 | public static void main(String[] args) throws Exception |
106 108 | { |
109 + | long start = System.nanoTime(); |
107 110 | System.out.println( Arrays.toString( args ) ); |
108 111 | |
109 112 | // May be null |
110 113 | String buildVersion = Builder.class.getPackage().getImplementationVersion(); |
111 114 | int buildNumber = -1; |
112 115 | if ( buildVersion != null ) |
113 116 | { |
114 117 | String[] split = buildVersion.split( "-" ); |
115 118 | if ( split.length == 4 ) |
116 119 | { |
720 723 | System.err.println( "If this does not resolve your issue then please pastebin the entire " + LOG_FILE + " file when seeking support." ); |
721 724 | ex.printStackTrace(); |
722 725 | System.exit( 1 ); |
723 726 | } |
724 727 | |
725 728 | for ( int i = 0; i < 35; i++ ) |
726 729 | { |
727 730 | System.out.println( " " ); |
728 731 | } |
729 732 | |
733 + | long end = System.nanoTime(); |
734 + | long duration = TimeUnit.NANOSECONDS.toMillis( end - start ); |
735 + | |
736 + | if ( duration / 1000F >= 60 ) |
737 + | { |
738 + | System.out.println( "Total Time: " + DurationFormatUtils.formatDurationWords( duration, true, true ) ); |
739 + | } else |
740 + | { |
741 + | System.out.println( "Total Time: " + DurationFormatUtils.formatDuration( duration, "s.SS' seconds'" ) ); |
742 + | } |
743 + | |
744 + | System.out.println(); |
730 745 | System.out.println( "Success! Everything completed successfully. Copying final .jar files now." ); |
731 746 | |
732 747 | String fileExtension = ".jar"; |
733 748 | String snapshot = "-SNAPSHOT"; |
734 749 | String experimental = "-experimental"; |
735 750 | |
736 751 | String base = ( versionInfo.getSpigotVersion() != null ) ? "-" + versionInfo.getSpigotVersion() : ""; |
737 752 | String bootstrap = ( versionInfo.getToolsVersion() >= 138 ) ? "-bootstrap" : ""; |
738 753 | String suffix = base + bootstrap + fileExtension; |
739 754 | |