开发者

Command-line build of a Flex 4 project

开发者 https://www.devze.com 2023-03-26 17:16 出处:网络
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.

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 开发者_StackOverflowversion.

Is there a way to build a flex project from the command line, without manually specifying all dependencies and without manually creating a workspace?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消