129 lines
4.3 KiB
Groovy
129 lines
4.3 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
maven {
|
|
url = 'http://files.minecraftforge.net/maven'
|
|
}
|
|
mavenCentral()
|
|
maven {
|
|
url = 'https://plugins.gradle.org/m2/'
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '1.2-SNAPSHOT'
|
|
classpath group: 'gradle.plugin.com.matthewprenger', name: 'CurseGradle', version: cursegradleVersion
|
|
}
|
|
}
|
|
|
|
apply plugin: 'forge'
|
|
apply plugin: 'com.matthewprenger.cursegradle'
|
|
|
|
version = project.mc_version + '-' + project.modVersion
|
|
|
|
archivesBaseName = project.modName
|
|
|
|
sourceCompatibility = targetCompatibility = '1.8'
|
|
|
|
configurations {
|
|
shade
|
|
compile.extendsFrom shade
|
|
}
|
|
|
|
dependencies {
|
|
shade (project(':core')) { transitive = true }
|
|
shade (project(':Jankson')) { transitive = false }
|
|
|
|
shade group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: kotlinVersion
|
|
|
|
shade(group: "org.jetbrains.kotlinx", name: "kotlinx-coroutines-core", version: coroutinesVersion)
|
|
shade(group: "org.jetbrains.kotlinx", name: "kotlinx-serialization-runtime", version: serializationVersion)
|
|
|
|
shade(group: "com.github.kittinunf.Fuel", name: "fuel", version: fuelVersion)
|
|
shade(group: "com.github.kittinunf.Fuel", name: "fuel-coroutines", version: fuelVersion)
|
|
shade(group: 'com.github.kittinunf.result', name: 'result', version: resultVersion)
|
|
|
|
// shade group: 'com.github.kittinunf.fuel', name: 'fuel', version: fuelVersion
|
|
// shade group: 'com.github.kittinunf.result', name: 'result', version: resultVersion
|
|
}
|
|
|
|
|
|
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: org/intellij matterlink/repack/org/intellij'
|
|
// srgExtra 'PK: blue/endless/ matterlink/repack/blue/endless/'
|
|
|
|
}
|
|
|
|
compileKotlin.doFirst {
|
|
def target = 'src/main/kotlin/matterlink/gen'
|
|
copy {
|
|
from('src/templates/kotlin/matterlink/Constants.kt')
|
|
into(target)
|
|
}
|
|
ant.replaceregexp(match: '@MODVERSION@', replace: project.modVersion, flags: 'g', byline: true) {
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
}
|
|
ant.replaceregexp(match: '@MCVERSION@', replace: project.mc_version, flags: 'g', byline: true) {
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
}
|
|
ant.replaceregexp(match: '@FORGELIN-VERSION@', replace: project.forgelinVersion, flags: 'g', byline: true) {
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
}
|
|
ant.replaceregexp(match: '@FORGE-VERSION@', replace: project.forge_version, flags: 'g', byline: true) {
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
}
|
|
ant.replaceregexp(match: '@BUILD_NUMBER@', replace: System.env.BUILD_NUMBER ?: -1, flags: 'g', byline: true) {
|
|
fileset(dir: target, includes: 'Constants.kt')
|
|
}
|
|
}
|
|
|
|
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'
|
|
}
|
|
}
|
|
|
|
jar {
|
|
configurations.shade.each { dep ->
|
|
from(project.zipTree(dep)) {
|
|
exclude 'META-INF', 'META-INF/**'
|
|
}
|
|
}
|
|
}
|
|
|
|
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)
|
|
}
|
|
mainArtifact(jar) {
|
|
displayName = "MatterLink $version"
|
|
}
|
|
}
|
|
} |