mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
204 lines
7.4 KiB
Groovy
204 lines
7.4 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven {
|
|
name = "forge"
|
|
url = "https://files.minecraftforge.net/maven"
|
|
}
|
|
maven {
|
|
name = 'minecraft'
|
|
url = 'https://libraries.minecraft.net/'
|
|
}
|
|
maven {
|
|
name = 'apache'
|
|
url = 'https://repo.maven.apache.org/maven2/'
|
|
}
|
|
maven {
|
|
name = 'spigotmc-public'
|
|
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'idea'
|
|
apply plugin: 'net.minecraftforge.gradle.patcher'
|
|
|
|
group = 'luohuayu.CatServer'
|
|
version = 'git rev-parse --short HEAD'.execute().text.trim()
|
|
|
|
repositories {
|
|
clear()
|
|
maven {
|
|
name = "forge"
|
|
url = "http://files.minecraftforge.net/maven"
|
|
}
|
|
maven {
|
|
name = 'minecraft'
|
|
url = 'https://libraries.minecraft.net/'
|
|
}
|
|
maven {
|
|
name = 'apache'
|
|
url = 'https://repo.maven.apache.org/maven2/'
|
|
}
|
|
maven {
|
|
name = 'spigotmc-public'
|
|
url = 'https://hub.spigotmc.org/nexus/content/groups/public/'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
catserver.java.srcDirs = ['src/main/java', 'projects/Catserver/src/main/java']
|
|
}
|
|
|
|
minecraft.version = "1.12.2"
|
|
minecraft {
|
|
mappings = 'snapshot_nodoc_20171003'
|
|
workspaceDir = "projects"
|
|
versionJson = "resources/jsons/${minecraft.version}-dev.json"
|
|
buildUserdev = false
|
|
buildInstaller = false
|
|
installerVersion = "1.5"
|
|
|
|
def common = {
|
|
patchPrefixOriginal "../src-base/minecraft"
|
|
patchPrefixChanged "../src-work/minecraft"
|
|
/*mainClassClient "net.minecraft.launchwrapper.Launch"
|
|
tweakClassClient "net.minecraftforge.fml.common.launcher.FMLTweaker"*/
|
|
mainClassServer "net.minecraft.launchwrapper.Launch"
|
|
tweakClassServer "net.minecraftforge.fml.common.launcher.FMLServerTweaker"
|
|
}
|
|
|
|
projects {
|
|
catserver {
|
|
rootDir "."
|
|
patchDir "patches/"
|
|
patchAfter "clean"
|
|
genPatchesFrom "clean"
|
|
genMcpPatches = true
|
|
applyMcpPatches = true
|
|
s2sKeepImports = true
|
|
//dchImports = true
|
|
//ignoreWhiteSpaces = false
|
|
with common
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
|
tasks.compileJava.enabled = false
|
|
tasks.reobfuscate.setProperty("extraSrg",["PK: org/bukkit/craftbukkit org/bukkit/craftbukkit/v1_12_R1"])
|
|
|
|
dependencies {
|
|
compile 'com.google.code.findbugs:jsr305:3.0.1'
|
|
compile 'com.mojang:patchy:1.1'
|
|
compile 'oshi-project:oshi-core:1.1'
|
|
compile 'net.java.dev.jna:jna:4.4.0'
|
|
compile 'net.java.dev.jna:platform:3.4.0'
|
|
compile 'com.ibm.icu:icu4j-core-mojang:51.2'
|
|
compile 'net.sf.jopt-simple:jopt-simple:5.0.3'
|
|
compile 'com.paulscode:codecjorbis:20101023'
|
|
compile 'com.paulscode:codecwav:20101023'
|
|
compile 'com.paulscode:libraryjavasound:20101123'
|
|
compile 'com.paulscode:librarylwjglopenal:20100824'
|
|
compile 'com.paulscode:soundsystem:20120107'
|
|
compile 'io.netty:netty-all:4.1.24.Final'
|
|
compile 'com.google.guava:guava:21.0'
|
|
compile 'org.apache.commons:commons-lang3:3.5'
|
|
compile 'commons-io:commons-io:2.5'
|
|
compile 'commons-codec:commons-codec:1.10'
|
|
compile 'net.java.jinput:jinput:2.0.5'
|
|
compile 'net.java.jutils:jutils:1.0.0'
|
|
compile 'com.google.code.gson:gson:2.8.0'
|
|
compile 'com.mojang:authlib:1.5.25'
|
|
compile 'com.mojang:realms:1.10.21'
|
|
compile 'org.apache.commons:commons-compress:1.8.1'
|
|
compile 'org.apache.httpcomponents:httpclient:4.3.3'
|
|
compile 'commons-logging:commons-logging:1.1.3'
|
|
compile 'org.apache.httpcomponents:httpcore:4.3.2'
|
|
compile 'it.unimi.dsi:fastutil:7.1.0'
|
|
compile 'org.apache.logging.log4j:log4j-api:2.8.1'
|
|
compile 'org.apache.logging.log4j:log4j-core:2.8.1'
|
|
compile 'org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209'
|
|
compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209'
|
|
compile 'com.mojang:text2speech:1.10.3'
|
|
compile 'net.minecraft:launchwrapper:1.12'
|
|
compile 'org.jline:jline:3.5.1'
|
|
compile 'org.ow2.asm:asm-debug-all:5.2'
|
|
compile 'com.typesafe.akka:akka-actor_2.11:2.3.3'
|
|
compile 'com.typesafe:config:1.3.1'
|
|
compile 'lzma:lzma:0.0.1'
|
|
compile 'java3d:vecmath:1.5.2'
|
|
compile 'net.sf.trove4j:trove4j:3.0.3'
|
|
compile 'org.apache.maven:maven-artifact:3.5.3'
|
|
compile 'org.yaml:snakeyaml:1.19'
|
|
compile 'com.googlecode.json-simple:json-simple:1.1.1'
|
|
compile 'commons-lang:commons-lang:2.6' // Is needed for plugin compatibility
|
|
compile 'net.md-5:SpecialSource:1.8.0'
|
|
compile 'org.xerial:sqlite-jdbc:3.21.0.1'
|
|
compile 'mysql:mysql-connector-java:5.1.45'
|
|
compile 'net.md-5:bungeecord-chat:1.12-SNAPSHOT'
|
|
compile 'org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2'
|
|
compile 'org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2'
|
|
compile 'org.scala-lang:scala-actors-migration_2.11:1.1.0'
|
|
compile 'org.scala-lang:scala-compiler:2.11.1'
|
|
compile 'org.scala-lang:scala-library:2.11.1'
|
|
compile 'org.scala-lang:scala-parser-combinators_2.11:1.0.1'
|
|
compile 'org.scala-lang:scala-reflect:2.11.1'
|
|
compile 'org.scala-lang:scala-swing_2.11:1.0.1'
|
|
compile 'org.scala-lang:scala-xml_2.11:1.0.2'
|
|
}
|
|
|
|
outputJar {
|
|
classifier = 'async'
|
|
|
|
manifest.attributes([
|
|
"Implementation-Title": rootProject.name,
|
|
"Implementation-Version": "git-CatServer-" + minecraft.version + "-" + version,
|
|
"Implementation-Vendor": "Luohuayu".equals('git config user.name'.execute().text.trim()) ? "Luohuayu" : "Unofficial",
|
|
"Main-Class": "catserver.server.CatServerLaunch",
|
|
"TweakClass": "net.minecraftforge.fml.common.launcher.FMLTweaker",
|
|
"Class-Path": file("src/main/resources/libraries.info").readLines().collect{ it.split("\\|")[0] }.join(" ")
|
|
])
|
|
}
|
|
|
|
processJson {
|
|
releaseJson = "resources/jsons/${minecraft.version}-rel.json"
|
|
addReplacements([
|
|
"@minecraft_version@": project.minecraft.version,
|
|
"@version@": project.version,
|
|
"@project@": "CatServer",
|
|
"@artifact@": "luohuayu:project:${project.version}",
|
|
"@universal_jar@": { outputJar.archiveName },
|
|
"@timestamp@": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
|
])
|
|
}
|
|
|
|
extractCatserverSources { exclude "**/SideOnly.java", "**/Side.java" }
|
|
extractCatserverResources { exclude "**/log4j2.xml" }
|
|
|
|
genGradleProjects {
|
|
addRepo('forge', 'http://files.minecraftforge.net/maven/')
|
|
addRepo('apache', 'https://repo.maven.apache.org/maven2/')
|
|
addRepo('spigotmc-public', 'https://hub.spigotmc.org/nexus/content/groups/public/')
|
|
|
|
configurations.compile.resolvedConfiguration.resolvedArtifacts.collect { addCompileDep(it.moduleVersion.id.toString()) }
|
|
|
|
addTestCompileDep "junit:junit:4.12" // TODO update unit tests to junit 5 and remove this
|
|
addTestCompileDep "org.junit.jupiter:junit-jupiter-api:5.0.0"
|
|
addTestCompileDep "org.opentest4j:opentest4j:1.0.0" // needed for junit 5
|
|
addTestCompileDep "org.hamcrest:hamcrest-core:1.3"
|
|
filter { dep -> !dep.contains("scala") }
|
|
}
|
|
|
|
cleanBuildDir()
|
|
static cleanBuildDir() {
|
|
for (File file : new File("build/distributions").listFiles()) file.delete()
|
|
for (File file : new File("build/libs").listFiles()) file.delete()
|
|
} |