------------用ant mxmlc 怎么編譯一個文件夾底下的多個文件?-----------

horizonlyhw 2010-01-25 09:41:11
在ant裡面 如果用javac編譯多個文件 就是下面這樣

<javac srcdir="${src.dir}" destdir="${des.dir}"> </javac>


用mxmlc編譯一個文件是這樣:

<mxmlc
file="${APP_ROOT}/Main.mxml"
output="${DEPLOY_DIR}/Main.swf">
</mxmlc>


要是用mxmlc編譯 多個文件 是啥參數?
...全文
318 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
horizonlyhw 2010-01-27
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 phyerbarte 的回复:]
当编译进行的时候,应该编译器会自动编译所有关连的mxml文件,如果你要编译不相互关联的文件,貌似没有办法。。
[/Quote]

多謝 明白一點點~~
phyerbarte 2010-01-26
  • 打赏
  • 举报
回复
引一段国外论坛的问答,相信你能看懂
[Quote]
We are using Ant to do our automated builds, and are calling the mxmlc task for each mxml file separately (See question 78230 similar example). Running the compiler separately for each mxml file, however, is already adding up to a considerable amount of time. Our build time is approaching 10 minutes, 5 minutes for compiling our flex apps, and 5 minutes for compiling hundreads of java classes, building jars, installer etc. Each flex compile run is reasonably quick (15-20 seconds), but they add up.

Is there a way to compile all of them with one call to mxmlc?
[/Quote]

[Quote]
One way to speed it up a bit is to compile everything but the top-level classes into one big SWC using compc, then compiling the top-level classes and using the SWC as a library. That way classes that are used by more than one application will only be compiled once.

However, a large contributor to the time it takes to compile a Flex application is the JVM startup time, and each compile will start up it's own JVM (plus one for the Ant process). One way to avoid this is to use the Flex Compiler Shell (fcsh) instead of Ant, but that has it's downsides of course. Another way is to try HellFire, which runs the compiler in a separate always-on process, meaning no more waiting for the JVM to start.
[/Quote]
phyerbarte 2010-01-26
  • 打赏
  • 举报
回复
当编译进行的时候,应该编译器会自动编译所有关连的mxml文件,如果你要编译不相互关联的文件,貌似没有办法。。
horizonlyhw 2010-01-26
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 archko 的回复:]
intellij idea-》run the main.mxml|main1.mxml|main2.mxml
[/Quote]
archko 2010-01-26
  • 打赏
  • 举报
回复
intellij idea-》run the main.mxml|main1.mxml|main2.mxml
左大神在这 2010-01-25
  • 打赏
  • 举报
回复
Sorry,i don't know any about mxmlc,but i hope someone who has experiences with mxmlc can help you ,good luck.
horizonlyhw 2010-01-25
  • 打赏
  • 举报
回复
up
horizonlyhw 2010-01-25
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 q625400097 的回复:]

              <mxmlc   file= "${APP_ROOT}/Main.mxml "   output= "${DEPLOY_DIR}/Main.swf "/>
              <mxmlc   file= "${APP_ROOT}/Main1.mxml "   output= "${DEPLOY_DIR}/Main1.swf "/>
              <mxmlc   file= "${APP_ROOT}/Main2.mxml "   output= "${DEPLOY_DIR}/Main2.swf "/>

这样行吗?
[/Quote]

。。 就是為了避免這樣的寫法~~ 如果要有N個main 那豈不要一直修改build.xml~~
Sonyer_520 2010-01-25
  • 打赏
  • 举报
回复

<mxmlc file="${APP_ROOT}/Main.mxml" output="${DEPLOY_DIR}/Main.swf"/>
<mxmlc file="${APP_ROOT}/Main1.mxml" output="${DEPLOY_DIR}/Main1.swf"/>
<mxmlc file="${APP_ROOT}/Main2.mxml" output="${DEPLOY_DIR}/Main2.swf"/>

这样行吗?
horizonlyhw 2010-01-25
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 chuan122345 的回复:]
Sorry,i don't know any about mxmlc,but i hope someone who has experiences with mxmlc can help you ,good luck.
[/Quote]

thx all the same

62,615

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧