直接用compc来打包flex源文件是很复杂且繁琐的事。但用了Ant,在Eclipse里一切都变为按一个键。
compc.xml:
<!--/////////////////////////////////////////////////////////////////////////////
//Copyright 2007 Advanced Flex Project http://code.google.com/p/advancedflex/.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////// -->
<project name="Compc build" default="main">
<!-- defines all values for the Compc compiler -->
<property file="compc.properties" />
<!-- main target: cleans and compiles ASDocs -->
<target name="main" depends="clean, log, compc" />
<!-- deletes and recreates the compc directory -->
<target name="clean">
<delete dir="${output.dir}" failonerror="true"/>
<mkdir dir="${output.dir}"/>
</target>
<!-- runs the compc.exe compiler on the source -->
<target name="compc">
<exec executable="${compc.exe}" failonerror="true">
<arg line="-include-sources '${src}'" />
<arg line="-output '${output.dir}/${output.file}'" />
</exec>
</target>
<!-- writes compc output to log file: compc-log.log -->
<target name="log">
<record name="${output.dir}/compc-log.log" action="start" append="true" />
</target>
</project>
compc.properties:
################################################################################
##Copyright 2007 Advanced Flex Project http://code.google.com/p/advancedflex/.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
###############################################################################
#compc.exe的位置
compc.exe =C:/Program Files/Adobe/Flex Builder 2 Plug-in/Flex SDK 2/bin/compc.exe
#源文件的位置
src =
#输出的位置
output.dir =
#输出的文件名
output.file =
1 条评论:
Good blog, like kirai's one!
发表评论