File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,9 @@ dependencies {
154154 implementation " com.eclipsesource.minimal-json:minimal-json:${ project.minimalJsonVersion} "
155155}
156156
157+ import groovy.json.JsonOutput
158+ import groovy.json.JsonSlurper
159+
157160processResources {
158161 inputs. property ' version' , project. version // Redo this task when version value changes.
159162 inputs. property ' versionWithMetadata' , versionWithMetadata
@@ -162,6 +165,15 @@ processResources {
162165 // replace build variables
163166 expand ' version' : versionWithMetadata, ' tag' : gitTag
164167 }
168+
169+ // Minify .json files in built .jar
170+ doLast {
171+ fileTree(dir : outputs. files. asPath, includes : [
172+ " **/*.json"
173+ ]). each { final File file ->
174+ file. text = JsonOutput . toJson(new JsonSlurper (). parse(file))
175+ }
176+ }
165177}
166178
167179// Ensures that the encoding of source files is set to UTF-8, see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
You can’t perform that action at this time.
0 commit comments