jsoneditor/build.xml

115 lines
5.9 KiB
XML
Raw Normal View History

<!-- ant build script for jsoneditoronline -->
<project name="jsoneditor-builder" default="main">
<!-- the version number of must be updated here (according to changelog.txt) -->
<property name="package" value="jsoneditor"/>
<property name="version" value="1.6.0"/>
<property name="root" location="" />
<property name="lib" location="build/lib" />
<property name="web" location="build/web" />
<property name="chrome_app" location="build/app/chrome" />
<property name="compressor" value="tools/yuicompressor-2.4.7.jar" />
<target name="minify" description="minify jsoneditor libraries">
<java jar="${compressor}" dir="jsoneditor" fork="true" failonerror="true">
<arg value="-o"/>
<arg value="jsoneditor-min.js"/>
<arg value="jsoneditor.js"/>
</java>
<java jar="${compressor}" dir="jsoneditor" fork="true" failonerror="true">
<arg value="-o"/>
<arg value="jsoneditor-min.css"/>
<arg value="jsoneditor.css"/>
</java>
</target>
<target name="zip" depends="minify" description="create zipped jsoneditor libraries">
<mkdir dir="${lib}" />
<!-- create a zip file with non-minified jsoneditor -->
<!-- TODO: do not overwrite if existing -->
<zip destfile="${lib}/${package}-${version}.zip">
<fileset dir="${root}" includes="LICENSE" />
<fileset dir="${root}" includes="NOTICE" />
2012-09-30 16:22:03 +08:00
<fileset dir="${root}" includes="README.md" />
<fileset dir="${root}" includes="changelog.txt" />
<fileset dir="${root}" includes="demo.html" />
<fileset dir="${root}" includes="jsoneditor/jsoneditor.js" />
<fileset dir="${root}" includes="jsoneditor/jsoneditor.css" />
<fileset dir="${root}" includes="jsoneditor/img/jsoneditor-icons.png" />
</zip>
<!-- create a zip file with non-minified jsoneditor -->
<!-- TODO: do not overwrite if existing -->
<zip destfile="${lib}/${package}-${version}.min.zip">
<fileset dir="${root}" includes="LICENSE" />
<fileset dir="${root}" includes="NOTICE" />
2012-09-30 16:22:03 +08:00
<fileset dir="${root}" includes="README.md" />
<fileset dir="${root}" includes="changelog.txt" />
<!-- TODO: create demo (with correct links to minified library)
<fileset dir="${root}" includes="demo.html" />
-->
<fileset dir="${root}" includes="jsoneditor/jsoneditor-min.js" />
<fileset dir="${root}" includes="jsoneditor/jsoneditor-min.css" />
<fileset dir="${root}" includes="jsoneditor/img/jsoneditor-icons.png" />
</zip>
</target>
<target name="build_site" depends="minify" description="copy all files for the site to the build directory">
<delete dir="${web}" />
<mkdir dir="${web}" />
<copy file="LICENSE" todir="${web}" />
<copy file="NOTICE" todir="${web}" />
<copy file="README.md" todir="${web}" />
<copy file="robots.txt" todir="${web}" />
<copy file="changelog.txt" todir="${web}" />
<copy file="index.html" todir="${web}" />
<copy file="favicon.ico" todir="${web}" />
<copy file="interface/interface.js" todir="${web}/interface" />
<copy file="interface/interface.css" todir="${web}/interface" />
<copy file="interface/lib/jsonlint/jsonlint.js" todir="${web}/interface/lib/jsonlint" />
<copy file="interface/img/logo.png" todir="${web}/interface/img" />
<copy file="interface/img/header_background.png" todir="${web}/interface/img" />
<copy file="jsoneditor/jsoneditor-min.js" todir="${web}/jsoneditor" />
<copy file="jsoneditor/jsoneditor-min.css" todir="${web}/jsoneditor" />
<copy file="jsoneditor/img/jsoneditor-icons.png" todir="${web}/jsoneditor/img" />
</target>
<target name="build_chrome_app" depends="minify" description="copy all files for the chrome app to the build directory">
<delete dir="${chrome_app}" />
<mkdir dir="${chrome_app}" />
<!-- hosted app -->
<copy file="app/chrome/manifest.json" todir="${chrome_app}" />
<copy file="interface/img/icon_16.png" todir="${chrome_app}" />
<copy file="interface/img/icon_128.png" todir="${chrome_app}" />
<!--
<copy file="app/chrome/manifest.json" todir="${chrome_app}" />
<copy file="app/chrome/index.html" todir="${chrome_app}" />
<copy file="app/chrome/app.js" todir="${chrome_app}" />
<copy file="interface/img/icon_128.png" todir="${chrome_app}" />
<copy file="interface/img/icon_16.png" todir="${chrome_app}" />
<copy file="LICENSE" todir="${chrome_app}" />
<copy file="NOTICE" todir="${chrome_app}" />
<copy file="README.md" todir="${chrome_app}" />
<copy file="changelog.txt" todir="${chrome_app}" />
<copy file="favicon.ico" todir="${chrome_app}" />
<copy file="interface/interface.js" todir="${chrome_app}/interface" />
<copy file="interface/interface.css" todir="${chrome_app}/interface" />
<copy file="interface/img/logo_app.png" todir="${chrome_app}/interface/img" />
<copy file="interface/img/header_background.png" todir="${chrome_app}/interface/img" />
<copy file="jsoneditor/jsoneditor-min.js" todir="${chrome_app}/jsoneditor" />
<copy file="jsoneditor/jsoneditor-min.css" todir="${chrome_app}/jsoneditor" />
<copy file="jsoneditor/img/jsoneditor-icons.png" todir="${chrome_app}/jsoneditor/img" />
-->
</target>
<target name="zip_chrome_app" depends="build_chrome_app" description="zip the chrome application">
<zip destfile="build/app/chrome_app.zip">
<fileset dir="${chrome_app}" />
</zip>
</target>
<target name="main" depends="minify, zip, build_site, build_chrome_app, zip_chrome_app" />
</project>