2012-08-17 04:25:18 +08:00
|
|
|
<!-- 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"/>
|
2012-10-09 03:51:35 +08:00
|
|
|
<property name="version" value="1.5.1"/>
|
2012-08-17 04:25:18 +08:00
|
|
|
|
|
|
|
<property name="root" location="" />
|
|
|
|
<property name="lib" location="build/lib" />
|
2012-08-24 02:29:47 +08:00
|
|
|
<property name="web" location="build/web" />
|
|
|
|
<property name="chrome_app" location="build/app/chrome" />
|
2012-08-17 04:25:18 +08:00
|
|
|
<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" />
|
2012-08-17 04:25:18 +08:00
|
|
|
<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" />
|
2012-08-17 04:25:18 +08:00
|
|
|
<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>
|
|
|
|
|
2012-08-24 02:29:47 +08:00
|
|
|
<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/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" />
|
2012-08-17 04:25:18 +08:00
|
|
|
</target>
|
|
|
|
|
2012-08-24 02:29:47 +08:00
|
|
|
<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}" />
|
2012-10-09 03:51:35 +08:00
|
|
|
<!-- 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}" />
|
|
|
|
<!--
|
2012-08-24 02:29:47 +08:00
|
|
|
<copy file="app/chrome/manifest.json" todir="${chrome_app}" />
|
|
|
|
<copy file="app/chrome/index.html" todir="${chrome_app}" />
|
2012-08-25 19:03:09 +08:00
|
|
|
<copy file="app/chrome/app.js" todir="${chrome_app}" />
|
2012-08-24 02:29:47 +08:00
|
|
|
<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" />
|
2012-10-09 03:51:35 +08:00
|
|
|
-->
|
2012-08-24 02:29:47 +08:00
|
|
|
</target>
|
|
|
|
|
2012-08-25 18:17:12 +08:00
|
|
|
<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" />
|
2012-08-17 04:25:18 +08:00
|
|
|
|
|
|
|
</project>
|