blob: 032a0296b6e33c9da5c8de51967968a44632b0eb [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="asdoc" default="main" basedir=".">
<property name="ROYALE_HOME" location="../../.."/>
<property name="example" value="ASDoc" />
<property file="${ROYALE_HOME}/env.properties"/>
<property environment="env"/>
<property file="${ROYALE_HOME}/local.properties"/>
<property file="${ROYALE_HOME}/build.properties"/>
<property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
<property name="windows_config" location="${basedir}/src/main/config/asdoc-js-config.xml" />
<condition property="config.path" value="${windows_config}">
<os family="windows" />
</condition>
<property name="config.path" value="${basedir}/src/main/config/asdoc-js-config.xml"/>
<property name="windows_swf_config" location="${basedir}/src/main/config/asdoc-swf-config.xml" />
<condition property="config.swf.path" value="${windows_swf_config}">
<os family="windows" />
</condition>
<property name="config.swf.path" value="${basedir}/src/main/config/asdoc-swf-config.xml"/>
<include file="${basedir}/../../build_example.xml" />
<target name="main" depends="build_example.compile" description="Clean build of ${example}">
<available file="${basedir}/bin-debug/classes.swf.json"
type="file"
property="json.exists"/>
<antcall target="json" />
<antcall target="json.swf" />
<!-- copy manually patched json files. Because ASDoc doesn't document
flash.*.* classes and browser builtins, some useful ASDoc is
missing, so we patch a base class like EventDispatcher so ASDoc
looks better -->
<copy todir="${basedir}/bin-debug" overwrite="true">
<fileset dir="${basedir}/src/main/json">
<include name="**/*.json" />
</fileset>
</copy>
<!-- make copies of all json for js-debug and js-release -->
<copy todir="${basedir}/bin/js-debug">
<fileset dir="${basedir}/bin-debug">
<include name="**/*.json" />
</fileset>
</copy>
<copy todir="${basedir}/bin/js-release">
<fileset dir="${basedir}/bin-debug">
<include name="**/*.json" />
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${basedir}/bin" failonerror="false" />
<delete dir="${basedir}/bin-debug" failonerror="false" />
<delete dir="${basedir}/bin-release" failonerror="false" />
<delete dir="${basedir}/target" failonerror="false" />
</target>
<target name="json" unless="json.exists" >
<echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
<java jar="${ROYALE_COMPILER_HOME}/lib/asdoc.jar" resultProperty="errorCodeJS"
fork="true">
<jvmarg line="${mxmlc.jvm.args}"/>
<jvmarg line="-Droyalelib='${ROYALE_HOME}/frameworks'"/>
<arg value="+royalelib=${ROYALE_HOME}/frameworks" />
<arg value="-external-library-path=${ROYALE_HOME}/js/libs/js.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/ace-1.2.3.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/cordova.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/GCL.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/createjs.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/jquery.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/google_maps.swc" />
<arg value="+frameworks_dir=${ROYALE_HOME}/frameworks" />
<arg value="-load-config=${config.path}" />
<arg value="-target-player=${playerglobal.version}" />
<arg value="-compiler.define+=ROYALE::DISPLAYOBJECT,IUIComponent" />
<arg value="-compiler.define+=GOOG::DEBUG,goog.DEBUG" />
<arg value="-debug=true" />
<arg value="-output=${basedir}/bin-debug" />
<arg value="-window-title=Apache Royale API Reference" />
<arg value="-main-title=Apache Royale ${release.version} API Reference " />
<arg value="-footer=The Apache Software Foundation" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-js-output-type=ROYALE" />
<arg value="-closure-lib=${GOOG_HOME}" />
</java>
<fail>
<condition>
<not>
<or>
<equals arg1="${errorCodeJS}" arg2="0" />
<equals arg1="${errorCodeJS}" arg2="2" />
</or>
</not>
</condition>
</fail>
</target>
<target name="check.swf.needed">
<condition property="swf.json.needed" value="true">
<and>
<not>
<isset property="json.exists" />
</not>
<isset property="env.AIR_HOME" />
</and>
</condition>
</target>
<target name="json.swf" depends="check.swf.needed" if="swf.json.needed" >
<echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
<java jar="${ROYALE_COMPILER_HOME}/lib/asdoc.jar" resultProperty="errorCodeSWF"
fork="true">
<jvmarg line="${mxmlc.jvm.args}"/>
<jvmarg line="-Droyalelib='${ROYALE_HOME}/frameworks'"/>
<arg value="+royalelib=${ROYALE_HOME}/frameworks" />
<arg value="-external-library-path=${env.AIR_HOME}/frameworks/libs/air/airglobal.swc" />
<arg value="-external-library-path+=${ROYALE_HOME}/js/libs/google_maps.swc" />
<arg value="+frameworks_dir=${ROYALE_HOME}/frameworks" />
<arg value="-load-config=${config.swf.path}" />
<arg value="-target-player=${playerglobal.version}" />
<arg value="-compiler.define+=GOOG::DEBUG,true" />
<arg value="-compiler.define+=ROYALE::DISPLAYOBJECT,DisplayObject" />
<arg value="-debug=true" />
<arg value="-output=${basedir}/bin-debug" />
<arg value="-window-title=Apache Royale API Reference" />
<arg value="-main-title=Apache Royale ${release.version} API Reference " />
<arg value="-footer=The Apache Software Foundation" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="-js-output-type=ROYALE" />
<arg value="-closure-lib=${GOOG_HOME}" />
</java>
<fail>
<condition>
<not>
<or>
<equals arg1="${errorCodeSWF}" arg2="0" />
<equals arg1="${errorCodeSWF}" arg2="2" />
</or>
</not>
</condition>
</fail>
</target>
<target name="examine" depends="build_example.get.browser">
<property name="which" value="debug" />
<echo message="View ASDoc."/>
<exec executable="${browser}" dir="${basedir}/bin-${which}" failonerror="true">
<arg value="${basedir}/bin-${which}/${example}.html"/>
</exec>
<exec executable="${browser}" dir="${basedir}/bin/js-${which}" failonerror="true">
<arg value="${basedir}/bin/js-${which}/index.html"/>
</exec>
</target>
</project>