Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexeption committed Aug 18, 2019
0 parents commit 82c9dc0
Show file tree
Hide file tree
Showing 1,511 changed files with 149,981 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# CMake
cmake-build-*/

# File-based project format
*.iws

# IntelliJ
out/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Gradle template
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# We don't need those .rej files
*.rej

### Kettle
/projects/
/bin/

### IDEs
/.idea/
.classpath
.project
/.settings/
classes/

run/
42 changes: 42 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
image: openjdk:8-jdk

stages:
- setup
- test
- build

before_script:
# - echo `pwd` # debug
# - echo "$CI_BUILD_NAME, $CI_BUILD_REF_NAME $CI_BUILD_STAGE" # debug
- export GRADLE_USER_HOME=`pwd`/.gradle
- git submodule sync --recursive
- git submodule update --init --recursive

cache:
paths:
- .gradle/wrapper
- .gradle/caches

setup:
stage: setup
script:
- chmod +x gradlew && ./gradlew setup
- mv src/main/java/org* projects/Kettle/src/main/java

test:
stage: test
script:
- chmod +x gradlew && ./gradlew check

build:
stage: build
script:
- chmod +x gradlew && ./gradlew build githubRelease
only:
- master
artifacts:
paths:
- build/distributions/*.jar

after_script:
- echo "End CI"
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "forge"]
path = forge
url = https://github.com/MinecraftForge/MinecraftForge.git
branch = 1.12.x
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
![Magma](https://img.hexeption.co.uk/magma-new.png)

# Magma

![](https://img.shields.io/badge/Minecraft%20Forge-1.12.2%20--%202838-orange.svg?style=for-the-badge) [![](https://img.shields.io/jenkins/build/https/ci.hexeption.co.uk/job/Magma?label=CI&style=for-the-badge)](https://ci.hexeption.co.uk)

### What's Magma?

Magma next generation in hybrid servers.

Kettle is based on Forge and Paper builds, meaning it can run both Craftbukkit/Spigot/Paper-based plugins and forge-based mods.

We hope to eliminate all issues with craftbukkit forge servers. In the end, we envision a seamless, low lag Kettle experience with support for new 1.12+ versions of Minecraft.

## Deployment

### Installation

1. Download the recommended builds from the [**Releases** section](https://github.com/KettleFoundation/Kettle/releases)
1. Download Beta builds from the [**CI**](https://ci.hexeption.co.uk/job/Magma/)
2. Make a new folder for the server
3. Move the jar to the folder
4. Run the jar

### Building the sources

All builds are available in `build/distributions`

- Clone the Project
- You can use GitHub Desktop/GitKraken or clone using the terminal
- `git clone https://github.com/KettleFoundation/Kettle`
- Next you are gonna want to clone the submodule
- `git submodule update --init --recursive`
- Building
- First you want to setup the project
- `./gradlew setup`
- After you have setup the project you are going to want to run the build
- `./gradlew build`
- Now go and get a drink this may take some time

## Chat

You are welcome to visit Kettle Discord server [here](https://discord.gg/RqDjbcM).

## Unstable/Test builds

For unstable/test builds you can check the [__CI__](https://ci.hexeption.co.uk/job/Magma)
253 changes: 253 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://jcenter.bintray.com"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3+'
classpath 'net.nemerosa:versioning:2.7.1'
classpath "gradle.plugin.com.github.breadmoirai:github-release:2.2.4"
}
}

apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "idea"
apply plugin: 'net.minecraftforge.gradle.patcher'
apply plugin: 'net.minecraftforge.gradle.launch4j'
apply plugin: 'net.nemerosa.versioning'
apply plugin: "com.github.breadmoirai.github-release"

group 'kettlefoundation'
version 'git-' + versioning.info.branch + "-" + versioning.info.build

repositories {
clear()
mavenCentral()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name 'minecraft'
url 'https://libraries.minecraft.net/'
}
maven {
name 'maven'
url 'https://mvnrepository.com/artifact/'
}
maven {
name 'KettleFoundation'
url 'https://repo.hexeption.co.uk/artifactory/Kettle/'
}
flatDir {
dirs 'src/main/resources'
}
}

configurations{
compile.extendsFrom exported
libraries
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile(group: 'bukkit', name: 'bukkit', version: '1.12.2-R0.1')
}

jar{
into('lib') {
from configurations.libraries
}
exclude "**/configurations/**"
exclude "**/META-INF/**"
exclude "log4j2.xml"
}

minecraft {
version = "1.12.2"
mappings = "snapshot_nodoc_20171003"
workspaceDir = "projects"
versionJson = "jsons/1.12.2-dev.json"
buildUserdev = true
buildInstaller = false
installerVersion = "1.5"

def common = {
patchPrefixOriginal "../src-base/minecraft"
patchPrefixChanged "../src-work/minecraft"
mainClassServer "net.minecraft.launchwrapper.Launch"
tweakClassServer "net.minecraftforge.fml.common.launcher.FMLServerTweaker"
}

projects {
forge {
rootDir "forge/"
patchDir "forge/patches/minecraft/"
patchAfter "clean"
genPatchesFrom "clean"
genMcpPatches = false
applyMcpPatches = false
s2sKeepImports = true
with common
}

kettle {
rootDir "."
patchDir "patches/"
patchAfter "forge"
genPatchesFrom "forge"
genMcpPatches = true
applyMcpPatches = true
s2sKeepImports = true
with common
}
}
}

sourceCompatibility = 1.8
tasks.generateXmlConfig.dependsOn installer
tasks.compileJava.enabled = false
tasks.build.dependsOn 'launch4j'
tasks.reobfuscate.setProperty("extraSrg",["PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_12_R1"])

installer {
classifier = 'installer'
from "forge/src/main/resources/forge_logo.png"
rename "forge_logo\\.png", "big_logo.png"
}

launch4j {
jar = installer.archivePath.canonicalPath
outfile = file("build/distributions/${project.name}-${project.version}-installer-win.exe").canonicalPath
icon = file('icon.ico').canonicalPath
manifest = file('l4jManifest.xml').canonicalPath
jreMinVersion = '1.8.0'
initialHeapPercent = 5
maxHeapPercent = 100
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

task signUniversal(type: SignJar, dependsOn: 'outputJar') {
onlyIf {
project.hasProperty('jarsigner')
}

def jarsigner = [:]

if (project.hasProperty('jarsigner'))
jarsigner = project.jarsigner

alias = 'forge'
exclude "paulscode/**"
storePass = jarsigner.storepass
keyPass = jarsigner.keypass
keyStore = jarsigner.keystore
inputFile = outputJar.archivePath
outputFile = outputJar.archivePath
}
build.dependsOn signUniversal
installer.dependsOn signUniversal

outputJar {
classifier = 'universal'

manifest.attributes([
"Implementation-Title": "Kettle",
"Implementation-Version": version,
"Main-Class": "net.minecraftforge.fml.relauncher.ServerLaunchWrapper",
"TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
"Class-Path": getServerClasspath(file("jsons/1.12.2-rel.json"))
])
}

processJson {
releaseJson = "jsons/1.12.2-rel.json"
addReplacements([
"@minecraft_version@": project.minecraft.version,
"@version@": project.version,
"@project@": "kettle",
"@artifact@": "kf:kettle:${project.version}",
"@universal_jar@": { outputJar.archiveName },
"@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
])
}

extractForgeSources {
exclude "**/SideOnly.java", "**/Side.java"
}

genGradleProjects {
addCompileDep "junit:junit:4.12"
addCompileDep "bukkit:bukkit:1.12.2-R0.1"
addRepo("KettleFoundation", "https://repo.hexeption.co.uk/artifactory/Kettle/")
}

import groovy.json.JsonSlurper

import java.util.stream.Collectors

String getServerClasspath(File file) {
def node = new JsonSlurper().parse(file)
def out = new StringBuilder()
node.versionInfo.libraries.each { lib ->
if (lib.serverreq)
{
def split = lib.name.split(':')
def group = split[0].replace('.', '/')
def artifact = split[1]
def version = split[2]
out += "libraries/$group/$artifact/$version/$artifact-${version}.jar "
}
}
out += "minecraft_server.1.12.2.jar"
return out.toString()
}

githubRelease {
if(System.getenv("GITHUB_TOKEN") != null){
token System.getenv("GITHUB_TOKEN")
}else{
token ""
}
owner "KettleFoundation"
repo "Kettle"
releaseName "Kettle Dev " + versioning.info.branch + "-" + versioning.info.build
body {
"""\
## Setup Info
Don't forget to download [Minecraft Server 1.12.2](https://launcher.mojang.com/mc/game/1.12.2/server/886945bfb2b978778c3a0288fd7fab09d315b25f/server.jar)
(Rename it to `minecraft_server.1.12.2.jar`)
${(changelog().call().readLines().stream().map { "- $it" }.collect(Collectors.joining('\n', '## Changelog\n', '')))}
"""
}
prerelease true
draft true
releaseAssets = [
fileTree("build/distributions/").filter { it.name.endsWith("jar") || it.name.endsWith("zip") },
fileTree("/release/").filter { it.name.endsWith("zip") }
]
}
Loading

0 comments on commit 82c9dc0

Please sign in to comment.