buildscript { repositories { mavenLocal() 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' apply plugin: 'maven' apply plugin: 'eclipse' apply plugin: 'maven-publish' repositories { maven { name 'DVS1 Maven FS' url 'http://dvs1.progwml6.com/files/maven' } } group = "com.progwml6.ironchest" sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { mappings channel: 'snapshot', version: mappings_version runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP,CORE' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { ironchest { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP,CORE' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { ironchest { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP,CORE' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'ironchest', '--all', '--output', file('generated/resources/') mods { ironchest { source sourceSets.main } } } } } dependencies { minecraft 'net.minecraftforge:forge:' + minecraft_version + '-' + forge_version } task buildInfo { def cmd = "git rev-parse --short HEAD" def proc = cmd.execute() proc.waitFor() if (proc.exitValue() == 0) { ext.revision = proc.text.trim() } else { ext.revision = "GITBORK" } if (System.getenv().BUILD_NUMBER != null) { ext.buildNum = System.getenv().BUILD_NUMBER } else { ext.buildNum = "DEV.${project.buildInfo.revision}" } } version = "${minecraft_version}-${mod_version}.${project.buildInfo.buildNum}" processResources { exclude '**/*.xcf' from(sourceSets.main.resources.srcDirs) { include 'META-INF/mods.toml' expand 'version': project.version, 'mcversion': minecraft_version, 'forge_version': forge_version_toml } from(sourceSets.main.resources.srcDirs) { exclude 'META-INF/mods.toml' } } task sourcesJar(type: Jar) { from sourceSets.main.allJava classifier = 'sources' } artifacts { archives sourcesJar } jar { manifest { attributes([ "Specification-Title" : "Iron Chests", "Specification-Vendor" : "Progwml6", "Specification-Version" : "1", // We are version 1 of ourselves "Implementation-Title" : project.name, "Implementation-Version" : "${version}", "Implementation-Vendor" : "Progwml6", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } publishing { publications { mavenJava(MavenPublication) { artifact jar artifact sourcesJar } } repositories { if (project.hasProperty('DEPLOY_DIR')) { maven { url DEPLOY_DIR } } } }