MatterLink/1.10.2/build.gradle

131 lines
3.7 KiB
Groovy
Raw Normal View History

2018-02-11 15:33:19 +00:00
buildscript {
repositories {
jcenter()
maven { url = "http://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT"
}
}
plugins {
id "com.github.johnrengelman.shadow" version "1.2.4"
id 'com.matthewprenger.cursegradle' version '1.0.10'
2018-02-11 15:33:19 +00:00
}
apply plugin: 'net.minecraftforge.gradle.forge'
version = project.mc_version + "-" + project.mod_version
2018-02-11 15:33:19 +00:00
archivesBaseName = project.mod_name
2018-02-11 15:33:19 +00:00
sourceCompatibility = targetCompatibility = '1.8'
dependencies {
compile project(':core')
compile group: "net.shadowfacts", name: "Forgelin", version: project.forgelin_version
2018-02-11 15:33:19 +00:00
}
shadowJar {
classifier ''
relocate "org.apache.http", "matterlink.repack.org.apache.http"
relocate "org.apache.commons.logging", "matterlink.repack.org.apache.commons.logging"
dependencies {
include(project(":core"))
include(dependency("org.apache.httpcomponents:httpclient:4.3.3"))
include(dependency("org.apache.httpcomponents:httpcore:4.3.2"))
include(dependency('commons-logging:commons-logging:1.1.3'))
}
exclude 'dummyThing'
}
2018-02-11 15:33:19 +00:00
minecraft {
version = project.mc_version + "-" + project.forge_version
2018-02-11 15:33:19 +00:00
runDir = "run"
mappings = project.mcp_mappings
}
2018-02-11 15:33:19 +00:00
compileKotlin.doFirst {
def target = "src/main/kotlin/matterlink/gen"
copy {
2018-02-15 22:20:01 +00:00
from("src/templates/kotlin/matterlink/Constants.kt")
into(target)
}
ant.replaceregexp(match:'@MODVERSION@', replace: project.mod_version, 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.forgelin_version, 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')
}
2018-02-11 15:33:19 +00:00
}
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.mod_version
2018-02-11 15:33:19 +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
expand 'version': project.mod_version, 'mcversion': project.minecraft.version
2018-02-11 15:33:19 +00:00
}
// 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.reobfShadowJar.mustRunAfter shadowJar
curseforge {
if (project.hasProperty('CURSEFORGE_API_TOKEN') && project.hasProperty('release')) {
apiKey = CURSEFORGE_API_TOKEN
}
project {
id = '287323'
releaseType = 'beta'
if (project.hasProperty('changelog_file')) {
println("changelog = $changelog_file")
changelogType = "markdown"
changelog = file(changelog_file)
}
relations {
requiredLibrary 'shadowfacts-forgelin'
}
mainArtifact(jar) {
displayName = "MatterLink $version"
}
}
}