Flex application using RSLs and Flex Mojos/Maven support

Hi all,

the new built-in flex-mojos support is just awsome! I just had to import the Maven 2 projects using Flex Mojos and was able to compile these projects right away. That's really great.

Unfortunately it does not help much, when your application has a dependency to other libraries that are consumed as RSLs. Each time you want to launch the application from within the IDE the application cannot load the library RSLs as they are not included in the target folder. So you have to copy all RSLs of dependent libraries there. But this isn't a practical solution.

So it would be great, if IntelliJ could provide a workaround this:

  1. Suggestion: Look up the libraries that have either the scope 'rsl' or 'caching'  and automatically copy them to the output directory according to the configured rslUrl schema. E.g. this can be configured with Flex Mojos like this:
                <rslUrls>
            <rslUrl>rsls/{artifactId}-{version}.{extension}</rslUrl>
          </rslUrls>

    so an RSL should be copied to target/rsls/myLibrary-1.0-SNAPSHOT.swf.
  2. When running a compile in IDEA offer the option in the Flex facet to link libraries statically and ignore the RSL scope.


I would prefer Option 1, since this is closest to the Maven build, but Option 2 would also be OK as our current workaround is to not use the generated flex-config, but use the IDEA internal compiler to create an application that statically links against the libraries.

Best regards,
Carsten

4 comments
Comment actions Permalink

Hi Carsten,
Thank you for your feedback!
Your suggestion looks reasonable. I'd say it would be better to look for rsl-url not in pom but in flex compiler config file. I think a checkbox could be added to flex run configuration to control files copying. You may open a request for that: http://jetbrains.net/tracker/welcome

Currently if you want to avoid manual copying you may create an ant task and configure it to be executed before launching Flex run configuration.

0
Comment actions Permalink

Alexander,

yes you are right. Looking that up in the generated compiler file makes more sense and is probably much easier to implement for you. However I just saw that all path-elements refer to artifacts in the Maven repository. It would be better, if IDEA would only take the artifacts that are not build by a module in the current projects from the repository.

Normaly a developer has modules that generate some of his own RSLs. In that case IDEA should make these RSLs and copy them from the output directory of the module and not from the repository.

Best regards,
Carsten

0
Comment actions Permalink
However I just saw that all path-elements refer to artifacts in the Maven repository.

I noticed that if pom.xml has ordinary swc dependency

<dependency>
      <groupId>my.multimodule</groupId>
      <artifactId>lib</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>swc</type>
</dependency>

then *-config report.xml file has link to respective swc in local target folder

<path-element>...\lib\target\lib-1.0-SNAPSHOT.swc</path-element>


Can you attach an example of pom.xml and *-config-report.xml files were you expect to see different path?

0

Please sign in to leave a comment.