ant build file for compressing JSON output
Posted: Wed Jul 17, 2013 2:00 am
The RUBE JSON output is still a bit too big for me, even with the latest changes from spaces to tabs. I figured the following build.xml / ant script might help someone else out there. You'll need to grab jq from https://github.com/stedolan/jq.
Example:
TutHazards.json (using hex floats)
original size=221k
jq compact size: 119k
You obviously will need to update some of the settings to match your file list and installation locations.
--tim
Example:
TutHazards.json (using hex floats)
original size=221k
jq compact size: 119k
You obviously will need to update some of the settings to match your file list and installation locations.
--tim
Code: Select all
<project name="levelcrunch" default="all" basedir=".">
<property environment="env" />
<property name="jqloc" value="d:/projects/tools/jq"/>
<property name="jq" value="${jqloc}/jq"/>
<target name="compact">
<apply executable="${env.ComSpec}" relative="true">
<arg value="/c" />
<arg line="${jq} --compact-output "." <"/>
<srcfile />
<arg line=">" />
<targetfile />
<fileset dir=".">
<patternset>
<!-- List any levels for conversion here! -->
<include name="Tut*.json" />
</patternset>
</fileset>
<mapper type="glob" from="*.json" to="../../baublebird-android/assets/data/levels/*.json" />
</apply>
</target>
<target name="all" depends="compact" />
</project>