简体   繁体   English

从命令行编译Flex Builder项目

[英]Compile Flex Builder project from command line

Is there an easy way to build projects created in FlexBuilder via the command line? 有没有一种简单的方法可以通过命令行构建在FlexBuilder中创建的项目?

I'm beginning to work on adding a couple Flex components to the project I have at work. 我正在开始为我工作的项目添加一些Flex组件。 Currently the rest of the project (some java, some C++) is built via an ant script. 目前,项目的其余部分(一些java,一些C ++)是通过ant脚本构建的。 I'd really like to be able to integrate the builds for the Flex components I'm working on into that ant script, but I'm not sure how to build the Flex projects from the command line. 我真的希望能够整合这些版本为我工作的成ant脚本的Flex组件,但我不知道如何通过命令行构建Flex项目。

Is there a way to invoke the flex compiler from the command line such that it uses the flex builder's project as its configuration? 有没有办法从命令行调用flex编译器,以便它使用flex builder的项目作为其配置? Or is there a way to modify FlexBuilder's compilation so that I could write a build script for the project and then have it use that (so that I'd only have one way to build and have both ant and FB use that, instead of separate build processes)? 或者有没有办法修改FlexBuilder的编译,以便我可以为项目编写构建脚本,然后让它使用它(这样我只有一种方法来构建并让ant和FB都使用它,而不是单独使用构建过程)?

While a flex ant task would be preferable it's not really necessary, as I can create custom tasks from command line apps easily enough. 虽然flex ant任务更可取,但并不是必需的,因为我可以轻松地从命令行应用程序创建自定义任务。

EDIT: 编辑:

One additional thing that I should probably mention. 还有一件事我应该提一下。 While I have FlexBuilder installed some of the people who run that ant script do not. 虽然我安装了FlexBuilder,但运行该ant脚本的人却没有。 They would just have the normal Flex SDK. 他们只有普通的Flex SDK。

You can use the -dump-config option in FB to dump the config.xml that FB is using to compile your project, and then use that (using the -load-config option) with your command-line build. 您可以在FB中使用-dump-config选项来转储FB用于编译项目的config.xml,然后在命令行构建中使用它(使用-load-config选项)。

I know in regular Eclipse you can build from an ant file, and I'm pretty sure that you can do the same with FB. 我知道在常规Eclipse中你可以从一个ant文件构建,我很确定你可以用FB做同样的事情。

Although the doc kind of stinks for the flex ant tasks, they work ok. 虽然这类文档对于flex ant任务很臭,但它们运行正常。

[EDIT]- I replied in the comments, but I wanted to flesh out my reply. [编辑] - 我在评论中回答,但我想充实我的回复。
Herms is having a problem using -dump-config and -load-config and it kind of points out why the flex ant tasks are better. Herms使用-dump-config和-load-config时遇到问题,它有点指出为什么flex ant任务更好。 (I didn't want to be the guy who says "why do you want to do X?", so I just answered the asked question). (我不想成为那个说“你为什么要做X?”的人,所以我只回答了问题)。

Even though their doc is subpar (imo), they're better suited for the task of building your projects. 即使他们的文档低于(imo),它们也更适合构建项目的任务。
There are a couple of gotchas using the flex ant tasks, but for the most part, it's not brain surgery (and really the gotchas are more because the doc sucks). 有几个使用flex ant任务的陷阱,但是在大多数情况下,它不是脑部手术(而且实际上因为医生很糟糕而陷入困境)。

When I started working on the automated build for our project, I found this site: 当我开始为我们的项目开始自动构建时,我找到了这个站点:
http://www.nabble.com/FlexCoders-f16212.html http://www.nabble.com/FlexCoders-f16212.html

to be invaluable. 非常宝贵。

I wrote a blog post on exactly how to do this (set Flex up with Ant) and have a sample build file. 我写了一篇关于如何做到这一点的博客文章(使用Ant设置Flex)并有一个示例构建文件。 while I wrote this for Linux, the Ant part is platform agnostic. 当我为Linux编写这个时,Ant部分与平台无关。 (see step 4): (见第4步):

http://blog.apterainc.com/software/setting-up-a-flex-development-enviroment-in-gnulinux/ http://blog.apterainc.com/software/setting-up-a-flex-development-enviroment-in-gnulinux/

If you need any help, leave comments and I can troubleshoot any problems you are having. 如果您需要任何帮助,请留下评论,我可以解决您遇到的任何问题。

EDIT: Documentation for Flex's ant tasks are a bit sparse, but here are the official documentation from Adobe, is was enough to get me on my way: http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html 编辑: Flex蚂蚁任务的文档有点稀疏,但这里是Adobe的官方文档,足以让我顺利上路http//livedocs.adobe.com/flex/3/html/help.html ?内容= anttasks_1.html

Flex 3 comes with Ant tasks for building Flex applications from the command line. Flex 3附带了Ant任务,用于从命令行构建Flex应用程序。 The documentation is available here . 文档可在此处获得 In addition, there is a great open source build framework called Antennae which can help a lot in organizing and building Flex applications from the command line (it is Ant-based). 此外,有一个很棒的开源构建框架叫做Antennae ,它可以帮助很多人从命令行组织和构建Flex应用程序(它是基于Ant的)。

I started out with Antennae and was pretty disappointed when I realized it does not use the Flex Ant Tasks. 我从Antennae开始,当我意识到它没有使用Flex Ant任务时,我非常失望。 To get what I needed I would've needed to hack the command line parameters it passes to mxmlc... and antennae doesn't support modules among other things that are easier to accomplish with the Flex Ant Tasks. 为了得到我需要的东西,我需要破解它传递给mxmlc的命令行参数...而天线不支持模块以及使用Flex Ant Tasks更容易完成的其他事情。 anyway, what I did come up with is a mash up of the good aspects I found in antennae and the good aspects of the build files from this blog post: http://jvalentino.blogspot.com/2010/03/flex-ant-build-optimized-modules_24.html 无论如何,我所做的是混淆了我在天线中找到的好方面以及这篇博文中构建文件的优点: http//jvalentino.blogspot.com/2010/03/flex-ant -build优化-modules_24.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM