Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Merge staging/1.16.5 (#371)
Browse files Browse the repository at this point in the history
* add config for sand duping (#352)

* Lithium: cache chunk gen sea level (#349)

based off: CaffeineMC/lithium-fabric@a55cfd1

* PaperPR: Inline shift fields in EnumDirection (#350)

* Introducing: Yatoclip (#360)

* New async nbt cache (#347)

* update pom

* whoops

* Try to address path issue and improve Jenkins build speed

* Detailed lag and crash reports (#369)

Added "Suspected Plugins" to Watchdog and crash reports

* Drop sand duping

* Add branch specific versions

* Remove copyright

* Revert mysql-connector-java version bump

* Small fixes

* More detailed lag and crash reports

* Don't use branch information when generating metadata

* Fix Jenkins Builds version command

* Fixup patches

* Fix patch notes

* Pull Request compatibility for branch detection

* Fix Pull Request compatibility for branch detection

* Set context classloader before launch

* Inject server jar to SystemClassLoader before launch

* Try fix compile in java8

* Run tests on CodeMC and Github Actions

Co-authored-by: Simon Gardling <Titaniumtown@gmail.com>
Co-authored-by: Zoe <duplexsys@protonmail.com>
Co-authored-by: Hugo Planque <12386279+HookWoods@users.noreply.github.com>
  • Loading branch information
4 people committed Feb 1, 2021
1 parent 2e12bc7 commit c2fd399
Show file tree
Hide file tree
Showing 33 changed files with 2,206 additions and 130 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ jobs:
fail-fast: false

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
Expand Down Expand Up @@ -80,12 +75,12 @@ jobs:

- name: Build Yatopia
run: |
./gradlew paperclip
./gradlew clean build yatoclip
- name: Upload Artifact
if: github.ref != 'refs/heads/ver/1.16.4'
uses: actions/upload-artifact@v2
with:
name: Yatopia-${{ matrix.java }}
path: yatopia-1.16.5-paperclip.jar
path: yatopia-1.16.5-yatoclip.jar

165 changes: 74 additions & 91 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,91 +1,74 @@
pipeline {
agent { label 'slave' }
options { timestamps() }
stages {
stage('Cleanup') {
steps {
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
sh 'rm -rf ./target'
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
sh 'chmod +x ./gradlew'
}
}
stage('Init project & submodules') {
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT',
) {
sh './gradlew initGitSubmodules'
}
}
}
stage('Decompile & apply patches') {
tools {
jdk "OpenJDK 8"
}
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT',
) {
sh '''
./gradlew setupUpstream
./gradlew applyPatches
'''
}
}
}
stage('Build') {
tools {
jdk "OpenJDK 8"
}
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT'
) {
withCredentials([usernamePassword(credentialsId: 'jenkins-deploy', usernameVariable: 'ORG_GRADLE_PROJECT_mavenUsername', passwordVariable: 'ORG_GRADLE_PROJECT_mavenPassword')]) {
sh '''
./gradlew build
./gradlew publish
'''
}
}
}
}
stage('Build Launcher') {
tools {
jdk "OpenJDK 8"
}
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT'
) {
sh '''
mkdir -p "./target"
./gradlew paperclip
basedir=$(pwd)
paperworkdir="$basedir/Paper/work"
mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
cp "yatopia-$mcver-paperclip.jar" "./target/yatopia-$mcver-paperclip-b$BUILD_NUMBER.jar"
'''
}
}
post {
success {
archiveArtifacts "target/*.jar"
}
failure {
cleanWs()
}
}
}
}
}
pipeline {
agent { label 'slave' }
options { timestamps() }
stages {
stage('Cleanup') {
steps {
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
sh 'rm -rf ./target'
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
sh 'chmod +x ./gradlew'
}
}
stage('Init project & submodules') {
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT',
) {
sh './gradlew initGitSubmodules'
}
}
}
stage('Decompile & apply patches') {
tools {
jdk "OpenJDK 8"
}
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT',
) {
sh '''
./gradlew setupUpstream
./gradlew applyPatches
'''
}
}
}
stage('Build') {
tools {
jdk "OpenJDK 8"
}
steps {
withMaven(
maven: '3',
mavenLocalRepo: '.repository',
publisherStrategy: 'EXPLICIT'
) {
withCredentials([usernamePassword(credentialsId: 'jenkins-deploy', usernameVariable: 'ORG_GRADLE_PROJECT_mavenUsername', passwordVariable: 'ORG_GRADLE_PROJECT_mavenPassword')]) {
sh '''
./gradlew clean build yatoclip publish
mkdir -p "./target"
basedir=$(pwd)
paperworkdir="$basedir/Paper/work"
mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
cp "yatopia-$mcver-yatoclip.jar" "./target/yatopia-$mcver-yatoclip-b$BUILD_NUMBER.jar"
'''
}
}
}
post {
success {
archiveArtifacts "target/*.jar"
}
failure {
cleanWs()
}
}
}
}
}
5 changes: 5 additions & 0 deletions PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This is an overview over all patches that are currently used.

| Side | Patch | Author | CoAuthors |
| ----- | ------------- |:-------------:| -----:|
| server | (PaperPR) Inline shift direction fields | Andrew Steinborn | |
| server | AFK API | William Blake Galbreath | |
| api | AFK API | William Blake Galbreath | |
| server | Ability to re-add farmland mechanics from Alpha | Yive | |
Expand Down Expand Up @@ -240,6 +241,7 @@ This is an overview over all patches that are currently used.
| server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | |
| server | Multi-Threaded ticking CraftBukkit | Spottedleaf | |
| server | Name craft scheduler threads according to the plugin using | Spottedleaf | |
| server | New nbt cache | Hugo Planque | ishland |
| server | Nuke streams off BlockPosition | Ivan Pekov | |
| server | Nuke streams off SectionPosition | Ivan Pekov | |
| server | Optimise EntityInsentient#checkDespawn | Spottedleaf | |
Expand Down Expand Up @@ -339,6 +341,8 @@ This is an overview over all patches that are currently used.
| server | Stop wasting resources on JsonList#get | Ivan Pekov | |
| server | Striders give saddle back | Ben Kerllenevich | |
| server | Strip raytracing for EntityLiving#hasLineOfSight | Paul Sauve | |
| server | Suspected plugins report | ishland | |
| api | Suspected plugins report | ishland | |
| server | Swap priority of checks in chunk ticking | Paul Sauve | |
| server | Time scoreboard search | Spottedleaf | |
| server | Timings stuff | William Blake Galbreath | |
Expand Down Expand Up @@ -374,3 +378,4 @@ This is an overview over all patches that are currently used.
| server | lithium VoronoiBiomeAccessTypeMixin | JellySquid | |
| server | lithium enum_values | JellySquid | |
| server | lithium reduce allocations | JellySquid | Mykyta Komarnytskyy |
| server | lithium: cache chunk gen sea level | SuperCoder7979 | |
11 changes: 11 additions & 0 deletions Yatoclip/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repositories {
mavenCentral()
maven("https://jitpack.io/")
}

dependencies {
implementation("com.github.ishlandbukkit:jbsdiff:deff66b794")
implementation("com.google.code.gson:gson:2.8.6")
implementation("commons-io:commons-io:2.8.0")
}

28 changes: 28 additions & 0 deletions Yatoclip/src/java9/java/org/yatopiamc/yatoclip/YatoclipLaunch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.yatopiamc.yatoclip;

import java.lang.instrument.Instrumentation;
import java.nio.file.Path;
import java.util.jar.JarFile;

public class YatoclipLaunch {

private static Instrumentation inst = null;

public static void premain(String args, Instrumentation inst) {
YatoclipLaunch.inst = inst;
}

public static void agentmain(final String agentArgs, final Instrumentation inst) {
YatoclipLaunch.inst = inst;
}

@SuppressWarnings("unused")
static void injectClasspath(Path setup) throws Throwable {
if(inst == null) {
throw new RuntimeException("Instrumentation API handle not found");
}
inst.appendToSystemClassLoaderSearch(new JarFile(setup.toFile()));
inst = null;
}

}
51 changes: 51 additions & 0 deletions Yatoclip/src/main/java/org/yatopiamc/yatoclip/PatchesMetadata.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.yatopiamc.yatoclip;

import java.io.Serializable;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;

public class PatchesMetadata {

public final Set<PatchMetadata> patches;
public final Set<Relocation> relocations;
public final Set<String> copyExcludes;

public PatchesMetadata(Set<PatchMetadata> patches, Set<Relocation> relocations, Set<String> copyExcludes) {
Objects.requireNonNull(copyExcludes);
this.copyExcludes = Collections.unmodifiableSet(copyExcludes);
Objects.requireNonNull(relocations);
this.relocations = Collections.unmodifiableSet(relocations);
Objects.requireNonNull(patches);
this.patches = Collections.unmodifiableSet(patches);
}

public static class PatchMetadata {
public final String name;
public final String originalHash;
public final String targetHash;
public final String patchHash;

public PatchMetadata(String name, String originalHash, String targetHash, String patchHash) {
this.name = name;
this.originalHash = originalHash;
this.targetHash = targetHash;
this.patchHash = patchHash;
}
}

public static class Relocation implements Serializable {

public final String from;
public final String to;
public final boolean includeSubPackages;

public Relocation(String from, String to, boolean includeSubPackages) {
Objects.requireNonNull(from);
Objects.requireNonNull(to);
this.from = from.replaceAll("\\.", "/");
this.to = to.replaceAll("\\.", "/");
this.includeSubPackages = includeSubPackages;
}
}
}
Loading

0 comments on commit c2fd399

Please sign in to comment.