Permalink
Fetching contributors…
Cannot retrieve contributors at this time
527 lines (470 sloc) 19.6 KB
<?xml version="1.0" encoding="utf-8"?>
<project name="feathers" default="swc" basedir=".">
<!-- build.local.properties and sdk.local.proprties are optional files that
can be used to override the default properties. -->
<property file="./sdk.local.properties"/>
<property file="./sdk.properties"/>
<property file="./build.local.properties"/>
<property file="./build.properties"/>
<taskdef resource="flexUnitTasks.tasks" classpath="${flexunit}"/>
<target name="swc" depends="-feathers,-cleanup" description="builds feathers.swc only"/>
<target name="docs" depends="-prepare,-docs,-cleanup" description="builds help files and API reference only"/>
<target name="help" depends="-prepare,-help,-cleanup" description="builds help files only"/>
<!-- builds help files to deploy to website -->
<target name="web-help" depends="-web,-prepare,-help,-cleanup"/>
<target name="beta-web-help" depends="-beta-web,-prepare,-help,-cleanup"/>
<target name="api" depends="-api,-cleanup" description="builds API reference only"/>
<target name="test" depends="-test,-cleanup" description="runs unit tests"/>
<target name="full" depends="-feathers,-test,-docs,-themes,-includes,-cleanup" description="builds everything">
<!-- move feathers.swc to its final location for distribution.
basically, we didn't want the extra swc directory for a quick build. -->
<copy overwrite="true" todir="${swc.output}">
<fileset dir="${output.path}">
<include name="feathers.swc"/>
</fileset>
</copy>
<delete file="${output.path}/feathers.swc"/>
</target>
<target name="package" depends="full" description="builds everything and creates a zip file for distribution">
<zip destfile="${output.path}/feathers-ui-${feathers.version}.zip">
<zipfileset dir="${output.path}"/>
</zip>
<delete includeemptydirs="true">
<fileset dir="${output.path}" excludes="feathers-ui-${feathers.version}.zip"/>
</delete>
</target>
<target name="-beta-web">
<property name="web" value="true"/>
<property name="help.url.search" value="feathersui.com/beta/help/"/>
</target>
<target name="-web">
<property name="web" value="true"/>
<property name="help.url.search" value="feathersui.com/help/"/>
</target>
<target name="-prepare">
<property name="web" value=""/>
<property name="help.url.search" value=""/>
<delete dir="${output.path}"/>
<loadfile srcFile="${source.root}/feathers/FEATHERS_VERSION.as" property="version.test">
<filterchain>
<linecontains>
<contains value="public const FEATHERS_VERSION:String"/>
</linecontains>
<tokenfilter>
<containsstring contains="${feathers.version}"/>
</tokenfilter>
</filterchain>
</loadfile>
<fail unless="version.test" message="feathers.FEATHERS_VERSION contains incorrect version string."/>
</target>
<target name="-cleanup">
<delete dir="${dependency.output}"/>
</target>
<target name="-starling" depends="-prepare">
<echo message="Building starling.swc"/>
<java jar="${compc}" dir="${starling.root}" fork="true" failonerror="true">
<arg value="-load-config=${flashplayer.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=."/>
<arg value="-include-sources+=."/>
<arg value="-output=${dependency.output}/starling.swc"/>
</java>
</target>
<target name="-feathers" depends="-starling">
<echo message="Building feathers.swc"/>
<java jar="${compc}" dir="${basedir}" fork="true" failonerror="true">
<arg value="-load-config=${flashplayer.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${source.root}"/>
<arg value="-include-sources+=${source.root}"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-output=${output.path}/feathers.swc"/>
</java>
</target>
<target name="-docs" depends="-api,-help"/>
<target name="-api" depends="-starling">
<echo message="Generating API Reference"/>
<java jar="${asdoc}" dir="${basedir}" fork="true" failonerror="true">
<arg value="+flexlib=${flashsdk.framework}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${source.root}"/>
<arg value="-library-path+=${dependency.output}"/>
<arg value="-doc-sources+=${source.root}"/>
<!-- these two arguments are needed after switching to the AIR SDK
with ASC 2.0 to stop weird errors -->
<arg value="-theme="/>
<arg value="-compiler.fonts.local-fonts-snapshot="/>
<arg value="-templates-path"/>
<arg value="${api.root}/templates"/>
<arg value="-main-title=Feathers ${feathers.version} API Reference"/>
<arg value="-window-title=Feathers User Interface Controls for Starling Framework API Reference"/>
<arg value="-footer=${footer.text}"/>
<arg value="-package-description-file=./package-descriptions.xml"/>
<arg value="-output=${api.output}"/>
</java>
</target>
<target name="-help">
<echo message="Generating Help Files"/>
<mkdir dir="${help.output}"/>
<property name="help.title.main" value="Feathers ${feathers.version} Help"/>
<apply executable="pandoc" dir="${help.root}" dest="${help.output}" failonerror="true">
<srcfile/>
<arg value="-f"/>
<arg value="markdown_github+yaml_metadata_block+markdown_in_html_blocks+auto_identifiers"/>
<arg value="-t"/>
<arg value="html5"/>
<arg value="-s"/>
<arg value="--template=template"/>
<arg value="--css=css/feathers-help.css"/>
<arg value="--variable=title-suffix:${help.title.main}"/>
<arg value="--variable=lang:en"/>
<arg value="--variable=web:${web}"/>
<arg value="--variable=search-url:${help.url.search}"/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${help.root}/markdown" includes="*.md" />
<mapper type="glob" from="*.md" to="*.html"/>
</apply>
<mkdir dir="${help.output}/cookbook"/>
<property name="help.title.cookbook" value="Feathers Cookbook"/>
<apply executable="pandoc" dir="${help.root}" dest="${help.output}/cookbook" failonerror="true">
<srcfile/>
<arg value="-f"/>
<arg value="markdown_github+yaml_metadata_block+markdown_in_html_blocks+auto_identifiers"/>
<arg value="-t"/>
<arg value="html5"/>
<arg value="-s"/>
<arg value="--template=template"/>
<arg value="--css=../css/feathers-help.css"/>
<arg value="--variable=title-suffix:${help.title.cookbook}"/>
<arg value="--variable=lang:en"/>
<arg value="--variable=web:${web}"/>
<arg value="--variable=breadcrumb:${help.title.main}"/>
<arg value="--variable=search-url:${help.url.search}"/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${help.root}/markdown/cookbook" includes="*.md" />
<mapper type="glob" from="*.md" to="*.html"/>
</apply>
<mkdir dir="${help.output}/faq"/>
<property name="help.title.faq" value="Feathers FAQ"/>
<apply executable="${pandoc}" dir="${help.root}" dest="${help.output}/faq" failonerror="true">
<srcfile/>
<arg value="-f"/>
<arg value="markdown_github+yaml_metadata_block+markdown_in_html_blocks+auto_identifiers"/>
<arg value="-t"/>
<arg value="html5"/>
<arg value="-s"/>
<arg value="--template=template"/>
<arg value="--css=../css/feathers-help.css"/>
<arg value="--variable=title-suffix:${help.title.faq}"/>
<arg value="--variable=lang:en"/>
<arg value="--variable=web:${web}"/>
<arg value="--variable=breadcrumb:${help.title.main}"/>
<arg value="--variable=search-url:${help.url.search}"/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${help.root}/markdown/faq" includes="*.md" />
<mapper type="glob" from="*.md" to="*.html"/>
</apply>
<mkdir dir="${help.output}/sdk"/>
<property name="help.title.sdk" value="Feathers SDK and MXML Help"/>
<apply executable="${pandoc}" dir="${help.root}" dest="${help.output}/sdk" failonerror="true">
<srcfile/>
<arg value="-f"/>
<arg value="markdown_github+yaml_metadata_block+markdown_in_html_blocks+auto_identifiers"/>
<arg value="-t"/>
<arg value="html5"/>
<arg value="-s"/>
<arg value="--template=template"/>
<arg value="--css=../css/feathers-help.css"/>
<arg value="--variable=title-suffix:${help.title.sdk}"/>
<arg value="--variable=lang:en"/>
<arg value="--variable=web:${web}"/>
<arg value="--variable=breadcrumb:${help.title.main}"/>
<arg value="--variable=search-url:${help.url.search}"/>
<arg value="-o"/>
<targetfile/>
<fileset dir="${help.root}/markdown/sdk" includes="*.md" />
<mapper type="glob" from="*.md" to="*.html"/>
</apply>
<copy overwrite="true" todir="${help.output}/images">
<fileset dir="${help.root}/markdown/images">
<include name="*.png"/>
<include name="*.gif"/>
<include name="*.jpg"/>
</fileset>
</copy>
<mkdir dir="${help.output}/css"/>
<copy overwrite="true" todir="${help.output}/css">
<fileset dir="${help.root}/css">
<include name="*.css"/>
</fileset>
</copy>
<mkdir dir="${help.output}/sdk/ide-file-templates"/>
<copy overwrite="true" todir="${help.output}/sdk/ide-file-templates">
<fileset dir="${help.root}/markdown/sdk/ide-file-templates">
<include name="feathers-file-templates-flash-builder.xml"/>
</fileset>
</copy>
</target>
<target name="-themes" depends="-feathers">
<echo message="Building AeonDesktopTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/AeonDesktopTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/AeonDesktopTheme/source"/>
<arg value="-include-sources+=${themes.root}/AeonDesktopTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/AeonDesktopTheme/swc/AeonDesktopTheme.swc"/>
</java>
<echo message="Building MetalWorksDesktopTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/MetalWorksDesktopTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/MetalWorksDesktopTheme/source"/>
<arg value="-include-sources+=${themes.root}/MetalWorksDesktopTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc"/>
</java>
<echo message="Building MetalWorksMobileTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/MetalWorksMobileTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/MetalWorksMobileTheme/source"/>
<arg value="-include-sources+=${themes.root}/MetalWorksMobileTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc"/>
</java>
<echo message="Building MinimalDesktopTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/MinimalDesktopTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/MinimalDesktopTheme/source"/>
<arg value="-include-sources+=${themes.root}/MinimalDesktopTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/MinimalDesktopTheme/swc/MinimalDesktopTheme.swc"/>
</java>
<echo message="Building MinimalMobileTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/MinimalMobileTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/MinimalMobileTheme/source"/>
<arg value="-include-sources+=${themes.root}/MinimalMobileTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/MinimalMobileTheme/swc/MinimalMobileTheme.swc"/>
</java>
<echo message="Building TopcoatLightMobileTheme.swc"/>
<java jar="${compc}" dir="${themes.root}/TopcoatLightMobileTheme" fork="true" failonerror="true">
<arg value="-load-config=${airmobile.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-source-path+=${themes.root}/TopcoatLightMobileTheme/source"/>
<arg value="-include-sources+=${themes.root}/TopcoatLightMobileTheme/source"/>
<arg value="-external-library-path+=${dependency.output}"/>
<arg value="-external-library-path+=${output.path}/feathers.swc"/>
<arg value="-output=${themes.output}/TopcoatLightMobileTheme/swc/TopcoatLightMobileTheme.swc"/>
</java>
</target>
<target name="-includes">
<echo message="Copying Feathers source code"/>
<copy overwrite="true" todir="${source.output}">
<fileset dir="${source.root}"/>
</copy>
<echo message="Copying informational documents"/>
<copy overwrite="true" todir="${output.path}">
<fileset dir="${basedir}">
<include name="README.md"/>
<include name="LICENSE.md"/>
<include name="RELEASENOTES.md"/>
</fileset>
</copy>
<echo message="Copying theme source code and assets"/>
<copy overwrite="true" todir="${themes.output}/AeonDesktopTheme">
<fileset dir="${themes.root}/AeonDesktopTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${themes.output}/MetalWorksDesktopTheme">
<fileset dir="${themes.root}/MetalWorksDesktopTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${themes.output}/MetalWorksMobileTheme">
<fileset dir="${themes.root}/MetalWorksMobileTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${themes.output}/MinimalDesktopTheme">
<fileset dir="${themes.root}/MinimalDesktopTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${themes.output}/MinimalMobileTheme">
<fileset dir="${themes.root}/MinimalMobileTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${themes.output}/TopcoatLightMobileTheme">
<fileset dir="${themes.root}/TopcoatLightMobileTheme">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
</fileset>
</copy>
<echo message="Copying examples"/>
<copy overwrite="true" todir="${examples.output}/ComponentsExplorer">
<fileset dir="${examples.root}/ComponentsExplorer">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/ComponentsExplorerWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/DrawersExplorer">
<fileset dir="${examples.root}/DrawersExplorer">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/DrawersExplorerWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/DragAndDrop">
<fileset dir="${examples.root}/DragAndDrop">
<include name="README.md"/>
<include name="source/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/Gallery">
<fileset dir="${examples.root}/Gallery">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/GalleryWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/HelloWorld">
<fileset dir="${examples.root}/HelloWorld">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/HelloWorldWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/LayoutExplorer">
<fileset dir="${examples.root}/LayoutExplorer">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/LayoutExplorerWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/Magic8Chat">
<fileset dir="${examples.root}/Magic8Chat">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/Magic8ChatWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/PullToRefresh">
<fileset dir="${examples.root}/PullToRefresh">
<include name="README.md"/>
<include name="assets/**"/>
<include name="source/**"/>
<exclude name="source/PullToRefreshWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/StackScreenNavigatorExplorer">
<fileset dir="${examples.root}/StackScreenNavigatorExplorer">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/StackScreenNavigatorExplorerWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/Tabs">
<fileset dir="${examples.root}/Tabs">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/TabsWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/TileList">
<fileset dir="${examples.root}/TileList">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/TileListWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/Todos">
<fileset dir="${examples.root}/Todos">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/TodosWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/TrainTimes">
<fileset dir="${examples.root}/TrainTimes">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/TrainTimesWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/TransitionsExplorer">
<fileset dir="${examples.root}/TransitionsExplorer">
<include name="README.md"/>
<include name="source/**"/>
<include name="assets/**"/>
<exclude name="source/TransitionsExplorerWeb.as"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/Video">
<fileset dir="${examples.root}/Video">
<include name="README.md"/>
<include name="source/**"/>
</fileset>
</copy>
<copy overwrite="true" todir="${examples.output}/YouTubeFeeds">
<fileset dir="${examples.root}/YouTubeFeeds">
<include name="README.md"/>
<include name="source/**"/>
<exclude name="source/YouTubeFeedsWeb.as"/>
</fileset>
</copy>
</target>
<target name="-test" depends="-feathers">
<java jar="${mxmlc}" dir="${test.root}/source" fork="true" failonerror="true">
<arg value="-load-config=${flashplayer.config}"/>
<arg value="-swf-version=${swf.version}"/>
<arg value="-library-path+=${dependency.output}"/>
<arg value="-library-path+=${flexunit.root}"/>
<arg value="-library-path+=${output.path}"/>
<arg value="-output=${dependency.output}/TestFeathers.swf"/>
<arg value="TestFeathers.as"/>
</java>
<copy todir="${dependency.output}/fixtures">
<fileset dir="${test.root}/fixtures"/>
</copy>
<flexunit
command="${flashplayer}"
player="flash"
swf="${dependency.output}/TestFeathers.swf"
haltonfailure="true"
verbose="true"
toDir="${dependency.output}"/>
</target>
</project>