123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- 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)
- }
- }
|