Commits

DemonWav authored b653222d5a3
Testing removal of duplicate cloned repos
No tags

src/main/java/org/spigotmc/builder/Builder.java

Modified
111 111 runProcess( CWD, "git", "config", "--global", "user.email" );
112 112 } catch ( Exception ex )
113 113 {
114 114 System.out.println( "Git email not set, setting it to default value." );
115 115 runProcess( CWD, "git", "config", "--global", "user.email", "unconfigured@null.spigotmc.org" );
116 116 }
117 117
118 118 File workDir = new File( "work" );
119 119 workDir.mkdir();
120 120
121 - File bukkit = new File( "Bukkit" );
121 + File spigot = new File( "Spigot" );
122 + if ( !spigot.exists() )
123 + {
124 + clone( "https://hub.spigotmc.org/stash/scm/spigot/spigot.git", spigot );
125 + }
126 +
127 + File bukkit = new File( spigot, "Bukkit" );
122 128 if ( !bukkit.exists() )
123 129 {
124 130 clone( "https://hub.spigotmc.org/stash/scm/spigot/bukkit.git", bukkit );
125 131 }
126 132
127 - File craftBukkit = new File( "CraftBukkit" );
133 + File craftBukkit = new File( spigot, "CraftBukkit" );
128 134 if ( !craftBukkit.exists() )
129 135 {
130 136 clone( "https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git", craftBukkit );
131 137 }
132 138
133 - File spigot = new File( "Spigot" );
134 - if ( !spigot.exists() )
135 - {
136 - clone( "https://hub.spigotmc.org/stash/scm/spigot/spigot.git", spigot );
137 - }
138 -
139 139 File buildData = new File( "BuildData" );
140 140 if ( !buildData.exists() )
141 141 {
142 142 clone( "https://hub.spigotmc.org/stash/scm/spigot/builddata.git", buildData );
143 143 }
144 144
145 145 if ( !jacobeDir.exists() )
146 146 {
147 147 System.out.println( "Jacobe does not exist, downloading" );
148 148 getJacobe();
263 263 List<?> modifiedLines = DiffUtils.patch( Files.readLines( clean, Charsets.UTF_8 ), parsedPatch );
264 264
265 265 BufferedWriter bw = new BufferedWriter( new FileWriter( t ) );
266 266 for ( String line : (List<String>) modifiedLines )
267 267 {
268 268 bw.write( line );
269 269 bw.newLine();
270 270 }
271 271 bw.close();
272 272 }
273 - File tmpNms = new File( craftBukkit, "tmp-nms" );
274 - FileUtils.copyDirectory( nmsDir, tmpNms );
273 + //File tmpNms = new File( craftBukkit, "tmp-nms" );
274 + //FileUtils.copyDirectory( nmsDir, tmpNms );
275 275
276 276 craftBukkitGit.branchDelete().setBranchNames( "patched" ).setForce( true ).call();
277 277 craftBukkitGit.checkout().setCreateBranch( true ).setForce( true ).setName( "patched" ).call();
278 278 craftBukkitGit.add().addFilepattern( "src/main/java/net/" ).call();
279 279 craftBukkitGit.commit().setMessage( "CraftBukkit $ " + new Date() ).call();
280 - craftBukkitGit.checkout().setName( "master" ).call();
280 + //craftBukkitGit.checkout().setName( "master" ).call();
281 281
282 - FileUtils.moveDirectory( tmpNms, nmsDir );
282 + //FileUtils.moveDirectory( tmpNms, nmsDir );
283 283
284 - File spigotApi = new File( spigot, "Bukkit" );
285 - if ( !spigotApi.exists() )
286 - {
287 - clone( "file://" + bukkit.getAbsolutePath(), spigotApi );
288 - }
289 - File spigotServer = new File( spigot, "CraftBukkit" );
290 - if ( !spigotServer.exists() )
291 - {
292 - clone( "file://" + craftBukkit.getAbsolutePath(), spigotServer );
293 - }
284 + //File spigotApi = new File( spigot, "Bukkit" );
285 + //if ( !spigotApi.exists() )
286 + //{
287 + // clone( "file://" + bukkit.getAbsolutePath(), spigotApi );
288 + //}
289 + //File spigotServer = new File( spigot, "CraftBukkit" );
290 + //if ( !spigotServer.exists() )
291 + //{
292 + // clone( "file://" + craftBukkit.getAbsolutePath(), spigotServer );
293 + //}
294 294
295 295 // Git spigotApiGit = Git.open( spigotApi );
296 296 // Git spigotServerGit = Git.open( spigotServer );
297 297 if ( !skipCompile )
298 298 {
299 299 System.out.println( "Compiling Bukkit" );
300 300 runProcess( bukkit, "sh", mvn, "clean", "install" );
301 301
302 302 System.out.println( "Compiling CraftBukkit" );
303 303 runProcess( craftBukkit, "sh", mvn, "clean", "install" );
318 318 System.err.println( "Error compiling Spigot, are you running this jar via msysgit?" );
319 319 ex.printStackTrace();
320 320 System.exit( 1 );
321 321 }
322 322
323 323 for ( int i = 0; i < 35; i++ )
324 324 {
325 325 System.out.println( " " );
326 326 }
327 327 System.out.println( "Success! Everything compiled successfully. Copying final .jar files now." );
328 - copyJar( "CraftBukkit/target", "craftbukkit", "craftbukkit-" + MC_VERSION + ".jar" );
329 - copyJar( "Spigot/Spigot-Server/target", "spigot", "spigot-" + MC_VERSION + ".jar" );
328 + copyJar( new File( craftBukkit, "target" ).getAbsolutePath(), "craftbukkit", "craftbukkit-" + MC_VERSION + ".jar" );
329 + copyJar( new File( spigot, "Spigot-Server/target" ).getAbsolutePath(), "spigot", "spigot-" + MC_VERSION + ".jar" );
330 330 }
331 331
332 332 public static void copyJar(String path, final String jarPrefix, String outJarName) throws Exception
333 333 {
334 334 File[] files = new File( path ).listFiles( new FilenameFilter()
335 335 {
336 336 @Override
337 337 public boolean accept(File dir, String name)
338 338 {
339 339 return name.startsWith( jarPrefix ) && name.endsWith( ".jar" );

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut