On Mar 20, 10:03 am, Rutger <
rhert...@gmail.com> wrote:
> When I give the flex builder the project->clean command flex builder
> automaticly copies all the assets from the project to the target
> directory. (e.g stylesheets and ini files). But when I use the plugin
> and run maven, the only file that is generated is the swf
>
> It looks like this option is set in the .actionScriptProperties file
> by the copyDependentFiles setting.
> Is there a way to give this option to the command line compiler?
There is no way to give the option to the compiler, because the
compiler does not handle that step, even in Flex Builder. The compiler
only generates the swf, but Flex Builder does extra build steps to
package all the other files together into a runnable/deployable
bundle.
The maven plugin could be extended to provide similar functionality.
We currently have a custom maven build setup the does this for us
using profiles and the maven-resources plugin.
We build our main app with Flex Builder, but we use maven to build an
automation version of our application for testing. Here is a snippet
of our build (with some stuff removed):
<profiles>
<profile>
<id>automation</id>
<properties>
<outputDirectory>target</outputDirectory>
</properties>
<build>
<finalName>Main</finalName>
<plugins>
<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<flexHome>${flex.home}</flexHome>
<useNetwork>true</useNetwork>
<main>Main.mxml</main>
<javaOpts>-Xmx1024m</javaOpts>
<flex.java.options>-Xmx1024m</
flex.java.options>
<java.options>-Xmx1024m</java.options>
<resolveExtraSwcsFromFlexFrameworksLibs>true</
resolveExtraSwcsFromFlexFrameworksLibs>
<extraParameters>
<parameter>
<name>verbose-stacktraces</name>
</parameter>
<parameter>
<name>include-libraries+=$
{flex.home}/frameworks/libs/automation.swc</name>
</parameter>
<parameter>
<name>include-libraries+=$
{flex.home}/frameworks/libs/automation_agent.swc</name>
</parameter>
</extraParameters>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</
artifactId>
<executions>
<execution>
<id>automationresources</id>
<phase>install</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/
target</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/flex/</directory>
<excludes>
<exclude>org/**</exclude>
<exclude>com/**</exclude>
<exclude>*.mxml</exclude>
</excludes>
</resource>
<resource>
<directory>${basedir}/html-template</
directory>
</resource>
</resources>
</build>
</profile>
</profiles>
It's not very elegant, but it does the job that we need for now. We
have all of our html/css/images/etc. resources in src/main/flex. Our
src/main/resources dir has a Main.html file with some filter variables
in it so it mimics the same output that Flex Builder does (I basically
copied the Main.html that Flex Builder generates and replaced the
version and app name with variables).
Hope that helps as a stopgap for now.
Logan