Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- maven { url = 'https://files.minecraftforge.net/maven' }
- jcenter()
- mavenCentral()
- }
- dependencies {
- classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.+', 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'
- sourceSets {
- api {
- java {
- srcDir 'src/api/java'
- }
- compileClasspath += configurations.getByName("minecraft")
- }
- main {
- java {
- srcDir 'src/main/java'
- }
- resources {
- srcDir 'src/main/resources'
- srcDir 'src/main/generated/resources'
- }
- compileClasspath += compileClasspath += sourceSets.api.output
- }
- }
- version = modMinecraftVersion + "-" + modVersion
- group = modGroup
- archivesBaseName = modFileName
- sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
- println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
- minecraft {
- mappings channel: 'snapshot', version: modForgeMappings + '-' + modMinecraftVersion
- runs {
- client {
- workingDirectory project.file('run')
- property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
- property 'forge.logging.console.level', 'debug'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
- mods {
- serverutilities {
- source sourceSets.main
- source sourceSets.api
- }
- }
- }
- server {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
- // Recommended logging level for the console
- property 'forge.logging.console.level', 'debug'
- property 'mixin.env.remapRefMap', 'true'
- property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
- mods {
- serverutilities {
- source sourceSets.main
- source sourceSets.api
- }
- }
- }
- data {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
- // Recommended logging level for the console
- property 'forge.logging.console.level', 'debug'
- args '--mod', 'serverutilities', '--all', '--output', file('src/generated/resources/')
- mods {
- serverutilities {
- source sourceSets.main
- source sourceSets.api
- }
- }
- }
- }
- }
- repositories {
- flatDir name: 'libs', dirs: 'libs'
- }
- dependencies {
- minecraft 'net.minecraftforge:forge:' + modMinecraftVersion + '-' + modForgeVersion
- compile fg.deobf('blank:architectury-1.8.131:forge')
- compile fg.deobf('blank:ftb-chunks-1605.2.3:build.75')
- compile fg.deobf('blank:ftb-gui-library-1605.2.1.41:forge')
- compile fg.deobf('blank:ftb-ranks:1604.1.1.11')
- compile fg.deobf('blank:ftb-teams-1604.1.0.15:forge')
- }
- // Example for how to get properties into the manifest for reading by the runtime..
- jar {
- from sourceSets.api.output
- from sourceSets.main.output
- manifest {
- attributes([
- "Specification-Title": "serverutilities",
- "Specification-Vendor": "serverutilities",
- "Specification-Version": "1", // We are version 1 of ourselves
- "Implementation-Title": project.name,
- "Implementation-Version": "${version}",
- "Implementation-Vendor" :"serverutilities",
- "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
- ])
- }
- }
- // Example configuration to allow publishing using the maven-publish task
- // This is the preferred method to reobfuscate your jar file
- jar.finalizedBy('reobfJar')
- // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
- //publish.dependsOn('reobfJar')
- publishing {
- publications {
- mavenJava(MavenPublication) {
- artifact jar
- }
- }
- repositories {
- maven {
- url "file:///${project.projectDir}/mcmodsrepo"
- }
- }
- }
- task apiJar(type: Jar) {
- from sourceSets.api.output
- classifier 'api'
- }
- reob {
- jar {}
- apiJar {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement