flexmojos integration issues

Hi all,

I'm a new user of Intellij IDEA 11.0.1, I've switched to it for better integration with flexmojos.
However, I have come across a few problems.
I'm on Mac OS X 10.6.8.

1) Override maven version

First, we need maven 3.0.3 for flexmojos 4.
It works on command line but not in Intellij IDEA 11.0.1.
I need to override "Maven home directory" in "Preferences > Project settings".
But I need to do it for all projet...
I have found a tiny tools to solve that : EnvironVars.prefPane.
You can found it here : http://www.epikentros.net/Main/Mac_Software.html
But it could be better to be able to install our maven version or to set it but globaly.

2) Flexmojos sdk not set automtically

I import my project in picking my pom.xml
But I need to set manually my flexmojos sdk in "Project strructure > Project settings > Project"
My pom.xml is attached.

3) Compilation variables are not take into account

I have this in my pom :
[...]
<build>
      <plugins>
           <plugin>
                <configuration>

                      <defines>
                          <property>
                              <name>CONFIG::version</name>
                              <value>'dev'</value>
                          </property>
                      </defines>
[...]
But nothing in .dea/flexmojos/test-app-flexmojos-idea-com.ludia.client.xml
To fix it I have found 2 tricks :
- add it in .dea/flexmojos/test-app-flexmojos-idea-com.ludia.client.xml (what I would it be done automatically by IntelliJ)
or
- add in "Project structure > Project settings > Facets >  Additional compiler options" :  -define=CONFIG::version,'DEV'



4) Embed assets

In "Run / Debug Configurations" if I use URL for Launch, all Embeded asset fail (unable to resolve for transcoding)
To fix it I have found 2 tricks :
- add a source path in .dea/flexmojos/test-app-flexmojos-idea-com.ludia.client.xml (what I would it be done automatically by IntelliJ)
or
- add in "Project structure > Project settings > Facets >  Additional compiler options" : -source-path=${myProject}/src/main/resources

5) Not recompiled when lunched with URL

I expected to it recompile before lunching with a URL (as is the case with flash builder).
I need to delete my target directory manually.
This creates a lot of unnecessary steps when you are debugging on facebook development architecture (I serve my swf in a facebook app), having to manually delete stuff each time.

6) override output directory and file name

For my need I want to have my swf named "Main" in "bin-debug" directory
To fix it I have found 2 tricks :
- add a source path in .dea/flexmojos/test-app-flexmojos-idea-com.ludia.client.xml (what I would it be done automatically by IntelliJ, with a way to override it in Facet panel)
or
- add in "Project strructure > Project settings > Facets >  Additionnal compiler options" : -output=${myProject}/bin-debug/Main.swf

By the way, thanks for your great job !
(I prefer it to flashbuilder)

Attachment(s):
pom.xml
0
8 comments

1) To set any project setting for all newly created project use File | Other Settings | Template Settings.

2) You should not set any SDK manually. Special SDK of 'flexmojos' type must be set automatically (it is called 'compiler-4.5.1.21328.pom'). If no SDK is set please try mvn compile from command line and then press Reimport button at Maven tool window. Please drop a note if still no luck.

3) Will check

4) Do paths to embedded assets start with leading slash?
I don't see any reference to src/main/resources in attached pom.xml. How do you expect IDEA to pick it?

5) Why do you need to recompile if nothing changed since last compilation? If you really need this you can use Build | Rebuild project or type anything in source file - respective module will be recompiled.

6) For flexmojos project output file name is taken from pom.xml. There are no ways to override it in IDEA. The only case when IDEA uses different swf name is a run configuration based on main class. In this case swf name is underscore sign ('_') + main class name.

0
Avatar
Permanently deleted user

Thanks for your fast answer !

1) I have not found this, THANKS!

2) No change. But if I modify my flex compiler version in my pom.xml and I save it (in IntelliJ IDEA), the compiler version is updated in facet, but not in the project panel.

3) Thanks!

4) [Embed(source="/q_silhouette.gif")]
To make it work in command line,  I need to add flexmojos-threadlocaltoolkit-wrapper dependency:
[...]

  <build>

      <sourceDirectory>src/main/flex</sourceDirectory>
      <testSourceDirectory>src/test/flex</testSourceDirectory>

    <plugins>

      <plugin>

        <groupId>org.sonatype.flexmojos</groupId>
        <artifactId>flexmojos-maven-plugin</artifactId>
        <version>${flexmojos.version}</version>
        <extensions>true</extensions>


         <dependencies>
            <!--
              to be able to compile with asset,
              because we precise the flex compiler dependency
            -->
            <dependency>
              <groupId>org.sonatype.flexmojos</groupId>
              <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
              <version>${flexmojos.version}</version>
            </dependency>
            <!--
              to be able to swap flex compiler/sdk version
              to let IntelliJ IDEA to detect the flexmojos compiler
            -->
          <dependency>
              <groupId>com.adobe.flex</groupId>
              <artifactId>compiler</artifactId>
              <version>${flex.sdk.version}</version>
              <type>pom</type>
          </dependency>
        </dependencies>


[...]

Concerning the path "src/main/resources", it's a maven convention,
it is used by default, you can induce and redirect the output of this process by running this command:
mvn help:effective-pom > effectivePom.xml
Even if I add explicitly :
[...]

<build>

      <sourceDirectory>src/main/flex</sourceDirectory>
      <testSourceDirectory>src/test/flex</testSourceDirectory>
      <resources>
        <resource><directory>src/main/resources</directory></resource>
      </resources>

[...]
It does not work


I need to add :
-source-path=/Users/slombard/Documents/workspace/AppFlexmojosIDEA/src/main/resources

5) You are right
Ad thanks for the tip

6) Ok
0

2) cannot reproduce.
3) cannot reproduce.


4)


Concerning the path "src/main/resources", it's a maven convention,
it is used by default, you can induce and redirect the output of this process by running this command

Unfortunately, since flexmojs 4.0, it is not true. You need use build-helper-maven-plugin:

<plugin>                 <groupId>org.codehaus.mojo</groupId>                 <artifactId>build-helper-maven-plugin</artifactId>                 <version>1.7</version>                 <executions>                     <execution>                         <id>add-source</id>                         <phase>generate-sources</phase>                         <goals>                             <goal>add-source</goal>                         </goals>                         <configuration>                             <sources>                                 <source>src/main/resources</source>                             </sources>                         </configuration>                     </execution>                 </executions>             </plugin>


For idea 11.0.1 you need modifed flexmojos generator files, see comment http://youtrack.jetbrains.net/issue/IDEA-79711 (Copy attached files to <idea.app>/plugins/flex/lib (backup folder before it).

0
Avatar
Permanently deleted user

2) The first time I import my project (no .idea directory and no .iml), I pick my pom.xml : what I see is attached

3)  As I have in pom.xml, in flexmojos plugin tag :

[...]
<configuration>
              <defines>
                  <property>
                      <name>CONFIG::version</name>
                      <value>'dev'</value>
                  </property>
              </defines>
[...]
I should see in .idea/flexmojos/${artifactId}-${groupid}.xml:
[...]

      <define>
         <name>CONFIG::version</name>
         <value>"dev"</value>
      </define>

[...]
As can flexmojos do,
when there is "<configurationReport>true</configurationReport>" in the configuration tag.
I can see that in the generated file in targer/${artifactId}-${version}-{classifier}-configs.xml


4) Thanks ! It's work well with your fix : http://youtrack.jetbrains.net/issue/IDEA-79711



Attachment(s):
sdk-not-set-4.png
sdk-not-set-3.png
sdk-not-set-2.png
sdk-not-set-1.png
0

2) Excuse me, I am not clear about it — it was fixed in idea 11.1 (is not released yet).
3) Cannot reproduce with attached POM (idea 11.0.1 and idea 11.1). Does it work now (after patch)?

0

The problem with SDK is following: when importing flexmojos projects IDEA created Java module with Flex facets. Java module must have Java SDK set, Flex facets must have Flex SDK. The latter is set automatically on flexmojos project import, but Java SDK can't be set automatically because you have none configured. So please configure any Java SDK at Project Structure | SDKs and you won't see the problem any more.
I agree that this concept with Java module and Flex facets is not obvious. IDEA 11.1 will get rid of it, Flex project structure will be completely rewritten and will become (we hope) easier to maintain.

0
Avatar
Permanently deleted user

Thanks, it works well !

0
Avatar
Permanently deleted user

2) It works well with Alexander Doroshko advice
3) It works after the patch

THANKS !

0

Please sign in to leave a comment.