mirror of
https://github.com/FliegendeWurst/ServerTPS.git
synced 2024-10-17 23:10:48 +00:00
95 lines
2.6 KiB
Groovy
95 lines
2.6 KiB
Groovy
buildscript {
|
|
repositories {
|
|
maven { url = 'https://files.minecraftforge.net/maven' }
|
|
jcenter()
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
|
|
}
|
|
}
|
|
apply plugin: 'net.minecraftforge.gradle'
|
|
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'maven-publish'
|
|
|
|
ext.configFile = file('build.properties')
|
|
ext.config = parseConfig(configFile)
|
|
ext.signingFile = file('signing.properties')
|
|
if (signingFile != null) {
|
|
ext.signing = parseConfig(signingFile)
|
|
}
|
|
|
|
version = config.version
|
|
group = "fliegendewurst.${config.mod_id}"
|
|
archivesBaseName = config.mod_name
|
|
|
|
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
|
|
|
minecraft {
|
|
mappings channel: "${config.mapping_channel}", version: "${config.mapping_version}"
|
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
|
|
|
runs {
|
|
client {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', ''
|
|
property 'forge.logging.console.level', 'debug'
|
|
}
|
|
|
|
server {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
|
|
property 'forge.logging.console.level', 'debug'
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "net.minecraftforge:forge:${config.mc_version}-${config.forge_version}"
|
|
}
|
|
|
|
jar {
|
|
archiveName = "${baseName}-${config.mc_version}-${version}.${extension}"
|
|
|
|
manifest {
|
|
attributes([
|
|
"Specification-Title": "${config.mod_id}",
|
|
"Specification-Vendor": 'FliegendeWurst',
|
|
"Specification-Version": '1',
|
|
"Implementation-Title": "${config.mod_id}",
|
|
"Implementation-Version": "${version}",
|
|
"Implementation-Vendor" :'FliegendeWurst',
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
|
"Signing-Fingerprint" : project.hasProperty('signSHA1') ? project.findProperty('signSHA1') : "unsigned"
|
|
])
|
|
}
|
|
}
|
|
|
|
// Example configuration to allow publishing using the maven-publish task
|
|
// This is the preferred method to reobfuscate your jar file
|
|
jar.finalizedBy('reobfJar')
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact jar
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url "file:///${project.projectDir}/mcmodsrepo"
|
|
}
|
|
}
|
|
}
|
|
|
|
def parseConfig(File config) {
|
|
config.withReader {
|
|
def prop = new Properties()
|
|
prop.load(it)
|
|
return (new ConfigSlurper().parse(prop))
|
|
}
|
|
}
|