mirror of
https://hub.spigotmc.org/stash/scm/spigot/buildtools.git
synced 2025-04-13 09:31:28 +00:00
#57: Add total time it took to run BuildTools
This commit is contained in:
parent
9ce73a3d05
commit
7157aadff5
2 changed files with 21 additions and 0 deletions
6
pom.xml
6
pom.xml
|
@ -90,6 +90,12 @@
|
||||||
<version>1.4.2</version>
|
<version>1.4.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.14.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -51,6 +51,7 @@ import java.util.Enumeration;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
|
@ -66,6 +67,7 @@ import joptsimple.util.EnumConverter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.commons.io.output.TeeOutputStream;
|
import org.apache.commons.io.output.TeeOutputStream;
|
||||||
|
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||||
import org.eclipse.jgit.api.Git;
|
import org.eclipse.jgit.api.Git;
|
||||||
import org.eclipse.jgit.api.ResetCommand;
|
import org.eclipse.jgit.api.ResetCommand;
|
||||||
import org.eclipse.jgit.api.errors.GitAPIException;
|
import org.eclipse.jgit.api.errors.GitAPIException;
|
||||||
|
@ -104,6 +106,7 @@ public class Builder
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception
|
public static void main(String[] args) throws Exception
|
||||||
{
|
{
|
||||||
|
long start = System.nanoTime();
|
||||||
System.out.println( Arrays.toString( args ) );
|
System.out.println( Arrays.toString( args ) );
|
||||||
|
|
||||||
// May be null
|
// May be null
|
||||||
|
@ -727,6 +730,18 @@ public class Builder
|
||||||
System.out.println( " " );
|
System.out.println( " " );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long end = System.nanoTime();
|
||||||
|
long duration = TimeUnit.NANOSECONDS.toMillis( end - start );
|
||||||
|
|
||||||
|
if ( duration / 1000F >= 60 )
|
||||||
|
{
|
||||||
|
System.out.println( "Total Time: " + DurationFormatUtils.formatDurationWords( duration, true, true ) );
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
System.out.println( "Total Time: " + DurationFormatUtils.formatDuration( duration, "s.SS' seconds'" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
System.out.println( "Success! Everything completed successfully. Copying final .jar files now." );
|
System.out.println( "Success! Everything completed successfully. Copying final .jar files now." );
|
||||||
|
|
||||||
String fileExtension = ".jar";
|
String fileExtension = ".jar";
|
||||||
|
|
Loading…
Add table
Reference in a new issue