This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add config for sand duping (#352) * Lithium: cache chunk gen sea level (#349) based off: CaffeineMC/lithium@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 <[email protected]> Co-authored-by: Zoe <[email protected]> Co-authored-by: Hugo Planque <[email protected]>
- Loading branch information
1 parent
2e12bc7
commit c2fd399
Showing
33 changed files
with
2,206 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,11 +29,6 @@ jobs: | |
fail-fast: false | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
Yatoclip/src/java9/java/org/yatopiamc/yatoclip/YatoclipLaunch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
51
Yatoclip/src/main/java/org/yatopiamc/yatoclip/PatchesMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
Oops, something went wrong.