buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } maven { url 'https://plugins.gradle.org/m2/' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath 'gradle.plugin.com.matthewprenger:CurseGradle:1.4.0' } } apply plugin: 'net.minecraftforge.gradle' apply plugin: 'com.matthewprenger.cursegradle' version = "${mod_version}" group = "${mod_group}" archivesBaseName = "${mod_id}-forge" sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' minecraft { mappings channel: 'snapshot', version: "${version_mcp}".toString() runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { customfov { source sourceSets.main } } } server { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' mods { customfov { source sourceSets.main } } } } } dependencies { minecraft "net.minecraftforge:forge:${version_forge}" } sourceSets { main { resources { srcDirs += 'docs' } } } jar { manifest { attributes(["Specification-Title": "${mod_name}", "Specification-Vendor": "${mod_author}", "Specification-Version": "${getArchiveVersion()}", "Implementation-Title": "${mod_name}", "Implementation-Version": "${getArchiveVersion()}", "Implementation-Vendor" :"${mod_author}", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],) } } task sourcesJar(type: Jar) { archiveClassifier.set('sources') from sourceSets.main.allJava } tasks.build.dependsOn sourcesJar processResources { from(sourceSets.main.resources.srcDirs) { include 'META-INF/mods.toml' expand 'version': project.version, 'mod_id' : mod_id, 'mod_name': mod_name, 'mod_url': mod_url, 'mod_author': mod_author, 'mod_description': mod_description, 'mod_icon': mod_icon } from(sourceSets.main.resources.srcDirs) { exclude 'META-INF/mods.toml' } } curseforge { project { apiKey = findProperty('curseKey') ?: 0 id = "${curse_id}" releaseType = "${curse_release}" changelogType = 'markdown' changelog = file('docs/CHANGELOG.md') addArtifact(sourcesJar) } }