summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-12-14 19:57:43 +1100
committermd_5 <git@md-5.net>2018-12-14 19:57:43 +1100
commit7d838a5884a645af308a4c4acbd1dbab16514f59 (patch)
treef018661851fd1c01d7332ff2c87487a1b79188cd /src/main
parent08e1bad1f167b871e390143b5453be0b59e3303c (diff)
downloadbuildtools-7d838a5884a645af308a4c4acbd1dbab16514f59.tar
buildtools-7d838a5884a645af308a4c4acbd1dbab16514f59.tar.gz
buildtools-7d838a5884a645af308a4c4acbd1dbab16514f59.tar.lz
buildtools-7d838a5884a645af308a4c4acbd1dbab16514f59.tar.xz
buildtools-7d838a5884a645af308a4c4acbd1dbab16514f59.zip
Create work/decompile-latest symbolic link where possible
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/spigotmc/builder/Builder.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java
index cd466e0..b1cb149 100644
--- a/src/main/java/org/spigotmc/builder/Builder.java
+++ b/src/main/java/org/spigotmc/builder/Builder.java
@@ -34,6 +34,7 @@ import java.lang.management.ManagementFactory;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
+import java.nio.file.Path;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -434,6 +435,20 @@ public class Builder
runProcess( CWD, MessageFormat.format( versionInfo.getDecompileCommand(), clazzDir.getPath(), decompileDir.getPath() ).split( " " ) );
}
+ try
+ {
+ File latestLink = new File( workDir, "decompile-latest" );
+ latestLink.delete();
+
+ java.nio.file.Files.createSymbolicLink( latestLink.toPath(), decompileDir.getParentFile().toPath().relativize( decompileDir.toPath() ) );
+ } catch ( UnsupportedOperationException ex )
+ {
+ // Ignore on Windows etc
+ } catch ( IOException ex )
+ {
+ System.err.println( "Failed to create decompile-latest link " + ex.getMessage() );
+ }
+
System.out.println( "Applying CraftBukkit Patches" );
File nmsDir = new File( craftBukkit, "src/main/java/net" );
if ( nmsDir.exists() )