2018-02-17 22:51:58 +00:00
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
maven { url = "http://files.minecraftforge.net/maven" }
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath "net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-19 19:42:12 +00:00
|
|
|
plugins {
|
|
|
|
id 'com.matthewprenger.cursegradle' version '1.0.10'
|
|
|
|
}
|
|
|
|
|
2018-02-17 22:51:58 +00:00
|
|
|
apply plugin: 'forge'
|
|
|
|
|
|
|
|
version = project.mc_version + "-" + project.mod_version
|
|
|
|
|
|
|
|
archivesBaseName = project.mod_name
|
|
|
|
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
shade
|
|
|
|
compile.extendsFrom shade
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
shade project(":core")
|
|
|
|
}
|
|
|
|
|
|
|
|
minecraft {
|
|
|
|
version = project.mc_version + "-" + project.forge_version + "-" + project.mc_version
|
|
|
|
runDir = "run"
|
|
|
|
|
|
|
|
mappings = project.mcp_mappings
|
|
|
|
|
|
|
|
srgExtra "PK: kotlin matterlink/repack/kotlin"
|
|
|
|
srgExtra "PK: org/jetbrains/annotations matterlink/repack/org/jetbrains/annotations"
|
|
|
|
srgExtra "PK: com/google/gson matterlink/repack/com/google/gson"
|
|
|
|
srgExtra "PK: org/apache/http matterlink/repack/org/apache/http"
|
|
|
|
srgExtra "PK: org/intelij matterlink/repack/org/intelij"
|
|
|
|
}
|
|
|
|
|
|
|
|
compileKotlin.doFirst {
|
|
|
|
def target = "src/main/kotlin/matterlink/gen"
|
|
|
|
copy {
|
|
|
|
from("src/templates/kotlin/matterlink/Constants.kt")
|
|
|
|
into(target)
|
|
|
|
}
|
2018-02-18 23:19:13 +00:00
|
|
|
ant.replaceregexp(match: '@MODVERSION@', replace: project.mod_version, flags: 'g', byline: true) {
|
2018-02-17 22:51:58 +00:00
|
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
|
|
}
|
2018-02-18 23:19:13 +00:00
|
|
|
ant.replaceregexp(match: '@MCVERSION@', replace: project.mc_version, flags: 'g', byline: true) {
|
2018-02-17 22:51:58 +00:00
|
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
|
|
}
|
2018-02-18 23:19:13 +00:00
|
|
|
ant.replaceregexp(match: '@FORGELIN-VERSION@', replace: project.forgelin_version, flags: 'g', byline: true) {
|
2018-02-17 22:51:58 +00:00
|
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
|
|
}
|
2018-02-18 23:19:13 +00:00
|
|
|
ant.replaceregexp(match: '@FORGE-VERSION@', replace: project.forge_version, flags: 'g', byline: true) {
|
2018-02-17 22:51:58 +00:00
|
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
// this will ensure that this task is redone when the versions change.
|
|
|
|
inputs.property "version", project.mod_version
|
|
|
|
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.mod_version, 'mcversion': project.minecraft.version
|
|
|
|
}
|
|
|
|
|
|
|
|
// copy everything else except the mcmod.info
|
|
|
|
from(project(":core").sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude 'mcmod.info'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
configurations.shade.each { dep ->
|
2018-02-18 23:19:13 +00:00
|
|
|
from(project.zipTree(dep)) {
|
2018-02-17 22:51:58 +00:00
|
|
|
exclude "META-INF", "META-INF/**"
|
|
|
|
}
|
|
|
|
}
|
2018-02-19 19:42:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
curseforge {
|
|
|
|
if (project.hasProperty('CURSEFORGE_API_TOKEN') && project.hasProperty('release')) {
|
|
|
|
apiKey = CURSEFORGE_API_TOKEN
|
|
|
|
}
|
|
|
|
project {
|
2018-02-19 20:06:08 +00:00
|
|
|
id = project.curse_id
|
|
|
|
releaseType = project.curse_release_type
|
2018-02-19 19:42:12 +00:00
|
|
|
if (project.hasProperty('changelog_file')) {
|
|
|
|
println("changelog = $changelog_file")
|
|
|
|
changelogType = "markdown"
|
|
|
|
changelog = file(changelog_file)
|
|
|
|
}
|
|
|
|
relations {
|
|
|
|
requiredLibrary 'shadowfacts-forgelin'
|
|
|
|
}
|
|
|
|
mainArtifact(jar) {
|
|
|
|
displayName = "MatterLink $version"
|
|
|
|
}
|
|
|
|
}
|
2018-02-17 22:51:58 +00:00
|
|
|
}
|