You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by mscharp <mi...@fmr.com> on 2015/08/27 20:57:52 UTC

FlexMojos with RSLs

Hey Chris.

In converting my company's project over to FM 7.1.0-SNAPSHOT and flex
4.14.1, I had to make some changes regarding how the RSLs were specified in
the pom.  I see that you have a page to address this in the wiki, so thought
I would give a go at writing some of it based off my experience.  Please
look at this and use whatever pieces of it you can.  If there is anything
that I've done incorrectly or made bad assumptions, please let me know as
well.

In order to use RSLs in your flex project, you need to declare their usage
in the dependencies section of your pom, eg:

<dependencies>
    <dependency>
        <groupId>org.apache.flex.framework</groupId>
	<artifactId>framework</artifactId>
	<version>${flex.sdk.version}</version>
	<type>swc</type>
	<scope>rsl</scope>
    </dependency>
</dependencies>

Maven will complain that it doesn't know about the 'rsl' scope type, but you
can safely ignore that warning.  It looks like this:

[WARNING] 'dependencies.dependency.scope' for
org.apache.flex.framework:framework:swc must be one of [provided, compile,
runtime, test, system] but is 'rsl'.

The 'rsl' scope type will instruct the compiler not to compile the RSLs into
the final swf and instead will load the RSLs at runtime.

When Flex moved over from Adobe to Apache, the RSL signing went the way of
the dinosaurs.  Before, the RSLs were loaded as swz files.  These were
Adobe's signed RSLs that lived on their servers and the flashplayer would
load the RSLs from there.  The nice thing about this approach was that you
could visit any website and if you had loaded the RSLs once, it would just
pull them from your cache.  

Now, however, you must host the RSLs on your own server.  The RSLs that are
loaded are now loaded as swf files, and will only be cached for other flex
applications on the same domain.  Because of this limitation, RSLs are a bit
less useful than before.  If you have multiple different flex applications
under the same domain however, it can make sense to load the RSLs at runtime
rather than compiling them into your flex application.

In order to get these RSLs as swfs, you also need to depend on the swf
version of the RSL.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <type>swf</type>
    <scope>test</scope> 
</dependency>

Previous to FM 7.1.0 and Flex 4.14.1 this was all that was needed in the
dependency section.  However, now this will result in build errors like
this:

Error: Unable to resolve resource bundle "components" for locale "en_US".
Error: Unable to resolve resource bundle "textLayout" for locale "en_US".
... etcetera

To resolve these errors, you must also declare the resource bundles for the
RSLs you are using.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <classifier>${language}.rb</classifier>
    <type>swc</type>
    <scope>rsl</scope>
</dependency>

You also need to add an element to the configuration section of the flex
mojos plugin to tell the flex application where it needs to look for the
RSLs.

<plugin>
    <groupId>net.flexmojos.oss</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>${flex.mojo.version}</version>
    <extensions>true</extensions>
    <configuration>
        ...
        <rslUrls>
            <url>rsl/{artifactId}-{version}.{extension}</url>
        </rslUrls>
        ...
    </configuration>
</plugin>

Another helpful configuration parameter you can specify is the
removeUnusedRsls parameter.

<removeUnusedRsls>true</removeUnusedRsls>

Lastly, you also need to copy the RSLs into the directory where you've told
your application to look for them.  This will depend on your project and
deployment structure as to whether you need this or not, but a helpful
plugin to do this automatically is the maven-dependency-plugin.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.8</version>
    <executions>
        
        <execution>
            <id>copy-rsls</id>
            <phase>process-resources</phase>
            <goals>
                <goal>copy-dependencies</goal>
            </goals>
            <configuration>
                <includeGroupIds>${flex.groupId}.framework</includeGroupIds>
                <includeTypes>swf</includeTypes>
                <excludeTransitive>true</excludeTransitive>
                <outputDirectory>${basedir}/target/rsl</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

Putting this all together, a basic pom would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.groupId</groupId>
    <artifactId>artifactId</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>swf</packaging>

    <name>My Project</name>

    <properties>
        <flex.mojo.version>7.1.0-SNAPSHOT</flex.mojo.version>
        <flex.sdk.version>4.14.1</flex.sdk.version>
        <flex.groupId>org.apache.flex</flex.groupId>
        <flashplayer.version>18.0</flashplayer.version>
        <flexunit.version>4.3.0-SNAPSHOT</flexunit.version>
        <language>en_US</language>
    </properties>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>net.flexmojos.oss</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>${flex.mojo.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <debug>true</debug>
                    <rslUrls>
                        <url>rsl/{artifactId}-{version}.{extension}</url>
                    </rslUrls>
                    <removeUnusedRsls>true</removeUnusedRsls>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.14.1</version>
                        <type>pom</type>
                    </dependency>
                   <dependency>
                        <groupId>com.adobe</groupId>
                        <artifactId>fontkit</artifactId>
                        <version>1.0</version>
                    </dependency>
                    <dependency>
                        <groupId>net.flexmojos.oss</groupId>
                       
<artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
                        <version>7.1.0-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    
                    <execution>
                        <id>copy-rsls</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                           
<includeGroupIds>${flex.groupId}.framework</includeGroupIds>
                            <includeTypes>swf</includeTypes>
                            <excludeTransitive>true</excludeTransitive>
                           
<outputDirectory>${basedir}/target/rsl</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins> 
    </build>

    <dependencies>
       <dependency>
            <groupId>${flex.groupId}</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flash.framework</groupId>
            <artifactId>playerglobal</artifactId>
            <version>${flashplayer.version}</version>
            <type>swc</type>
        </dependency>

        <dependency>
            <groupId>${flex.groupId}.flexunit</groupId>
            <artifactId>flexunit-flex</artifactId>
            <version>${flexunit.version}</version>
            <type>swc</type>
            <scope>test</scope>
        </dependency>

        
         <dependency>
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>swc</type>
            <scope>rsl</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <classifier>${language}.rb</classifier>
            <type>swc</type>
            <scope>rsl</scope>
        </dependency>
        <dependency> 
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>swf</type>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Hi,

sorry for the late response ... I flagged the mail but didn't have the time to respond :-(
What page are you explicitly talking about? I hope you didn't edit it, as I do have some comments to your findings.

As far as I know as soon as you set scope of a swc to "rsl" it is used and delivered as swf file, so you don't need to provide the swf dependency. If you look at what the flexmojos copy-resources goal creates you will probably see a "rsls" directory in your war containing swf files.

The problem with the resources is unfortunately not directly related to Flexmojos 7.1, but to Maven. In maven they "fixed" a dependency scope resolution problem that Maven had from the dark ages. Unfortunately we were relying on this. The result of Using Flexmojos 7.1 is that you have to use Maven 3.1 or higher and therefore the rb.swc dependencies are stripped from the maven dependency graph. The only way to fix this is to currently add an explicit dependency to those transitive resources. With the simplified extensions mechanism of Maven 3.3.1, I'm thinking of a flex-maven-extension (That's also the reason for me renaming the mavenizer artifact) that tells Maven how to resolve the "rsl" scopes. This will get rid of the warnings and the need to re-define the rb.swcs of rsl dependencies and all should work as desired, but I'm completely swamped with getting mobile support in Flexmojos at the moment.

In your case you shouldn't use the classifier to the rb, but use this instead:
<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <type>rb.swc</type>
</dependency>

As Flexmojos knows how to handle this. Your solution would only work for one language, with this option flexmojos uses a dummy rb.swc and resolves the correct languages at build time, depending on the languages you define. Just have a look at what the mavenizer generates in the pom.xml for "framework" for example ... you simply have to copy the transitive dependencies to your project.

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Donnerstag, 27. August 2015 20:57
An: dev@flex.apache.org
Betreff: FlexMojos with RSLs

Hey Chris.

In converting my company's project over to FM 7.1.0-SNAPSHOT and flex
4.14.1, I had to make some changes regarding how the RSLs were specified in
the pom.  I see that you have a page to address this in the wiki, so thought
I would give a go at writing some of it based off my experience.  Please
look at this and use whatever pieces of it you can.  If there is anything
that I've done incorrectly or made bad assumptions, please let me know as
well.

In order to use RSLs in your flex project, you need to declare their usage
in the dependencies section of your pom, eg:

<dependencies>
    <dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>swc</type>
        <scope>rsl</scope>
    </dependency>
</dependencies>

Maven will complain that it doesn't know about the 'rsl' scope type, but you
can safely ignore that warning.  It looks like this:

[WARNING] 'dependencies.dependency.scope' for
org.apache.flex.framework:framework:swc must be one of [provided, compile,
runtime, test, system] but is 'rsl'.

The 'rsl' scope type will instruct the compiler not to compile the RSLs into
the final swf and instead will load the RSLs at runtime.

When Flex moved over from Adobe to Apache, the RSL signing went the way of
the dinosaurs.  Before, the RSLs were loaded as swz files.  These were
Adobe's signed RSLs that lived on their servers and the flashplayer would
load the RSLs from there.  The nice thing about this approach was that you
could visit any website and if you had loaded the RSLs once, it would just
pull them from your cache.

Now, however, you must host the RSLs on your own server.  The RSLs that are
loaded are now loaded as swf files, and will only be cached for other flex
applications on the same domain.  Because of this limitation, RSLs are a bit
less useful than before.  If you have multiple different flex applications
under the same domain however, it can make sense to load the RSLs at runtime
rather than compiling them into your flex application.

In order to get these RSLs as swfs, you also need to depend on the swf
version of the RSL.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <type>swf</type>
    <scope>test</scope>
</dependency>

Previous to FM 7.1.0 and Flex 4.14.1 this was all that was needed in the
dependency section.  However, now this will result in build errors like
this:

Error: Unable to resolve resource bundle "components" for locale "en_US".
Error: Unable to resolve resource bundle "textLayout" for locale "en_US".
... etcetera

To resolve these errors, you must also declare the resource bundles for the
RSLs you are using.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <classifier>${language}.rb</classifier>
    <type>swc</type>
    <scope>rsl</scope>
</dependency>

You also need to add an element to the configuration section of the flex
mojos plugin to tell the flex application where it needs to look for the
RSLs.

<plugin>
    <groupId>net.flexmojos.oss</groupId>
    <artifactId>flexmojos-maven-plugin</artifactId>
    <version>${flex.mojo.version}</version>
    <extensions>true</extensions>
    <configuration>
        ...
        <rslUrls>
            <url>rsl/{artifactId}-{version}.{extension}</url>
        </rslUrls>
        ...
    </configuration>
</plugin>

Another helpful configuration parameter you can specify is the
removeUnusedRsls parameter.

<removeUnusedRsls>true</removeUnusedRsls>

Lastly, you also need to copy the RSLs into the directory where you've told
your application to look for them.  This will depend on your project and
deployment structure as to whether you need this or not, but a helpful
plugin to do this automatically is the maven-dependency-plugin.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.8</version>
    <executions>

        <execution>
            <id>copy-rsls</id>
            <phase>process-resources</phase>
            <goals>
                <goal>copy-dependencies</goal>
            </goals>
            <configuration>
                <includeGroupIds>${flex.groupId}.framework</includeGroupIds>
                <includeTypes>swf</includeTypes>
                <excludeTransitive>true</excludeTransitive>
                <outputDirectory>${basedir}/target/rsl</outputDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

Putting this all together, a basic pom would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.groupId</groupId>
    <artifactId>artifactId</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>swf</packaging>

    <name>My Project</name>

    <properties>
        <flex.mojo.version>7.1.0-SNAPSHOT</flex.mojo.version>
        <flex.sdk.version>4.14.1</flex.sdk.version>
        <flex.groupId>org.apache.flex</flex.groupId>
        <flashplayer.version>18.0</flashplayer.version>
        <flexunit.version>4.3.0-SNAPSHOT</flexunit.version>
        <language>en_US</language>
    </properties>

    <build>
        <sourceDirectory>src/main/flex</sourceDirectory>
        <testSourceDirectory>src/test/flex</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>net.flexmojos.oss</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>${flex.mojo.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <debug>true</debug>
                    <rslUrls>
                        <url>rsl/{artifactId}-{version}.{extension}</url>
                    </rslUrls>
                    <removeUnusedRsls>true</removeUnusedRsls>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.flex</groupId>
                        <artifactId>compiler</artifactId>
                        <version>4.14.1</version>
                        <type>pom</type>
                    </dependency>
                   <dependency>
                        <groupId>com.adobe</groupId>
                        <artifactId>fontkit</artifactId>
                        <version>1.0</version>
                    </dependency>
                    <dependency>
                        <groupId>net.flexmojos.oss</groupId>

<artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId>
                        <version>7.1.0-SNAPSHOT</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>

                    <execution>
                        <id>copy-rsls</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>

<includeGroupIds>${flex.groupId}.framework</includeGroupIds>
                            <includeTypes>swf</includeTypes>
                            <excludeTransitive>true</excludeTransitive>

<outputDirectory>${basedir}/target/rsl</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
       <dependency>
            <groupId>${flex.groupId}</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flash.framework</groupId>
            <artifactId>playerglobal</artifactId>
            <version>${flashplayer.version}</version>
            <type>swc</type>
        </dependency>

        <dependency>
            <groupId>${flex.groupId}.flexunit</groupId>
            <artifactId>flexunit-flex</artifactId>
            <version>${flexunit.version}</version>
            <type>swc</type>
            <scope>test</scope>
        </dependency>


         <dependency>
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>swc</type>
            <scope>rsl</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <classifier>${language}.rb</classifier>
            <type>swc</type>
            <scope>rsl</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.flex.framework</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.sdk.version}</version>
            <type>swf</type>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Seems I've found the answer:

https://issues.jenkins-ci.org/browse/JENKINS-30058



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49529.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Hey Chris, have another question for you.

Have you attempted to use the extension from a jenkins server?  From what I
can see, jenkins doesn't seem to recognize the .mvn/extensions.xml file when
building a maven project.  If, however, I setup a freestyle jenkins project
and run shell command with mvn install it works fine.  Anyone have some
insight to this?

Thanks



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49528.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Hey Chris, just found an interesting issue/situation.

So, to test the new snapshot I deleted my org.apache.flex folder from my
local maven repository.  I ran my build and everything worked great!  I then
tried to build on my CI server and for other reasons got an error.  But that
lead me to realize I didn't delete the flashplayer from my local maven
repository when I tested the new snapshot.

So, I deleted the flashplayer from my local repo, but left the flex
artifacts since I had already tested that.  In that configuration ( flex
artifacts can be resolved, but not the flash artifacts ) the build fails. 
Looks like a proxy error.

I looked at the code and saw that the proxy settings are only being
configured/set in the initFlex() method which is only executed if the flex
artifacts cannot be resolved.  I suggest the proxy info should be set as
soon as the plugin begins to execute, perhaps in the init() method in
FlexEventSpy?  This way, regardless of what can or cannot be resolved, the
proxy information is available for everything.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49526.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: AW: AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Yay! .. Great :-) 
Thanks for testing and providing feedack ;-)

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Donnerstag, 8. Oktober 2015 23:17
An: dev@flex.apache.org
Betreff: Re: AW: AW: AW: AW: FlexMojos with RSLs

Sweet! Everything looks good.  Thanks again for the help Chris!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49521.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Sweet! Everything looks good.  Thanks again for the help Chris!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49521.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Hey Chris.  I just saw this.  For some reason, I'm not getting updates to my
email from this thread.  Company spam filter might be the issue.

Anyway.  I will test this asap.

Thanks!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p49518.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... just did a refactoring and deployed an update of the flex-sdk-converter libraries. 

I streamlined the ProxySettings and the way the web is accessed ... please give it a try ... the CLI now has 5 more options
-proxyProtocol
-proxyHost
-proxyPort
-proxyUsername
-proxyPassword

Hope this finally resolves the last proxy problem in the Mavenizer.

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Mittwoch, 2. September 2015 18:00
An: dev@flex.apache.org
Betreff: Re: AW: AW: AW: FlexMojos with RSLs

Hehe.  Yeah, I wasn't sure how to get the authentication to work or how to
get user/pass in the CLI version.  Figured you would probably want to add
that :)



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48971.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Hehe.  Yeah, I wasn't sure how to get the authentication to work or how to
get user/pass in the CLI version.  Figured you would probably want to add
that :)



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48971.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ähm ... sorry for not having followed up on that ... yes I did have a look at it ;-)

I would like to fine tune that a little. If I add the ability to use a proxy, then I would like to have it use authentication as well. There's no reason for not supporting that. So give me a little while and I'll add that.

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Mittwoch, 2. September 2015 15:43
An: dev@flex.apache.org
Betreff: Re: AW: AW: FlexMojos with RSLs

Awesome!  I try this out today.

As a side note, have you had a chance to look at the patch for the mavenizer
I sent along in my last response to
http://apache-flex-development.2333347.n4.nabble.com/Problems-Installing-Flash-SDK-according-to-documentation-td48319i20.html#a48946



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48966.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Awesome!  I try this out today.

As a side note, have you had a chance to look at the patch for the mavenizer
I sent along in my last response to
http://apache-flex-development.2333347.n4.nabble.com/Problems-Installing-Flash-SDK-according-to-documentation-td48319i20.html#a48946



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48966.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... done ... a new SNAPSHOT of Flexmojos 7.1.0 is out, bringing support to execute the "copy-flex-resources" goal in SWF artifacts. This makes it possible to directly debug the SWF from inside the artifacts target directory.

https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61317332

This solution was so extemely simple and useful that I can't really explain why it took me that long to think about it ;-)

Chris

________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Mittwoch, 2. September 2015 09:24
An: dev@flex.apache.org
Betreff: AW: AW: FlexMojos with RSLs

Ok ... so the goal actually gives a warning that it's intended for war projects and doesn't seem to do anything.

So how about me simply extending this to run on WAR and SWF projects. If run on a SWF project, flexmojos outputs the resources to the target directory so you can immediately start debugging?

Chris

________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Mittwoch, 2. September 2015 09:02
An: dev@flex.apache.org
Betreff: AW: AW: FlexMojos with RSLs

Ok ... I think I get the point. But I would suggest not to double-add the dependencies as swc and swf.
Usually I resolved this problem by creating a pom artifact that is not part of the reactor. I manually add this pom to IntelliJ and in side all I have is "<module>../../module-a/client</module>" ... but I really get the point ... Thinking about it ... would it be helpful to have a goal in flexmojos that does the same as the "copy-flex-resources" goal, but locally for testing?
Eventually it could also be possible to simply use that goal with an extra execution ... I'll test that right away ... :-)

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Mittwoch, 2. September 2015 00:34
An: dev@flex.apache.org
Betreff: Re: AW: FlexMojos with RSLs

Hey Chris.

Thanks for the insight.  I didn't edit the wiki, but wanted to share at
least what I had found in case it was helpful as a starting point for you
writing the wiki or anyone else upgrading.

The reason I have to depend on the swf files explicitly is because of my
project structure.  I have 2 projects, one is a war project and the other is
the flex project.  When I build my flex project, and it outputs to the
target directory, and without the dependency on the RSL swfs no rsl
directory or files are created.  I need them there for testing locally while
not inside of a war.  The war project does not depend on the swfs explicitly
and it does correctly install the RSLs inside of the war.

I noticed a couple things also that I thought I'd share in case others run
into the same issues.  Using the dependency like this:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <classifier>${language}</classifier>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

Resulted in a "Flex Error #1001: Digest mismatch with RSL" error.  After
reading your email I removed the classifier and changed it to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

And then I got this error "Error: unable to load SWC
framework-4.14.1.rb.swc: could not find catalog.xml within the SWC."

So then I changed it (removed scope) to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
</dependency>

And it all seems to work.

Thanks again Chris for all the work you put into this and answering emails!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48956.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... so the goal actually gives a warning that it's intended for war projects and doesn't seem to do anything.

So how about me simply extending this to run on WAR and SWF projects. If run on a SWF project, flexmojos outputs the resources to the target directory so you can immediately start debugging?

Chris

________________________________________
Von: Christofer Dutz <ch...@c-ware.de>
Gesendet: Mittwoch, 2. September 2015 09:02
An: dev@flex.apache.org
Betreff: AW: AW: FlexMojos with RSLs

Ok ... I think I get the point. But I would suggest not to double-add the dependencies as swc and swf.
Usually I resolved this problem by creating a pom artifact that is not part of the reactor. I manually add this pom to IntelliJ and in side all I have is "<module>../../module-a/client</module>" ... but I really get the point ... Thinking about it ... would it be helpful to have a goal in flexmojos that does the same as the "copy-flex-resources" goal, but locally for testing?
Eventually it could also be possible to simply use that goal with an extra execution ... I'll test that right away ... :-)

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Mittwoch, 2. September 2015 00:34
An: dev@flex.apache.org
Betreff: Re: AW: FlexMojos with RSLs

Hey Chris.

Thanks for the insight.  I didn't edit the wiki, but wanted to share at
least what I had found in case it was helpful as a starting point for you
writing the wiki or anyone else upgrading.

The reason I have to depend on the swf files explicitly is because of my
project structure.  I have 2 projects, one is a war project and the other is
the flex project.  When I build my flex project, and it outputs to the
target directory, and without the dependency on the RSL swfs no rsl
directory or files are created.  I need them there for testing locally while
not inside of a war.  The war project does not depend on the swfs explicitly
and it does correctly install the RSLs inside of the war.

I noticed a couple things also that I thought I'd share in case others run
into the same issues.  Using the dependency like this:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <classifier>${language}</classifier>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

Resulted in a "Flex Error #1001: Digest mismatch with RSL" error.  After
reading your email I removed the classifier and changed it to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

And then I got this error "Error: unable to load SWC
framework-4.14.1.rb.swc: could not find catalog.xml within the SWC."

So then I changed it (removed scope) to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
</dependency>

And it all seems to work.

Thanks again Chris for all the work you put into this and answering emails!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48956.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... I think I get the point. But I would suggest not to double-add the dependencies as swc and swf.
Usually I resolved this problem by creating a pom artifact that is not part of the reactor. I manually add this pom to IntelliJ and in side all I have is "<module>../../module-a/client</module>" ... but I really get the point ... Thinking about it ... would it be helpful to have a goal in flexmojos that does the same as the "copy-flex-resources" goal, but locally for testing?
Eventually it could also be possible to simply use that goal with an extra execution ... I'll test that right away ... :-)

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Mittwoch, 2. September 2015 00:34
An: dev@flex.apache.org
Betreff: Re: AW: FlexMojos with RSLs

Hey Chris.

Thanks for the insight.  I didn't edit the wiki, but wanted to share at
least what I had found in case it was helpful as a starting point for you
writing the wiki or anyone else upgrading.

The reason I have to depend on the swf files explicitly is because of my
project structure.  I have 2 projects, one is a war project and the other is
the flex project.  When I build my flex project, and it outputs to the
target directory, and without the dependency on the RSL swfs no rsl
directory or files are created.  I need them there for testing locally while
not inside of a war.  The war project does not depend on the swfs explicitly
and it does correctly install the RSLs inside of the war.

I noticed a couple things also that I thought I'd share in case others run
into the same issues.  Using the dependency like this:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <classifier>${language}</classifier>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

Resulted in a "Flex Error #1001: Digest mismatch with RSL" error.  After
reading your email I removed the classifier and changed it to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
        <scope>rsl</scope>
</dependency>

And then I got this error "Error: unable to load SWC
framework-4.14.1.rb.swc: could not find catalog.xml within the SWC."

So then I changed it (removed scope) to:

<dependency>
        <groupId>org.apache.flex.framework</groupId>
        <artifactId>framework</artifactId>
        <version>${flex.sdk.version}</version>
        <type>rb.swc</type>
</dependency>

And it all seems to work.

Thanks again Chris for all the work you put into this and answering emails!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48956.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: AW: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Hey Chris.

Thanks for the insight.  I didn't edit the wiki, but wanted to share at
least what I had found in case it was helpful as a starting point for you
writing the wiki or anyone else upgrading.

The reason I have to depend on the swf files explicitly is because of my
project structure.  I have 2 projects, one is a war project and the other is
the flex project.  When I build my flex project, and it outputs to the
target directory, and without the dependency on the RSL swfs no rsl
directory or files are created.  I need them there for testing locally while
not inside of a war.  The war project does not depend on the swfs explicitly
and it does correctly install the RSLs inside of the war.

I noticed a couple things also that I thought I'd share in case others run
into the same issues.  Using the dependency like this:

<dependency>
	<groupId>org.apache.flex.framework</groupId>
	<artifactId>framework</artifactId>
	<version>${flex.sdk.version}</version>
        <classifier>${language}</classifier>
	<type>rb.swc</type>
	<scope>rsl</scope>
</dependency>

Resulted in a "Flex Error #1001: Digest mismatch with RSL" error.  After
reading your email I removed the classifier and changed it to:

<dependency>
	<groupId>org.apache.flex.framework</groupId>
	<artifactId>framework</artifactId>
	<version>${flex.sdk.version}</version>
	<type>rb.swc</type>
	<scope>rsl</scope>
</dependency>

And then I got this error "Error: unable to load SWC
framework-4.14.1.rb.swc: could not find catalog.xml within the SWC."

So then I changed it (removed scope) to:

<dependency>
	<groupId>org.apache.flex.framework</groupId>
	<artifactId>framework</artifactId>
	<version>${flex.sdk.version}</version>
	<type>rb.swc</type>
</dependency>

And it all seems to work.

Thanks again Chris for all the work you put into this and answering emails!



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48956.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

AW: FlexMojos with RSLs

Posted by Christofer Dutz <ch...@c-ware.de>.
Ok ... so you already got that ;-)
Don't bend your head too much around this ... Flexmojos automagically calculates which resources to get. This starts getting really crazy as soon as you use locale-chains (really glad all seems to be working, cause this part of Flexmojos is a nightmare ;-) ). By using the rb.swc dependency type you should be protected from this voodo.
And I don't know if you intended this, you also have to drop the classifier element ... so the correct dependency would be:

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    <type>rb.swc</type>
    <scope>rsl</scope>
</dependency>

Chris

________________________________________
Von: mscharp <mi...@fmr.com>
Gesendet: Montag, 31. August 2015 23:09
An: dev@flex.apache.org
Betreff: Re: FlexMojos with RSLs

Ok, I found my problem.

I was specifying the rb dependencies like so:

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    *<classifier>${language}.rb</classifier>
    <type>swc</type>*
    <scope>rsl</scope>
</dependency>

However, that is incorrect (thought it resolves on the main project).  The
'rb' designation should be specified in the type parameter, not the
classifier.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    *<classifier>${language}</classifier>
    <type>rb.swc</type>*
    <scope>rsl</scope>
</dependency>



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48949.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Ok, I found my problem.

I was specifying the rb dependencies like so:

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    *<classifier>${language}.rb</classifier>
    <type>swc</type>*
    <scope>rsl</scope>
</dependency>

However, that is incorrect (thought it resolves on the main project).  The
'rb' designation should be specified in the type parameter, not the
classifier.

<dependency>
    <groupId>org.apache.flex.framework</groupId>
    <artifactId>framework</artifactId>
    <version>${flex.sdk.version}</version>
    *<classifier>${language}</classifier>
    <type>rb.swc</type>*
    <scope>rsl</scope>
</dependency>



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48949.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexMojos with RSLs

Posted by mscharp <mi...@fmr.com>.
Ok, well my actual flex projects build using this configuration, but my war
project that packages up a few of these swfs fails.  I get 

[ERROR] Failed to execute goal
net.flexmojos.oss:flexmojos-maven-plugin:7.1.0-SNAPSHOT:copy-flex-resources
(copy-swf) on project design: Execution copy-swf of goal
net.flexmojos.oss:flexmojos-maven-plugin:7.1.0-SNAPSHOT:copy-flex-resources
failed: Failed to resolve artifact
org.apache.flex.framework:framework:swf:en_US.rb:4.14.1

This is the configuration of flexmojos in my war project.

<plugin>
	<groupId>net.flexmojos.oss</groupId>
	<artifactId>flexmojos-maven-plugin</artifactId>
	<version>${flex.mojo.version}</version>
	<extensions>true</extensions>
		<executions>
			<execution>
			<id>copy-swf</id>
			<phase>process-sources</phase>
			<goals>
				<goal>copy-flex-resources</goal>
			</goals>
			<configuration>
				<useFinalName>false</useFinalName>
				<stripVersion>true</stripVersion>
			</configuration>
		</execution>
	</executions>
	<dependencies>
		<dependency>
			<groupId>${flex.groupId}</groupId>
			<artifactId>compiler</artifactId>
			<version>${flex.sdk.version}</version>
			<type>pom</type>
		</dependency>
	</dependencies>
</plugin>

Not sure how to get around this problem...



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexMojos-with-RSLs-tp48944p48948.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.