mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-21 04:49:51 +08:00
116 lines
3.1 KiB
Groovy
116 lines
3.1 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url = "https://files.minecraftforge.net/maven" }
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
|
}
|
|
}
|
|
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'net.minecraftforge.gradle'
|
|
|
|
def minecraftVersion = "1.14.2"
|
|
def forgeVersion = "26.0.48"
|
|
|
|
configurations.all { Configuration it ->
|
|
it.resolutionStrategy { ResolutionStrategy rs ->
|
|
rs.force("com.google.guava:guava:21.0")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile project(':worldedit-core')
|
|
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.11.2'
|
|
|
|
minecraft "net.minecraftforge:forge:${minecraftVersion}-${forgeVersion}"
|
|
|
|
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.0-rc1'
|
|
}
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
minecraft {
|
|
mappings channel: 'snapshot', version: "20190621-${minecraftVersion}"
|
|
|
|
runs {
|
|
client = {
|
|
// recommended logging data for a userdev environment
|
|
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
// recommended logging level for the console
|
|
properties 'forge.logging.console.level': 'debug'
|
|
workingDirectory project.file('run').canonicalPath
|
|
source sourceSets.main
|
|
}
|
|
server = {
|
|
// recommended logging data for a userdev environment
|
|
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
// recommended logging level for the console
|
|
properties 'forge.logging.console.level': 'debug'
|
|
workingDirectory project.file('run').canonicalPath
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
project.archivesBaseName = "${project.archivesBaseName}-mc${minecraftVersion}"
|
|
|
|
processResources {
|
|
// this will ensure that this task is redone when the versions change.
|
|
inputs.property 'version', project.internalVersion
|
|
inputs.property 'forgeVersion', forgeVersion
|
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
include 'META-INF/mods.toml'
|
|
|
|
// replace version and mcversion
|
|
expand 'version': project.internalVersion, 'forgeVersion': forgeVersion
|
|
}
|
|
|
|
// copy everything else except the mcmod.info
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
exclude 'META-INF/mods.toml'
|
|
}
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes("Class-Path": "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar",
|
|
"WorldEdit-Version": version)
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
dependencies {
|
|
relocate "org.slf4j", "com.sk89q.worldedit.slf4j"
|
|
relocate "org.apache.logging.slf4j", "com.sk89q.worldedit.log4jbridge"
|
|
|
|
include(dependency('org.slf4j:slf4j-api'))
|
|
include(dependency("org.apache.logging.log4j:log4j-slf4j-impl"))
|
|
}
|
|
}
|
|
|
|
afterEvaluate {
|
|
reobf {
|
|
shadowJar {
|
|
mappings = createMcpToSrg.output
|
|
}
|
|
}
|
|
}
|
|
|
|
task deobfJar(type: Jar) {
|
|
from sourceSets.main.output
|
|
classifier = 'dev'
|
|
}
|
|
|
|
artifacts {
|
|
archives deobfJar
|
|
}
|