mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-15 19:25:09 +01:00
106 lines
2.5 KiB
Groovy
106 lines
2.5 KiB
Groovy
buildscript {
|
|
repositories {
|
|
jcenter()
|
|
maven { url = 'http://maven.modmuss50.me' }
|
|
}
|
|
dependencies {
|
|
classpath 'net.fabricmc:fabric-loom:0.1.0-SNAPSHOT'
|
|
}
|
|
}
|
|
plugins {
|
|
id 'com.matthewprenger.cursegradle' version '1.0.9'
|
|
}
|
|
|
|
apply plugin: 'fabric-loom'
|
|
|
|
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
|
|
ext.buildnumber = System.getenv().BUILD_NUMBER ?: 'custom';
|
|
|
|
group = 'com.tterrag.blur'
|
|
archivesBaseName = "Blur"
|
|
version = "${mod_version}-${buildnumber}"
|
|
|
|
sourceCompatibility = '1.8'
|
|
targetCompatibility = '1.8'
|
|
|
|
minecraft {
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "com.mojang:minecraft:18w49a"
|
|
mappings "net.fabricmc:yarn:18w49a.10"
|
|
modCompile "net.fabricmc:fabric-loader:0.2.0.62"
|
|
|
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
|
modCompile "net.fabricmc:fabric:0.1.0.37"
|
|
|
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
// Not necessary atm
|
|
// tasks.build.dependsOn createResourcePacks
|
|
|
|
tasks.curseforge.enabled = !dev && project.hasProperty('curseforge_key')
|
|
|
|
curseforge {
|
|
if (project.hasProperty('curseforge_key')) {
|
|
apiKey = project.curseforge_key
|
|
}
|
|
|
|
project {
|
|
id = project.project_id
|
|
changelogType = 'html'
|
|
changelog = System.getenv('CHANGELOG')
|
|
if (changelog == null || 'none'.equals(changelog)) {
|
|
changelog = getChangelog() ?: ''
|
|
changelogType = 'text'
|
|
}
|
|
releaseType = project.release_type
|
|
addGameVersion '1.9.4'
|
|
addGameVersion '1.11.2'
|
|
addGameVersion '1.12'
|
|
addGameVersion '1.12.1'
|
|
mainArtifact(jar) {
|
|
displayName = "Blur ${mod_version}"
|
|
}
|
|
}
|
|
}
|
|
|