From 7d838a5884a645af308a4c4acbd1dbab16514f59 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 14 Dec 2018 19:57:43 +1100 Subject: Create work/decompile-latest symbolic link where possible --- src/main/java/org/spigotmc/builder/Builder.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/main/java/org') 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() ) -- cgit v1.2.3