当前位置: 代码迷 >> Web前端 >> 运用Ant完成ASDoc Tool生成文档
  详细解决方案

运用Ant完成ASDoc Tool生成文档

热度:186   发布时间:2012-09-01 09:33:02.0
使用Ant完成ASDoc Tool生成文档

? ?总体的思路是用Ant来拼写命令行,通过bat的形式来执行。详细的例子如下:粗体字为根据个人情况而修改。

?

?

  
<?xml version="1.0" encoding="UTF-8"?>
<project name="fros.GenerateDocs" default="GenerateDocs">
	<property name="flex.sdk.path" value="E:/devtool/adobe/FlexBuilder3/sdks/3.2.0" />
	<property name="src.dir" value="D:/Workspace/FlexCore" />
	<property name="asdoc.output.dir" value="F:/asdoc/output" />

	<property name="main-titile" value="SimonFish Flex API Documentation" />
	
	<target name="GenerateDocs" depends="clean">
		<echo level="info">启动Ant任务,准备执行。</echo>
		<property name="asdoc.exe" value="${flex.sdk.path}/bin/asdoc.exe" />

		<property name="asdoc.config" value="-load-config+='${flex.sdk.path}/frameworks/air-config.xml' " />
		<property name="asdoc.lib.paths" value="-library-path '${flex.sdk.path}/frameworks/libs/player/10/playerglobal.swc' -library-path '${flex.sdk.path}/frameworks/libs/air/airglobal.swc' -library-path '${flex.sdk.path}/frameworks/libs/air/airframework.swc' -library-path '${flex.sdk.path}/frameworks/libs/air/applicationupdater.swc' -library-path '${flex.sdk.path}/frameworks/libs/air/applicationupdater_ui.swc' -library-path '${flex.sdk.path}/frameworks/libs' -library-path '${flex.sdk.path}/frameworks/locale/en_US' -library-path '${basedir}/flex_libs'" />
		<property name="asdoc.source.paths" value="-source-path -source-path '${basedir}/flex_src'" />
		<property name="asdoc.doc.sources" value="-doc-sources '${basedir}/flex_src/net/sf/simonfish/core'" />
		<property name="asdoc.output" value="-output '${asdoc.output.dir}'" />
		<property name="asdoc.exclude" value="-exclude-classes net.sf.simonfish.core" />

		<echo level="info">变量初始化完成...</echo>

		<exec executable="${asdoc.exe}" failonerror="true">
			<arg line="${asdoc.config} ${asdoc.lib.paths} ${asdoc.source.paths} ${asdoc.doc.sources} ${asdoc.output} -main-title='${main-titile}' -warnings -strict=false -left-frameset-width=310 -templates-path '${flex.sdk.path}/asdoc/templates' " />
		</exec>
	</target>
	<target name="clean">
		<delete dir="${asdoc.output.dir}" deleteonexit="true" includeemptydirs="true" defaultexcludes="true">
		</delete>
	</target>
</project>

?

?

? ? 异常:

? ? 1,Error occurred during initialization of VM

? ? ? ??java/lang/NoClassDefFoundError: java/lang/Object

?

? ? 解决:首先,如果出现Error occurred during initialization of VM异常,修改${flex.sdk.path}/bin/jvm.config文件。

? ? 其实,如果出现java/lang/NoClassDefFoundError: java/lang/Object,配置java.home参数即可。

? ? ? ? ? ? ?如果出现java.lang.OutOfMemoryError,配置java.args参数

?

  
#
# VM configuration
#
# Where to find JVM, if {java.home}/jre exists then that JVM is used
# if not then it must be the path to the JRE itself
#
# If no java.home is specified a VM is located by looking in these places in this
# order:
#
#  1) JAVA_HOME environment variables (same rules as java.home above)
#  2) bin directory for java.dll (windows) or lib/<ARCH>/libjava.so (unix)
#  3) ../jre 
#  4) registry (windows only)
#

java.home=E:/devtool/Java/jdk1.5.0_09

# Arguments to VM

java.args=-Xmx384m -Dsun.io.useCanonCaches=false
?

?

?

?

  相关解决方案