| 1 | <?xml version="1.0"?> |
|---|
| 2 | <project name="ltas" basedir="../" default="build-debug"> |
|---|
| 3 | <!-- Define variables/paths used in this build script --> |
|---|
| 4 | <xmlproperty file="./settings.xml" /> |
|---|
| 5 | <property file="./build/build.properties" /> |
|---|
| 6 | |
|---|
| 7 | <!-- |
|---|
| 8 | Have you edit the properties file to make sure the paths are right oo your system? |
|---|
| 9 | --> |
|---|
| 10 | <target name="check-properties"> |
|---|
| 11 | <fail unless="asdoc.exe">The "asdoc.exe" property must be set in ${build.dir}/build.properties.</fail> |
|---|
| 12 | <fail unless="compc.exe">The "compc.exe" property must be set in ${build.dir}/build.properties.</fail> |
|---|
| 13 | <fail unless="mxmlc.exe">The "mxmlc.exe" property must be set in ${build.dir}/build.properties.</fail> |
|---|
| 14 | <fail unless="plugin.package">The "package" property must be set in settings.xml.</fail> |
|---|
| 15 | <fail unless="plugin.class">The "class" property must be set in settings.xml.</fail> |
|---|
| 16 | <fail unless="plugin.prefix">The "filename" property must be set in settings.xml.</fail> |
|---|
| 17 | </target> |
|---|
| 18 | |
|---|
| 19 | <!-- |
|---|
| 20 | Compile the plugin in debug mode. |
|---|
| 21 | --> |
|---|
| 22 | <target name="clean-debug"> |
|---|
| 23 | <delete dir="${debug.dir}"> |
|---|
| 24 | <include name="*.swf"/> |
|---|
| 25 | </delete> |
|---|
| 26 | </target> |
|---|
| 27 | |
|---|
| 28 | <!-- |
|---|
| 29 | Compile the plugin in debug mode. |
|---|
| 30 | --> |
|---|
| 31 | <target name="clean-release"> |
|---|
| 32 | <delete dir="${release.dir}"> |
|---|
| 33 | <include name="*.swf"/> |
|---|
| 34 | </delete> |
|---|
| 35 | </target> |
|---|
| 36 | |
|---|
| 37 | <!-- |
|---|
| 38 | Generate ASDoc output for the library |
|---|
| 39 | --> |
|---|
| 40 | <target name="create-asdoc" depends="check-properties"> |
|---|
| 41 | <!-- Clean out the contents of the doc directory, without delete "docs" --> |
|---|
| 42 | <!-- |
|---|
| 43 | <delete includeemptydirs="true"> |
|---|
| 44 | <fileset dir="${docs.dir}" includes="**/*" /> |
|---|
| 45 | </delete> |
|---|
| 46 | --> |
|---|
| 47 | |
|---|
| 48 | <exec executable="${asdoc.exe}" spawn="no"> |
|---|
| 49 | <!-- Place the documentation in the "docs" directory --> |
|---|
| 50 | <arg line="-output '${docs.dir}'" /> |
|---|
| 51 | |
|---|
| 52 | <!-- Specify the main source path as "src" --> |
|---|
| 53 | <arg line="-compiler.source-path '${src.dir}'" /> |
|---|
| 54 | |
|---|
| 55 | <!-- Include the necessary framework libraries in the class path --> |
|---|
| 56 | <arg line="-compiler.library-path '${flexsdk.lib.dir}'" /> |
|---|
| 57 | <arg line="-compiler.library-path '${lib.dir}'" /> |
|---|
| 58 | |
|---|
| 59 | <!-- Document all of the classes in the "src" tree --> |
|---|
| 60 | <arg line="-doc-sources '${src.dir}' " /> |
|---|
| 61 | |
|---|
| 62 | <!-- Include the library name in the window title --> |
|---|
| 63 | <arg line="-window-title 'JW Player Plugin - ${plugin.title}' "/> |
|---|
| 64 | |
|---|
| 65 | <!-- Ignore missing type declarations --> |
|---|
| 66 | <arg line="-warnings=false"/> |
|---|
| 67 | </exec> |
|---|
| 68 | |
|---|
| 69 | <exec executable="${browser}" spawn="yes"> |
|---|
| 70 | <arg line="'file://${docs.dir}/index.html'" /> |
|---|
| 71 | </exec> |
|---|
| 72 | </target> |
|---|
| 73 | |
|---|
| 74 | <!-- |
|---|
| 75 | Compile the plugin in debug mode. |
|---|
| 76 | --> |
|---|
| 77 | <target name="debug-swf"> |
|---|
| 78 | <exec executable="${mxmlc.exe}" dir="${basedir}"> |
|---|
| 79 | <!-- Point to the main test runner's application mxml file --> |
|---|
| 80 | <arg line="'${src.dir}/${package}/${class}.as'" /> |
|---|
| 81 | |
|---|
| 82 | <!-- Place the built .swf file in the "bin" directory --> |
|---|
| 83 | <arg line="-output '${debug.dir}/${swf}.swf'" /> |
|---|
| 84 | |
|---|
| 85 | <!-- Define source directories for "src" and "tests" --> |
|---|
| 86 | <arg line="-compiler.source-path '${src.dir}'" /> |
|---|
| 87 | |
|---|
| 88 | <!-- Include the necessary framework libraries in the class path --> |
|---|
| 89 | <arg line="-compiler.library-path '${flexsdk.lib.dir}'" /> |
|---|
| 90 | <arg line="-compiler.library-path '${lib.dir}'" /> |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | <!-- Include locale-specific items in the path --> |
|---|
| 94 | <arg line="-locale ${flexsdk.locale}" /> |
|---|
| 95 | <arg line="-compiler.library-path '${flexsdk.locale.dir}'" /> |
|---|
| 96 | |
|---|
| 97 | <!-- Enable incremental compilation --> |
|---|
| 98 | <arg line="-incremental=true" /> |
|---|
| 99 | |
|---|
| 100 | <!-- Enable debugging --> |
|---|
| 101 | <arg line="-debug=true" /> |
|---|
| 102 | |
|---|
| 103 | <!-- Ignore missing type definitions --> |
|---|
| 104 | <arg line="-warnings=false" /> |
|---|
| 105 | |
|---|
| 106 | <!-- Use local filesystem --> |
|---|
| 107 | <arg line="-use-network=false" /> |
|---|
| 108 | </exec> |
|---|
| 109 | </target> |
|---|
| 110 | |
|---|
| 111 | <target name="release-swf"> |
|---|
| 112 | <exec executable="${mxmlc.exe}" dir="${basedir}"> |
|---|
| 113 | <!-- Point to the main test runner's application mxml file --> |
|---|
| 114 | <arg line="'${src.dir}/${package}/${class}.as'" /> |
|---|
| 115 | |
|---|
| 116 | <!-- Place the built .swf file in the "bin" directory --> |
|---|
| 117 | <arg line="-output '${release.dir}/${swf}.swf'" /> |
|---|
| 118 | |
|---|
| 119 | <!-- Define source directories for "src" and "tests" --> |
|---|
| 120 | <arg line="-compiler.source-path '${src.dir}'" /> |
|---|
| 121 | |
|---|
| 122 | <!-- Include the necessary framework libraries in the class path --> |
|---|
| 123 | <arg line="-compiler.library-path '${flexsdk.lib.dir}'" /> |
|---|
| 124 | <arg line="-compiler.library-path '${lib.dir}'" /> |
|---|
| 125 | |
|---|
| 126 | <!-- Include locale-specific items in the path --> |
|---|
| 127 | <arg line="-locale ${flexsdk.locale}" /> |
|---|
| 128 | <arg line="-compiler.library-path '${flexsdk.locale.dir}'" /> |
|---|
| 129 | |
|---|
| 130 | <!-- Optimize for size --> |
|---|
| 131 | <arg line="-optimize=true" /> |
|---|
| 132 | |
|---|
| 133 | <!-- Ignore missing type definitions --> |
|---|
| 134 | <arg line="-warnings=false" /> |
|---|
| 135 | </exec> |
|---|
| 136 | </target> |
|---|
| 137 | |
|---|
| 138 | <target name="build-debug" depends="check-properties, clean-debug"> |
|---|
| 139 | <antcall target="debug-swf"> |
|---|
| 140 | <param name="package" value="${plugin.package}" /> |
|---|
| 141 | <param name="class" value="${plugin.class}" /> |
|---|
| 142 | <param name="swf" value="plugins/${plugin.prefix}/${plugin.prefix}" /> |
|---|
| 143 | </antcall> |
|---|
| 144 | </target> |
|---|
| 145 | |
|---|
| 146 | <target name="build-release" depends="check-properties, clean-debug"> |
|---|
| 147 | <antcall target="release-swf"> |
|---|
| 148 | <param name="package" value="${plugin.package}" /> |
|---|
| 149 | <param name="class" value="${plugin.class}" /> |
|---|
| 150 | <param name="swf" value="${plugin.prefix}" /> |
|---|
| 151 | </antcall> |
|---|
| 152 | </target> |
|---|
| 153 | </project> |
|---|