mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-15 19:25:09 +01:00
Use official Satin build, Gradle cleanup, Remove unneeded dependencies
This commit is contained in:
122
build.gradle
122
build.gradle
@@ -1,33 +1,26 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'fabric-loom' version '0.5-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
||||
id 'fabric-loom' version '0.4-SNAPSHOT'
|
||||
}
|
||||
|
||||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
|
||||
ext.buildnumber = System.getenv().BUILD_NUMBER ?: 'custom';
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
group = 'com.tterrag.blur'
|
||||
archivesBaseName = "Blur"
|
||||
version = "${mod_version}-${minecraft_version}+fabric"
|
||||
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
|
||||
minecraft {
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter()
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
||||
mappings "net.fabricmc:yarn:${mappings_version}"
|
||||
modCompile "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
||||
mappings "net.fabricmc:yarn:${yarn_mappings}"
|
||||
modCompile "net.fabricmc:fabric-loader:${loader_version}"
|
||||
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||
modCompile "io.github.ladysnake:Satin:${satin_version}"
|
||||
include "io.github.ladysnake:Satin:${satin_version}"
|
||||
@@ -40,13 +33,12 @@ dependencies {
|
||||
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", mod_version
|
||||
inputs.property "version", project.version
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include "fabric.mod.json"
|
||||
expand "version": mod_version
|
||||
expand "version": project.version
|
||||
}
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
@@ -54,69 +46,43 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import groovy.json.JsonSlurper
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
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')
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this task, sources will not be generated.
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = "sources"
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
jar {
|
||||
from "LICENSE"
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
// add all the jars that should be included when publishing to maven
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
|
||||
from ('pack_icons') {
|
||||
include "${pack_id}.png"
|
||||
rename '.+', 'icon.png'
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
|
||||
baseName = "Blur " + pack_name
|
||||
}
|
||||
|
||||
createResourcePacks.finalizedBy taskName
|
||||
}
|
||||
|
||||
// select the repositories you want to publish to
|
||||
repositories {
|
||||
// uncomment to publish to the local maven
|
||||
// mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
// 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}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user