Skip to content

Build using Toothpick scripts#122

Merged
jpenilla merged 22 commits into
ver/1.16.4from
build/toothpick
Dec 18, 2020
Merged

Build using Toothpick scripts#122
jpenilla merged 22 commits into
ver/1.16.4from
build/toothpick

Conversation

@jpenilla

@jpenilla jpenilla commented Dec 15, 2020

Copy link
Copy Markdown
Contributor

This PR replaces the byof scripts with kotlin gradle buildscripts.

It uses a custom plugin, "Toothpick", which adds multiple gradle tasks to assist in patching and building the Purpur server and api.

The Toothpick plugin used in this PR is modified from mikroskeemsrealm/Toothpick, with some inspiration taken from MiniDigger/Toothpick.

gradle tasks added by Toothpick:

  • initGitSubmodules
    • Initializes the Paper submodule if it has not been initialized yet
  • setupUpstream
    • Apply Paper patches, i.e. paper patch in the Paper directory. Similar to purpur up. Will initialize the Paper submodule as a dependency of this task if necessary.
  • applyPatches
    • Applies Purpur api and server patches on top of Paper, similar to purpur patch. If Paper is not yet setup that will be done as a dependency of this task.
  • rebuildPatches
    • Deletes all patches and rebuilds them from the current state of the Purpur-Server and Purpur-API repos (purpur rebuild)
  • paperclip
    • Builds the server, then builds a paperclip and saves it to the root project directory
  • updateUpstream
    • Update and patch the Paper submodule. Would usually then be followed by applyPatches, resolving conflicts, then running scripts/upstreamCommit.sh
  • upstreamCommit
    • Replacement for upstreamCommit.sh, will create a commit with the changes to the upstream submodule.
  • importMCDev
    • This is a task which is depended upon by applyPatches, and would usually not be run manually. Imports needed NMS and library files that we want to make changes to.

Notable tasks not added by Toothpick:

  • build
    • This is a standard gradle task which has been setup to build the server and api.
  • publishToMavenLocal
    • Builds and publishes the purpur and purpur-api artifacts to the maven local repo.

Setting up a workspace is quite simple, just clone the repo and run the applyPatches task (./gradlew applyPatches)

@jpenilla jpenilla force-pushed the build/toothpick branch 2 times, most recently from 386c124 to 0be39a1 Compare December 15, 2020 13:17
@PurpurMC PurpurMC deleted a comment from Titaniumtown Dec 15, 2020
@PurpurMC PurpurMC deleted a comment from Titaniumtown Dec 15, 2020
@katekerllenevich

Copy link
Copy Markdown
Member

heyo! on windows when i run setupPaper through git bash, it says something about needing to have virtualization enabled. not sure if thats a gradle thing in general, but this breaks a couple applications on my pc. not vital, but something to take note of.

@jpenilla jpenilla added the enhancement New feature or request label Dec 16, 2020
@jpenilla jpenilla marked this pull request as ready for review December 18, 2020 03:07
@jpenilla jpenilla merged commit 69c6484 into ver/1.16.4 Dec 18, 2020
@jpenilla jpenilla deleted the build/toothpick branch December 18, 2020 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants