Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
Clean up gradle
Browse files Browse the repository at this point in the history
Signed-off-by: CorgiTaco <[email protected]>
  • Loading branch information
CorgiTaco committed Oct 31, 2020
1 parent f515a7a commit f4780e1
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import groovy.json.JsonOutput
import groovy.json.JsonSlurper

buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url ='https://www.dogforce-games.com/maven/'}
jcenter()
mavenCentral()
maven {url='https://dist.creeper.host/Sponge/maven'}
Expand Down Expand Up @@ -88,8 +90,8 @@ jar {
manifest {
attributes([
"Specification-Title": "${modid}",
"Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves
"Specification-Vendor": "BYG",
"Specification-Version": "1.1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"${modid}",
Expand Down Expand Up @@ -131,33 +133,29 @@ mixin {
add sourceSets.main, "${modid}.refmap.json"
}

repositories {
maven { url ='https://www.dogforce-games.com/maven/'}
}

tasks.withType(JavaCompile) {
options.incremental = true
}

//processResources {
//
// // Minifies all .json files when building the mod.
// // Source files are not minified, only the jar copies.
// doLast {
//
// def jsonMinifyStart = System.currentTimeMillis()
// def jsonMinified = 0
// def jsonBytesSaved = 0
//
// fileTree(dir: outputs.files.asPath, include: '**/*.json').each {
//
// File file = it
// jsonMinified++
// def oldLength = file.length()
// file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
// jsonBytesSaved += oldLength - file.length()
// }
//
// println('Minified ' + jsonMinified + ' json files. Saved ' + jsonBytesSaved + ' bytes. Took ' + (System.currentTimeMillis() - jsonMinifyStart) + 'ms.')
// }
//}
processResources {

// Minifies all .json files when building the mod.
// Source files are not minified, only the jar copies.
doLast {

def jsonMinifyStart = System.currentTimeMillis()
def jsonMinified = 0
def jsonBytesSaved = 0

fileTree(dir: outputs.files.asPath, include: '**/*.json').each {

File file = it
jsonMinified++
def oldLength = file.length()
file.text = JsonOutput.toJson(new JsonSlurper().parse(file))
jsonBytesSaved += oldLength - file.length()
}

println('Minified ' + jsonMinified + ' json files. Saved ' + jsonBytesSaved + ' bytes. Took ' + (System.currentTimeMillis() - jsonMinifyStart) + 'ms.')
}
}

0 comments on commit f4780e1

Please sign in to comment.