Ant build file for JedaiLib

4 views
Skip to first unread message

Pierre Augier

unread,
Oct 2, 2008, 9:22:31 AM10/2/08
to Jedai
Hi Jon !

here is the build ant file & build properties i've designed to build
the jedaiLib.swc.

It' inspired from http://code.google.com/p/flex-template/

it's a first version, probably not perfect, feel free to improve it :

**************************************************************************
********* build.xml :
***************************************************
**************************************************************************
<?xml version="1.0" encoding="ISO-8859-1" ?>


<project name="Jedai framework" default="all" basedir=".">

<!-- Environment specific properties -->
<property file="build.properties" />
<taskdef resource="flexTasks.tasks" classpath="${FLEX.TASK.DIR}" />

<!-- flexunit tasks , unused yet-->
<!--<taskdef resource="com/adobe/ac/ant/tasks/tasks.properties"
classpath="${FLEX.ANT.TASK.DIR}"/>-->


<target name="init" description="Initializes the build">
<tstamp/>
<echo message="============================================="/>
<echo message="${project.name}-${project.version} [${TODAY}]"/>
<echo message="Copyright (c) ${project.year} ${project.owner}"/>
<echo message="OS : ${os.name}" />
<echo message="=============================================="/>
</target>


<!--
Task to build SWC Components
-->
<target name="components"
depends="init"
description=""
>
<path id="components-src-list">
<fileset dir="src/">
<include name="**/**"/>
<exclude name="**/tests*"/>
</fileset>
</path>

<pathconvert
property="components-src-list-formated"
pathsep=" "
dirsep="."
refid="components-src-list">
<map from="${basedir}/${src.dir}/" to=""/>
<mapper>
<chainedmapper>
<globmapper from="*.as" to="*"/>
</chainedmapper>
</mapper>
</pathconvert>
<echo message="============================================="/>
<echo message="basedir : ${basedir}" />
<echo message="library included : ${components-src-list-formated}" /
>
<echo message="=============================================="/>

<compc
output="${bin.dir}/${components.swc.name}"
include-classes="${components-src-list-formated}"
locale="${DEFAULT.LOCAL}"
>
<metadata description="${components.lib.description}">
<contributor name="${project.owner}" />
</metadata>
<source-path path-element="${basedir}/${src.dir}"/>

<compiler.include-libraries dir="${lib.dir}" append="true" >
<include name="*.swc" />
<!--<include name="Cairngorm.swc" />
<include name="prana04.swc" />-->
</compiler.include-libraries>

<!--<include-file name="main.css" path="${assets.dir}/css/main.css"/
>-->
</compc>

</target>

<!--
Run unit test
-->
<target name="unit-tests"
depends="init"
description="Compiles the tests ">
<echo message="============================================="/>
<echo message=" TODO "/>
<echo message="============================================="/>
<!--
<mxmlc
file="${flex.unit.runner}"
output="${flex.unit.swf}"
actionscript-file-encoding="${ENCODING}"
keep-generated-actionscript="false"
incremental="false"
>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.source-path path-element="${src.dir}"/>
<compiler.include-libraries dir="${lib.dir}" append="true">
<include name="flexunit.swc" />
<include name="FlexUnitOptional.swc" />
</compiler.include-libraries>
</mxmlc>

<flexunit
timeout="0"
swf="${flex.unit.swf}"
toDir="${report.dir}"
haltonfailure="true" />

<junitreport todir="${report.dir}">
<fileset dir="${report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${report.dir}/html/"/>
</junitreport>

-->

</target>

<!--
Generate ASDOC
-->
<target name="doc"
depends="init"
description="Generates the asdoc of the source files">
<echo message="============================================="/>
<echo message=" TODO "/>
<echo message="============================================="/>
<!--
<java className="${asdoc.tool}" fork="true" failonerror="true">
<classpath >
<fileset dir="${FLEX_HOME}/asdoc/lib" includes="*.jar" />
<fileset dir="${FLEX_HOME}/lib" includes="*.jar" />
</classpath>
<jvmarg line="-Dapplication.home=${FLEX_HOME} -Xms32m -Xmx768m -
Dsun.io.useCanonCaches=false -Xbootclasspath/p:${FLEX_HOME}/asdoc/lib/
xalan.jar"/>
<arg line="-library-path+=${lib.dir}" />
<arg line="-doc-sources '${src.dir}'" />
<arg line="-main-title '${asdoc.docsname}'" />
<arg line="-window-title '${asdoc.docsname}'" />
<arg line="-output '${docs.asdoc.dir}'" />
</java>
-->

</target>



<target name="clean"
description="clean all generated files">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${docs.asdoc.dir}" includes="**/*"/>
<fileset dir="${dist.dir}" includes="**/*"/>
<fileset dir="${debug.dir}" includes="**/*"/>
<fileset dir="${bin.dir}" includes="**/*" />
<fileset dir="${report.dir}/html" includes="**/*" />
</delete>
<!--<delete>
<fileset dir="${report.dir}" includes="**/*.xml" />
</delete>-->

<delete dir="${debug.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${bin.dir}" />


</target>

<target name="all"
depends="components, doc"
description="Complete build in efficient sequence"/>

</project>

**************************************************************************
********* build.properties
**********************************************
**************************************************************************
######################################
# FLEX SDK
# Where flex is installed:
######################################

FLEX_HOME=/Users/Pierre/Documents/flex_sdk_3
DEFAULT.LOCAL=en_US
#fr_FR
ENCODING = UTF-8

######################################
## Project information
######################################
project.owner = Pierre Augier
project.owner.url = http://www.pierreaugier.com
project.fullname = Jedai Framework
project.version = 0.1
project.name = main
project.year = 2008

######################################
## Components
######################################
components.lib.name =JedaiLib
components.lib.version=0.1
components.lib.description="Jedai library"
components.swc.name=${components.lib.name}-$
{components.lib.version}.swc



######################################
## Properties
######################################
src.dir=src
test.dir=tests
bin.dir=bin
debug.dir=bin-debug
build.dir=build
dist.dir=dist
docs.dir=docs
docs.asdoc.dir=${docs.dir}/asdocs
docs.junitreport.dir=${docs.dir}/junitreport
lib.dir=lib

main.class = ${src.dir}/${project.name}.mxml


# ASSETS DIR
assets.dir=${src.dir}/assets/


######################################
## tools
######################################

### FlexTask
# Standart flex ant tasks ... bundled in the flex SDK3 at ${sdk-path}/
ant but've added the jar into my project
# http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html
# or http://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks
FLEX.TASK.DIR=./tools/FlexTasks/lib/flexTasks.jar

# for unit-tests flex ant tasks
# http://opensource.adobe.com/wiki/display/flexunit/FlexUnit
FLEX.ANT.TASK.DIR=./tools/FlexAntTasks/flexAntTasks.jar

### Asdoc
asdoc.tool=flex2.tools.ASDoc

# The name that will appear in the documentation that is generated.
asdoc.docsname=Template API Documentation

######################################
## Flex Unit
######################################

flex.unit.runner = ${test.dir}/AntTestRunner.mxml
flex.unit.swf=${basedir}/${bin.dir}/AntTestRunner.swf
report.dir=${basedir}/docs/junitreport


**************************************************************************

PS1: I've changed the original prana lib bundled with jedai with the
0.4 found here :
http://sourceforge.net/project/downloading.php?group_id=194107&use_mirror=surfnet&filename=prana-framework-0.4.zip&108866

PS2 : I had also few difficulties with the "flexLib" (http://
code.google.com/p/flexlib/) bundled with jedai on your svn repo. The
compilation and runtime is OK with flexbuilder but I get error when
compiling with ant/sdk task. As I didn't use flexLib (i've removed the
swc from the build path) , i did not investigate further.
But here is the first runtime error i get :

"VerifyError?: Error #1014: La classe
mx.charts.chartClasses::ChartElement? est introuvable.

at flash.display::MovieClip?/nextFrame() at
mx.managers::SystemManager?/deferredNextFrame()[E:\dev\3.1.0\frameworks
\projects\framework\src\mx\managers\SystemManager.as:299] at
mx.managers::SystemManager?/preloader_initProgressHandler()[E:\dev
\3.1.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:
2225] at flash.events::EventDispatcher?/dispatchEventFunction() at
flash.events::EventDispatcher?/dispatchEvent() at
mx.preloaders::Preloader/timerHandler()[E:\dev\3.1.0\frameworks
\projects\framework\src\mx\preloaders\Preloader.as:398] at
flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()"

maybe a flexLib bug ?

Jonathan Valliere

unread,
Oct 2, 2008, 12:37:14 PM10/2/08
to Jedai
Cool. I'll take a look at it. I'll also fix that ReferenceError(see
other thread) over the weekend.

On Oct 2, 9:22 am, Pierre Augier <augier.pie...@gmail.com> wrote:
> Hi Jon !
>
> here is the build ant file & build properties i've designed to build
> the jedaiLib.swc.
>
> It' inspired fromhttp://code.google.com/p/flex-template/
> project.owner.url =http://www.pierreaugier.com
> # orhttp://labs.adobe.com/wiki/index.php/Flex_Ant_Tasks
> FLEX.TASK.DIR=./tools/FlexTasks/lib/flexTasks.jar
>
> # for unit-tests flex ant tasks
> #http://opensource.adobe.com/wiki/display/flexunit/FlexUnit
> FLEX.ANT.TASK.DIR=./tools/FlexAntTasks/flexAntTasks.jar
>
> ###  Asdoc
> asdoc.tool=flex2.tools.ASDoc
>
> # The name that will appear in the documentation that is generated.
> asdoc.docsname=Template API Documentation
>
> ######################################
> ## Flex Unit
> ######################################
>
> flex.unit.runner = ${test.dir}/AntTestRunner.mxml
> flex.unit.swf=${basedir}/${bin.dir}/AntTestRunner.swf
> report.dir=${basedir}/docs/junitreport
>
> **************************************************************************
>
> PS1: I've changed the original prana lib bundled with jedai with the
> 0.4 found here :http://sourceforge.net/project/downloading.php?group_id=194107&use_mi...
Reply all
Reply to author
Forward
0 new messages