2018-02-10 16:54:43 +00:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
2018-07-11 21:29:02 +00:00
|
|
|
maven {
|
|
|
|
url = 'http://files.minecraftforge.net/maven'
|
|
|
|
}
|
2018-02-10 16:54:43 +00:00
|
|
|
mavenCentral()
|
2018-06-22 09:58:51 +00:00
|
|
|
maven {
|
|
|
|
url = 'https://oss.sonatype.org/content/groups/public'
|
|
|
|
}
|
|
|
|
maven {
|
2018-07-11 21:29:02 +00:00
|
|
|
url = 'https://plugins.gradle.org/m2/'
|
2018-06-22 09:58:51 +00:00
|
|
|
}
|
2018-02-10 16:54:43 +00:00
|
|
|
}
|
|
|
|
dependencies {
|
2018-07-11 21:29:02 +00:00
|
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '2.3-SNAPSHOT'
|
2018-08-16 21:52:11 +00:00
|
|
|
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'
|
2018-02-10 16:54:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
2018-07-11 21:29:02 +00:00
|
|
|
apply plugin: 'com.github.johnrengelman.shadow'
|
2018-06-22 09:58:51 +00:00
|
|
|
apply plugin: 'com.matthewprenger.cursegradle'
|
2018-08-16 21:52:11 +00:00
|
|
|
apply plugin: "com.vanniktech.dependency.graph.generator"
|
2018-02-10 16:54:43 +00:00
|
|
|
|
2018-08-16 21:52:11 +00:00
|
|
|
version = project.mc_version + '-' + project.modVersion
|
2018-02-10 17:08:42 +00:00
|
|
|
|
2018-08-16 21:52:11 +00:00
|
|
|
archivesBaseName = project.modName
|
2018-02-10 17:08:42 +00:00
|
|
|
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile project(':core')
|
2018-08-16 21:52:11 +00:00
|
|
|
shadow (project(path: ':core', configuration: 'shadow')) { transitive = false }
|
|
|
|
|
|
|
|
compile group: 'net.shadowfacts', name: 'Forgelin', version: project.forgelinVersion
|
2018-02-10 17:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
shadowJar {
|
2018-07-11 21:29:02 +00:00
|
|
|
classifier = ''
|
2018-02-10 17:08:42 +00:00
|
|
|
|
|
|
|
exclude 'dummyThing'
|
2018-08-16 21:52:11 +00:00
|
|
|
configurations = [project.configurations.shadow]
|
2018-02-10 17:08:42 +00:00
|
|
|
}
|
|
|
|
|
2018-02-10 16:54:43 +00:00
|
|
|
minecraft {
|
2018-07-11 21:29:02 +00:00
|
|
|
version = project.mc_version + '-' + project.forge_version
|
|
|
|
runDir = 'run'
|
2018-02-10 16:54:43 +00:00
|
|
|
|
2018-02-15 15:51:30 +00:00
|
|
|
mappings = project.mcp_mappings
|
2018-02-10 16:54:43 +00:00
|
|
|
|
2018-02-15 21:10:38 +00:00
|
|
|
replaceIn 'Constants.kt'
|
2018-08-16 21:52:11 +00:00
|
|
|
replace '@MODVERSION@', project.modVersion
|
2018-02-17 03:07:22 +00:00
|
|
|
replace '@MCVERSION@', project.mc_version
|
2018-08-16 21:52:11 +00:00
|
|
|
replace '@FORGELIN-VERSION@', project.forgelinVersion
|
2018-02-15 15:51:30 +00:00
|
|
|
replace '@FORGE-VERSION@', project.forge_version
|
2018-07-15 15:18:06 +00:00
|
|
|
replace '-1//@BUILD_NUMBER@', System.env.BUILD_NUMBER ?: -1
|
2018-02-10 16:54:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
// this will ensure that this task is redone when the versions change.
|
2018-08-16 21:52:11 +00:00
|
|
|
inputs.property "version", project.modVersion
|
2018-02-10 16:54:43 +00:00
|
|
|
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
|
2018-08-16 21:52:11 +00:00
|
|
|
expand 'version': project.modVersion, 'mcversion': project.minecraft.version
|
2018-02-10 16:54:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// copy everything else except the mcmod.info
|
|
|
|
from(project(":core").sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-02-10 19:06:42 +00:00
|
|
|
sourceJar {
|
2018-07-11 21:29:02 +00:00
|
|
|
classifier = 'sources'
|
2018-02-10 19:06:42 +00:00
|
|
|
// copy all the minecraftforge specific classes
|
|
|
|
from sourceSets.main.allSource
|
|
|
|
|
|
|
|
// copy everything else except the mcmod.info
|
2018-02-18 23:19:13 +00:00
|
|
|
from(project(":core").sourceSets.main.allSource) {
|
2018-02-10 19:06:42 +00:00
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 16:54:43 +00:00
|
|
|
reobf {
|
|
|
|
shadowJar { mappingType = 'SEARGE' }
|
|
|
|
}
|
2018-02-19 21:33:19 +00:00
|
|
|
tasks.shadowJar.finalizedBy reobfShadowJar
|
2018-02-19 19:42:12 +00:00
|
|
|
|
|
|
|
curseforge {
|
|
|
|
if (project.hasProperty('CURSEFORGE_API_TOKEN') && project.hasProperty('release')) {
|
|
|
|
apiKey = CURSEFORGE_API_TOKEN
|
|
|
|
}
|
|
|
|
project {
|
2018-08-16 21:52:11 +00:00
|
|
|
id = project.curseId
|
|
|
|
releaseType = project.curseReleaseType
|
2018-02-19 19:42:12 +00:00
|
|
|
if (project.hasProperty('changelog_file')) {
|
|
|
|
println("changelog = $changelog_file")
|
2018-07-11 21:29:02 +00:00
|
|
|
changelogType = 'markdown'
|
2018-02-19 19:42:12 +00:00
|
|
|
changelog = file(changelog_file)
|
|
|
|
}
|
|
|
|
relations {
|
|
|
|
requiredLibrary 'shadowfacts-forgelin'
|
|
|
|
}
|
2018-02-19 20:06:08 +00:00
|
|
|
mainArtifact(shadowJar) {
|
2018-02-19 19:42:12 +00:00
|
|
|
displayName = "MatterLink $version"
|
|
|
|
}
|
|
|
|
}
|
2018-11-02 03:13:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
runServer {
|
|
|
|
outputs.upToDateWhen { false }
|
2018-02-19 19:42:12 +00:00
|
|
|
}
|