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

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Nov 24, 2024
1 parent 2c46440 commit 2b2df41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
13 changes: 5 additions & 8 deletions Common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import com.matyrobbrt.gradle.pngoptimiser.task.OptimisePNGTask
buildscript {
dependencies.add 'classpath', 'org.spongepowered:vanillagradle:0.2.1-20240507.024226-82'
}


plugins {
id('java')
id('org.spongepowered.gradle.vanilla') version '0.2.1-SNAPSHOT'
id('com.matyrobbrt.pngoptimiser') version '0.2.0'
id 'org.spongepowered.gradle.vanilla' version '0.2.1-20240507.024226-82'
}

archivesBaseName = "${mod_name}-common-${minecraft_version}"

tasks.register('optimise', OptimisePNGTask) {
file(fileTree(dir: sourceSets.main.resources.srcDirs[0], includes: ['**/*.png']))
option 'i', 0
}

minecraft {
accessWideners(project.file("src/main/resources/byg.accesswidener"))
version(minecraft_version)
Expand Down
2 changes: 0 additions & 2 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import com.modrinth.minotaur.dependencies.DependencyType
import com.modrinth.minotaur.dependencies.ModDependency
import net.darkhax.curseforgegradle.TaskPublishCurseForge

import java.util.stream.Collectors

plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
Expand Down
23 changes: 0 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import groovy.json.JsonOutput
import groovy.json.JsonSlurper

plugins {
id 'java'
id 'idea'
Expand Down Expand Up @@ -71,24 +68,4 @@ subprojects {
it.options.encoding = 'UTF-8'
it.options.release.set(17)
}

if (project.name != 'Common')
jar {
doLast {
// Minifies all .json files when building the mod.
// Source files are not minified, only the jar copies.
def jsonMinifyStart = System.currentTimeMillis()
def jsonMinified = 0
def jsonBytesSaved = 0

fileTree(dir: processResources.outputs.files.asPath, include: '**/*.json').each {
jsonMinified++
def oldLength = it.length()
it.text = JsonOutput.toJson(new JsonSlurper().parse(it))
jsonBytesSaved += oldLength - it.length()
}

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

0 comments on commit 2b2df41

Please sign in to comment.