Cloning, Building and Compiling the Spigot Source - Historical

Applied By Z750: Jan 26, 2014 at 12:39 AM

Cloning, Building and Compiling the Spigot Source
Cloning, Building and Compiling the Spigot source
Prerequisites:

  • Basic Git Knowledge
  • A unix based system or Cygwin
  • Maven 3.0.5 with a path setup

Getting the Source:
  1. First, start by cloning the Spigot source, or your fork of the Spigot source.
  2. Next, switch to whichever branch you wish to build off using "git checkout <branch>" (Master, snapshot, test branches, etc.)
  3. Initiate an update of the downstream Bukkit and Craftbukkit builds via "git submodule update --init"
  4. 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.
  5. 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:
  1. 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.
  2. 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:
  1. Go into the directory of whichever part of Spigot (API/Server) you made your changes to.
  2. Bring your changed files to the stage and commit them locally.
  3. Head back to the root directory and execute the ./rebuildPatches.sh file.
  4. You can now find your .patch in the relevant folder ((Craft)Bukkit-patches) within the root directory.