Eclipse :Preference->Ant->Editor->Content Assist
auto activation triggers: <S{ 后面加一個空格,屬性提示
<target name="compile" depends="clean,mkdir">
<javac srcdir="${javasrc.dir}" destdir="${build.dir}" debug="on" deprecation="on" optimize="off" target="1.5" includes="**">
<classpath refid="build.classpath" />
</javac>
</target>
<target name="war" depends="compile">
<war destfile="${ear.dir}/DocumentWorkflow.war" webxml="${webcontent.dir}/WEB-INF/web.xml">
<fileset dir="${webcontent.dir}">
<exclude name="WEB-INF/web.xml" />
</fileset>
</war>
</target>
<target name="ear" depends="war">
<ear destfile="${ear.dir}/DocumentWorkflowEAR.ear" appxml="${ear.dir}/META-INF/application.xml">
<fileset dir="${ear.dir}">
<exclude name="META-INF/application.xml" />
<include name="DocumentWorkflow.war" />
<include name="META-INF/*" />
</fileset>
</ear>
</target>
flex編譯
<taskdef resource="flexTasks.tasks" classpath="${FLEX.TASK.LIB}"/>
<target name="main.compile"
description="Compiles the main mxml/as source files">
<mxmlc file="${flex.src.dir}/${flex.source}"
output="${flex.bin.dir}/${flex.output}"
fork="false"
keep-generated-actionscript="false"
incremental="false"
debug="${debug}"
keep-all-type-selectors="true"
default-background-color="0xFFFFFF"
services="${app.dir}/services-config.xml"
context-root="${context.root}"
locale="${DEFAULT.LOCAL}"
>
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${module.dir}"/>
<license product="fds" serial-number="${fds.license.num}"/>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="locale/${DEFAULT.LOCAL}" />
</compiler.library-path>
<compiler.include-libraries dir="${flex.project}/libs" includes="*.swc" append="true"/>
</mxmlc>
</target>
細節問題:
<mkdir dir="${build.dir}"/> 已經存在不會創建,不會報錯
<move todir="${deldir.app}" failοnerrοr="false">...</move>
<delete dir="${deldir}" failοnerrοr="false"/>
<copy overwrite="true">...</copy>如果文件存在將不會覆蓋
如果在編譯的過程中報內錯溢出異常 OutOfMemoryError -Xms128m -Xmx512m