121 lines
3.5 KiB
Groovy
121 lines
3.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
maven {
|
|
url = 'http://files.minecraftforge.net/maven'
|
|
}
|
|
mavenCentral()
|
|
maven {
|
|
url = 'https://oss.sonatype.org/content/groups/public'
|
|
}
|
|
maven {
|
|
url = 'https://plugins.gradle.org/m2/'
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '2.3-SNAPSHOT'
|
|
classpath group: 'com.github.jengelman.gradle.plugins', name: 'shadow', version: shadowVersion
|
|
classpath group: 'gradle.plugin.com.matthewprenger', name: 'CurseGradle', version: cursegradleVersion
|
|
classpath group: 'com.vanniktech', name: 'gradle-dependency-graph-generator-plugin', version: '0.5.0'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
|
apply plugin: 'com.matthewprenger.cursegradle'
|
|
apply plugin: "com.vanniktech.dependency.graph.generator"
|
|
|
|
version = project.mc_version + '-' + project.modVersion
|
|
|
|
archivesBaseName = project.modName
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
dependencies {
|
|
compile project(':core')
|
|
shadow (project(path: ':core', configuration: 'shadow')) { transitive = false }
|
|
|
|
compile group: 'net.shadowfacts', name: 'Forgelin', version: project.forgelinVersion
|
|
}
|
|
|
|
shadowJar {
|
|
classifier = ''
|
|
|
|
exclude 'dummyThing'
|
|
configurations = [project.configurations.shadow]
|
|
}
|
|
|
|
minecraft {
|
|
version = project.mc_version + '-' + project.forge_version
|
|
runDir = 'run'
|
|
|
|
mappings = project.mcp_mappings
|
|
|
|
replaceIn 'Constants.kt'
|
|
replace '@MODVERSION@', project.modVersion
|
|
replace '@MCVERSION@', project.mc_version
|
|
replace '@FORGELIN-VERSION@', project.forgelinVersion
|
|
replace '@FORGE-VERSION@', project.forge_version
|
|
replace '-1//@BUILD_NUMBER@', System.env.BUILD_NUMBER ?: -1
|
|
}
|
|
|
|
processResources {
|
|
// this will ensure that this task is redone when the versions change.
|
|
inputs.property "version", project.modVersion
|
|
inputs.property "mcversion", project.minecraft.version
|
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
from(project(":core").sourceSets.main.resources.srcDirs) {
|
|
include 'mcmod.info'
|
|
|
|
// replace version and mcversion
|
|
expand 'version': project.modVersion, 'mcversion': project.minecraft.version
|
|
}
|
|
|
|
// copy everything else except the mcmod.info
|
|
from(project(":core").sourceSets.main.resources.srcDirs) {
|
|
exclude 'mcmod.info'
|
|
}
|
|
|
|
}
|
|
|
|
sourceJar {
|
|
classifier = 'sources'
|
|
// copy all the minecraftforge specific classes
|
|
from sourceSets.main.allSource
|
|
|
|
// copy everything else except the mcmod.info
|
|
from(project(":core").sourceSets.main.allSource) {
|
|
exclude 'mcmod.info'
|
|
}
|
|
}
|
|
|
|
reobf {
|
|
shadowJar { mappingType = 'SEARGE' }
|
|
}
|
|
tasks.shadowJar.finalizedBy reobfShadowJar
|
|
|
|
curseforge {
|
|
if (project.hasProperty('CURSEFORGE_API_TOKEN') && project.hasProperty('release')) {
|
|
apiKey = CURSEFORGE_API_TOKEN
|
|
}
|
|
project {
|
|
id = project.curseId
|
|
releaseType = project.curseReleaseType
|
|
if (project.hasProperty('changelog_file')) {
|
|
println("changelog = $changelog_file")
|
|
changelogType = 'markdown'
|
|
changelog = file(changelog_file)
|
|
}
|
|
relations {
|
|
requiredLibrary 'shadowfacts-forgelin'
|
|
}
|
|
mainArtifact(shadowJar) {
|
|
displayName = "MatterLink $version"
|
|
}
|
|
}
|
|
}
|
|
|
|
runServer {
|
|
outputs.upToDateWhen { false }
|
|
} |