mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-15 19:25:09 +01:00
93 lines
2.3 KiB
Groovy
93 lines
2.3 KiB
Groovy
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven { url = "http://files.minecraftforge.net/maven" }
|
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
}
|
|
dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' }
|
|
}
|
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
|
|
|
group = 'com.tterrag.blur'
|
|
archivesBaseName = "Blur"
|
|
version = "${mod_version}-${System.getenv().BUILD_NUMBER}"
|
|
|
|
sourceCompatibility = '1.8'
|
|
targetCompatibility = '1.8'
|
|
|
|
minecraft {
|
|
version = "${minecraft_version}-${forge_version}"
|
|
mappings = 'stable_29'
|
|
|
|
runDir = 'run'
|
|
|
|
clientJvmArgs += '-Dfml.coreMods.load=com.tterrag.blur.BlurPlugin'
|
|
|
|
replace "@VERSION@", project.version
|
|
}
|
|
|
|
processResources {
|
|
inputs.property "version", project.version
|
|
inputs.property "mcversion", project.minecraft.version
|
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
include '**/*.info'
|
|
include '**/*.properties'
|
|
|
|
// replace version and mcversion
|
|
expand 'version': project.version, 'mcversion': project.minecraft.version
|
|
}
|
|
|
|
// copy everything else, thats not the mcmod.info
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
exclude '**/*.info'
|
|
exclude '**/*.properties'
|
|
}
|
|
}
|
|
|
|
jar.manifest {
|
|
attributes 'FMLCorePlugin': 'com.tterrag.blur.BlurPlugin'
|
|
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
|
}
|
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
import groovy.json.JsonSlurper
|
|
|
|
task createResourcePacks {
|
|
def inputFile = new File("resource_packs.json")
|
|
def json = new JsonSlurper().parseText(inputFile.text)
|
|
json.each {
|
|
def pack_id = it.key
|
|
def pack_name = it.value.name
|
|
def pack_desc = it.value.description
|
|
def pack_radius = it.value.radius
|
|
|
|
def taskName = "createPack" + pack_id.capitalize();
|
|
task "${taskName}" (type: Zip) {
|
|
from ('pack_template') {
|
|
filter(ReplaceTokens, tokens: [
|
|
mod_version: project.version.toString(),
|
|
pack_version: '3',
|
|
description: pack_desc.toString(),
|
|
radius: pack_radius.toString()
|
|
])
|
|
|
|
rename(/(.+)\.template/, '$1')
|
|
}
|
|
|
|
from ('pack_icons') {
|
|
include "${pack_id}.png"
|
|
rename '.+', 'pack.png'
|
|
}
|
|
|
|
baseName = "Blur " + pack_name
|
|
}
|
|
|
|
createResourcePacks.finalizedBy taskName
|
|
}
|
|
}
|
|
|
|
tasks.build.dependsOn createResourcePacks
|