Cloning, Building and Compiling the Spigot Source - Historical

Applied By Dmck2b: Jun 21, 2014 at 12:53 PM

Cloning, Building and Compiling the Spigot Source
Cloning, Building and Compiling the Spigot source
Prerequisites
  • Basic Git Knowledge
  • A unix based system or a bash interpreter (such as Cygwin, git bash, etc.)
  • Maven 3.0.5 with a path setup

Getting the Source
First, start by cloning the Spigot source, or your fork of the Spigot source.

Next, switch to whichever branch you wish to build off using "git checkout <branch>" (Master, snapshot, test branches, etc.)

Initiate an update of the downstream Bukkit and Craftbukkit builds via "git submodule update --init"

Once it has finished downloading, you can now apply the Spigot patches by executing the "./applyPatches.sh" file in the root of the source folder.

Once this is finished, you now have a full, ready to use copy of the spigot source under Spigot-Server and Spigot-API.

Building Spigot
Once you have finished editing your changes in your IDE or text editing program of choice, go back the the root of the source and using maven, do a clean build ("mvn clean install") and let it run.

You can now find your custom Spigot build in ./Spigot/Spigot-Server/target/spigot-genericMinecraftVersion-GenericBukkitBuildVersion.jar

Creating a patch file for commit or local usage
Go into the directory of whichever part of Spigot (API/Server) you made your changes to.

Bring your changed files to the stage and commit them locally.

Head back to the root directory and execute the ./rebuildPatches.sh file.

You can now find your .patch in the relevant folder ((Craft)Bukkit-patches) within the root directory as the last patch file (assuming you did not play with time or use multiple commits.)