Flex 4 项目的命令行构建
我们的产品中有一个 Flex 4.0 项目,我们正在尝试为其设置命令行构建。这将在我们的构建服务器上使用。
到目前为止,我们已经尝试了三种方法,但似乎没有一种令人满意:
1)使用 mxmlc - 这有一个缺点,即我们必须显式给出所有依赖项,而不是使用项目中已存在的依赖项。
2)使用ant(特别是fb.exportreleasebuild) - 效果很好,但我不知道如何用它设置工作区。现在,我可能可以预先设置一个工作区,但我相信这不会工作,因为 Eclipse 使用绝对路径(请参阅 http://forums.adobe.com/thread/826995)。
3)使用maven - 我还没有尝试过,但是通过阅读一些教程(例如 http://ria.dzone.com/articles/flex-and-maven?page=0,1&mz=8019-adobe),看起来就像依赖项也必须手动指定一样。另外,我必须指定确切的 Flex 编译器版本,这看起来不太优雅 - 我不想在更改编译器版本时更新我的构建脚本。
有没有一种方法可以从命令行构建 Flex 项目,而无需手动指定所有依赖项,也无需手动创建工作区?
We have a Flex 4.0 project in our product and we're trying to set up command-line build for it. This is to be used on our build server.
So far we have tried three approaches, but none seems satisfactory:
1) Using mxmlc - this has the drawback that we have to explicitly give all dependencies, instead of using the ones already present in the project.
2) Using ant (specifically fb.exportreleasebuild) - works well, but I cannot figure out how to set up a workspace with it. Now, I can probably set up a workspace beforehand, but I am led to believe this will not work due to Eclipse using absolute paths (see http://forums.adobe.com/thread/826995).
3) Using maven - I haven't tried it yet, but from reading some tutorials (e.g. http://ria.dzone.com/articles/flex-and-maven?page=0,1&mz=8019-adobe), it looks like the dependencies have to be manually specified as well. Also, I have to specify the exact Flex compiler version, which seems inelegant - I don't want to update my build script when I change the compiler version.
Is there a way to build a flex project from the command line, without manually specifying all dependencies and without manually creating a workspace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上周我“很高兴”为我们的项目设置了 Maven 构建。
对于没有自定义字体、资源、单元测试、第 3 方框架等的简单项目来说,启动起来相对轻松。对于其余的东西,需要进行大量的试验和错误,直到它发挥作用为止。
管理需要手动安装的依赖项的一种方法是创建一个 shell 脚本,该脚本自动将工件从 libs 目录安装到本地存储库中,您也可以将其放入项目工作区中。通过这种方法,您可以使用 libs-directory 进行 Eclipse 构建,并使用本地 Maven 存储库进行 Maven 构建。
至于 Flex 的版本 - 它只是 POM 中的一个属性值。在maven世界中就是这样完成的——你管理POM,而不是去下载一个新的SDK,然后更新项目属性等等,真的是简单无比。
但是,当您需要嵌入字体时,您需要手动安装一些属于 Flex SDK 一部分的工件,所以事情没那么简单。为了自动执行此操作,我还将整个 Flex SDK 作为项目工作区的一部分,以便我可以在脚本中使用相对路径而不是绝对路径来引用它。
到目前为止,Flex 社区中最常用的方法是使用 Ant 构建。
Maven 的设置和采用仍然相对困难。
During the last week I've had the "pleasure" to setup the maven build for our project.
For a simple project that doesn't have custom fonts, resources, unit tests, 3rd party frameworks, etc. it is relatively painless to get it going. For the rest of the stuff there's a significant trial and error until you get it working.
One way to manage the dependencies you need to install manually is to make a shell-script which automates the installation of the artifacts from the libs-directory into a local repository which you can put also in the project workspace. With this approach you can use the libs-directory for the Eclipse build and the local maven repo for the maven build.
As to the version of Flex - it is just a single property value in the POM. This is how it is done in the maven world - you manage the POM, instead of downloading a new SDK, then updating the project properties, etc. It's really incomparably simpler.
But when you need to embed fonts you would need to install manually some artifacts that are part of the Flex SDK, so it's not that simple. In order to automate this, I also put the whole Flex SDK as part of the project workspace, so that I can refer to it with a relative path in my scripts instead of an absolute.
So far, the most utilized approach in the Flex community is using Ant builds.
Maven is still relatively difficult to be setup and adopted.