Skip to content

Commit

Permalink
Build: new task for apm package
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Aug 26, 2021
1 parent 8c92fa8 commit a35d7b2
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 16 deletions.
5 changes: 5 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ source.output = ${output.path}/source
examples.output = ${output.path}/examples
themes.output = ${output.path}/themes

swc.file = feathers.swc

swf.version = 30

feathers.version = 4.2.0

apm.lib.file = feathersui_${feathers.version}.airpackage
apm.src.file = feathersui-source_${feathers.version}.airpackage

footer.text = <a href='https://feathersui.com/' target='_top'>Feathers</a> | <a href='https://github.com/BowlerHatLLC/feathersui-starling' target='_top'>Github Project</a> | <a href='https://forum.starling-framework.org/forum/feathers' target='_top'>Support Forum</a>
71 changes: 56 additions & 15 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,30 @@
<property file="./build.properties"/>
<taskdef resource="flexUnitTasks.tasks" classpath="${flexunit.tasks}"/>

<target name="swc" depends="-feathers,-cleanup" description="builds feathers.swc only"/>
<target name="swc" depends="-feathers,-cleanup" description="builds .swc file only"/>

<target name="api" depends="-api,-cleanup" description="builds API reference only"/>

<target name="test" depends="-test,-cleanup" description="runs unit tests"/>
<target name="test" depends="-test,-cleanup" description="runs automated tests"/>

<target name="full" depends="-feathers,-test,-api,-themes,-includes,-cleanup" description="builds everything">
<target name="full" depends="-feathers,-test,-api,-themes,-includes,-cleanup" description="builds distribution, but doesn't package as .zip file">

<!-- 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"/>
<include name="${swc.file}"/>
</fileset>
</copy>
<delete file="${output.path}/feathers.swc"/>
<delete file="${output.path}/${swc.file}"/>
</target>

<target name="package" depends="full" description="builds everything and creates a zip file for distribution">
<target name="apm" depends="-apm,-cleanup" description="builds apm package">
<delete file="${output.path}/${swc.file}"/>
</target>

<target name="package" depends="full" description="builds and packages a .zip file for distribution">
<zip destfile="${output.path}/feathers-ui-${feathers.version}.zip">
<zipfileset dir="${output.path}"/>
</zip>
Expand Down Expand Up @@ -56,6 +60,9 @@

<target name="-cleanup">
<delete dir="${dependency.output}"/>
<echo>${output.path}/apm</echo>
<delete dir="${output.path}/apm"/>
<delete dir="${output.path}/apm-src"/>
</target>

<target name="-starling" depends="-prepare">
Expand All @@ -70,17 +77,17 @@
</target>

<target name="-feathers" depends="-starling,-api-xml">
<echo message="Building feathers.swc"/>
<echo message="Building ${swc.file}"/>
<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"/>
<arg value="-output=${output.path}/${swc.file}"/>
</java>
<echo message="Inserting asdoc XML into .swc"/>
<zip destfile="${output.path}/feathers.swc" update="true">
<zip destfile="${output.path}/${swc.file}" update="true">
<zipfileset dir="${dependency.output}/tempdita" prefix="docs">
<include name="*.*"/>
<exclude name="ASDoc_Config.xml" />
Expand Down Expand Up @@ -142,7 +149,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/AeonDesktopTheme/swc/AeonDesktopTheme.swc"/>
</java>

Expand All @@ -153,7 +160,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/MetalWorksDesktopTheme/swc/MetalWorksDesktopTheme.swc"/>
</java>

Expand All @@ -164,7 +171,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/MetalWorksMobileTheme/swc/MetalWorksMobileTheme.swc"/>
</java>

Expand All @@ -175,7 +182,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/MinimalDesktopTheme/swc/MinimalDesktopTheme.swc"/>
</java>

Expand All @@ -186,7 +193,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/MinimalMobileTheme/swc/MinimalMobileTheme.swc"/>
</java>

Expand All @@ -197,7 +204,7 @@
<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="-external-library-path+=${output.path}/${swc.file}"/>
<arg value="-output=${themes.output}/TopcoatLightMobileTheme/swc/TopcoatLightMobileTheme.swc"/>
</java>
</target>
Expand Down Expand Up @@ -428,4 +435,38 @@
verbose="true"
toDir="${dependency.output}"/>
</target>

<target name="-apm" depends="-feathers">
<fail unless="apm" message="Path to apm executable is missing."/>
<copy overwrite="true" file="${output.path}/${swc.file}" todir="${output.path}/apm/lib"/>
<copy overwrite="true" file="package-swc.json" tofile="${output.path}/apm/package.json"/>
<copy overwrite="true" file="RELEASENOTES.md" tofile="${output.path}/apm/CHANGELOG.md"/>
<copy overwrite="true" todir="${output.path}/apm">
<fileset dir="${basedir}">
<include name="README.md"/>
<include name="LICENSE.md"/>
</fileset>
</copy>

<copy overwrite="true" todir="${output.path}/apm-src/src">
<fileset dir="${source.root}"/>
</copy>
<copy overwrite="true" file="package-src.json" tofile="${output.path}/apm-src/package.json"/>
<copy overwrite="true" file="RELEASENOTES.md" tofile="${output.path}/apm-src/CHANGELOG.md"/>
<copy overwrite="true" todir="${output.path}/apm-src">
<fileset dir="${basedir}">
<include name="README.md"/>
<include name="LICENSE.md"/>
</fileset>
</copy>

<exec executable="${apm}" dir="${output.path}">
<arg value="build"/>
<arg value="apm"/>
</exec>
<exec executable="${apm}" dir="${output.path}">
<arg value="build"/>
<arg value="apm-src"/>
</exec>
</target>
</project>
13 changes: 13 additions & 0 deletions package-src.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "feathersui-source",
"name": "feathersui-source",
"url": "https://feathersui.com/as3-starling/",
"docUrl": "https://feathersui/api-reference/",
"description": "Cross-platform user interface components for creative frontend projects built with Starling",
"type": "src",
"version": "4.2.0",
"sourceUrl": "https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui-source_4.2.0.airpackage",
"dependencies": ["starling-source:2.7.0"],
"parameters": [],
"tags": ["components", "gui", "starling", "ui", "widgets"]
}
13 changes: 13 additions & 0 deletions package-swc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"id": "feathersui",
"name": "feathersui",
"url": "https://feathersui.com/as3-starling/",
"docUrl": "https://feathersui/api-reference/",
"description": "Cross-platform user interface components for creative frontend projects built with Starling",
"type": "swc",
"version": "4.2.0",
"sourceUrl": "https://github.com/feathersui/feathersui-starling/releases/download/v4.2.0/feathersui_4.2.0.airpackage",
"dependencies": ["starling:2.7.0"],
"parameters": [],
"tags": ["components", "gui", "starling", "ui", "widgets"]
}
4 changes: 3 additions & 1 deletion sdk.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ airmobile.config = ${flashsdk.root}/frameworks/airmobile-config.xml
asdoc = ${flashsdk.lib}/legacy/asdoc.jar
compc = ${flashsdk.lib}/compc-cli.jar
mxmlc = ${flashsdk.lib}/mxmlc-cli.jar
adt = ${flashsdk.lib}/adt.jar
adt = ${flashsdk.lib}/adt.jar

apm = /opt/apm/apm

0 comments on commit a35d7b2

Please sign in to comment.