Commits
43 43 | import javax.net.ssl.HttpsURLConnection; |
44 44 | import javax.net.ssl.SSLContext; |
45 45 | import javax.net.ssl.SSLSession; |
46 46 | import javax.net.ssl.TrustManager; |
47 47 | import javax.net.ssl.X509TrustManager; |
48 48 | |
49 49 | import joptsimple.OptionParser; |
50 50 | import joptsimple.OptionSet; |
51 51 | import joptsimple.OptionSpec; |
52 52 | import lombok.RequiredArgsConstructor; |
53 + | import org.apache.commons.io.FileExistsException; |
53 54 | import org.apache.commons.io.FileUtils; |
54 55 | import org.apache.commons.io.output.TeeOutputStream; |
55 56 | import org.eclipse.jgit.api.Git; |
56 57 | import org.eclipse.jgit.api.ResetCommand; |
57 58 | import org.eclipse.jgit.api.errors.GitAPIException; |
58 59 | import org.eclipse.jgit.revwalk.RevCommit; |
59 60 | |
60 61 | public class Builder |
61 62 | { |
62 63 | |
345 346 | } |
346 347 | File tmpNms = new File( craftBukkit, "tmp-nms" ); |
347 348 | FileUtils.copyDirectory( nmsDir, tmpNms ); |
348 349 | |
349 350 | craftBukkitGit.branchDelete().setBranchNames( "patched" ).setForce( true ).call(); |
350 351 | craftBukkitGit.checkout().setCreateBranch( true ).setForce( true ).setName( "patched" ).call(); |
351 352 | craftBukkitGit.add().addFilepattern( "src/main/java/net/" ).call(); |
352 353 | craftBukkitGit.commit().setMessage( "CraftBukkit $ " + new Date() ).call(); |
353 354 | craftBukkitGit.checkout().setName( buildInfo.getRefs().getCraftBukkit() ).call(); |
354 355 | |
355 - | FileUtils.moveDirectory( tmpNms, nmsDir ); |
356 + | try { |
357 + | FileUtils.moveDirectory( tmpNms, nmsDir ); |
358 + | }catch(FileExistsException e) { |
359 + | FileUtils.deleteQuietly( nmsDir ); |
360 + | FileUtils.moveDirectory( tmpNms, nmsDir ); |
361 + | } |
356 362 | |
357 363 | File spigotApi = new File( spigot, "Bukkit" ); |
358 364 | if ( !spigotApi.exists() ) |
359 365 | { |
360 366 | clone( "file://" + bukkit.getAbsolutePath(), spigotApi ); |
361 367 | } |
362 368 | File spigotServer = new File( spigot, "CraftBukkit" ); |
363 369 | if ( !spigotServer.exists() ) |
364 370 | { |
365 371 | clone( "file://" + craftBukkit.getAbsolutePath(), spigotServer ); |