Runtime Shared Libraries (RSL's)

R. van Twisk's Avatar

R. van Twisk

31 Jul, 2012 10:00 PM

Hello!

I am new to GradleFX and somewhat new to Gradle.
I managed to compile my Flex application and libraries with GradleFX and all went well.

However, when I compile my application I get to see the unsigned runtime libraries in my project. What I would like to see the signed runtime libraries in my project, framework_4.1.0.16076.swz and friends. It's been a while since I used mxmlc myself.
Is this something I need to set using additionalCompilerOptions?
I currently have that set to : additionalCompilerOptions=['-static-link-runtime-shared-libraries=false', '-optimize=false', '-debug=false']

Ries

  1. Support Staff 1 Posted by Yennick Trevels on 03 Aug, 2012 06:42 AM

    Yennick Trevels's Avatar

    Sorry for the late response but I've been super busy the last few days.
    In GradleFx we are using rsl's by default for swf-based projects and we use the unsigned rsl's.
    You should be able to specify the signed rsl's as file-based rsl's:

    rsl files('mysignedrsl.swc', 'mysecondsignedrsl.swc')

    or alternatively you can use the additionalCompilerOptions to which you can specify any option you want. See http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c... for more information on RSLs.

    I'll try to come up with a better example once I find some more time.

    Hope this helped you a bit further :)

  2. 2 Posted by rvt on 10 Aug, 2012 08:57 PM

    rvt's Avatar

    thanks for the answer,

    I could pickup this project again, and you mentioned I can do something like this:

    rsl files('mysignedrsl.swc', 'mysecondsignedrsl.swc')

    ofcourse I need to change this with the files supplied by adobe, but where do I add 'rsl files' ?

    When added in the depdencies I get: > No such property: rsl for class: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

    I think I am missing something... Just newbie questions I guess :)

  3. 3 Posted by rvt on 10 Aug, 2012 10:25 PM

    rvt's Avatar

    Yennick ,

    I came a bit further. My newby-ishm on groovy and gradle allowed me to put a comma somewhere where it wasn't needed (gradle really needs string IDE support!!)

    When I put this in my dependencies, compiling is successful:

    rsl files('/Applications/Adobe Flash Builder 4 Plug-in/sdks/4.1.0/frameworks/libs/framework.swc')

    When I change it to the following it isn't compiling
    rsl files('/Applications/Adobe Flash Builder 4 Plug-in/sdks/4.1.0/frameworks/libs/framework.swc,framework_4.1.0.16076.swz,,framework_4.1.0.16076.swf')

    From what I understand is that mxmlc should be able to include the swz rather then the swf files. Similar to the option useDebugRSLSwfs="false" using eclipse.

    Our problem is that when we set useDebugRSLSwfs to true, using the non signed files that some of our clients cannot load the flex applications.

  4. 4 Posted by rvt on 10 Aug, 2012 10:45 PM

    rvt's Avatar

    Yennick,

    I could root cause this to the function copyFrameworkRSLs.
    It looks like that GradleFX cannot copy the signed RLS's (with the extension swz).

    I am still a bit vague on this because I cannot supply my own -runtime-shared-library-path as mentioned here : http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c...

    But it seems like that GradleFX needs to be extended with a parameter like : useDebugRSLSwfs so cope with this issue.

    if you agree on this, I can look into such modification and provide a patch...

  5. 5 Posted by rvt on 11 Aug, 2012 04:28 PM

    rvt's Avatar

    Yennick,

    here is a pull request to add that feature : https://github.com/GradleFx/GradleFx/pull/50

    I added a option called useDebugRSLSwfs that when set to false (default is true) to use the signed swz files rather then the unsigned swf files.

  6. Support Staff 6 Posted by Yennick Trevels on 11 Aug, 2012 05:55 PM

    Yennick Trevels's Avatar

    Wow, thanks man :)
    So when you use this option the signed rsl's are working for your application?

    Greetz

  7. 7 Posted by rvt on 11 Aug, 2012 06:56 PM

    rvt's Avatar

    the signed RSL's should be working.

    Over the weekend I will do some extensive testing that will include cleaning my flash and browser caches just to ensure that everything is in working order.

    I will update this thread once confirmed.

  8. Support Staff 8 Posted by Yennick Trevels on 11 Aug, 2012 08:26 PM

    Yennick Trevels's Avatar

    Thanks again.

    I'll try to merge this into the GradleFx code as fast as possible. Still super busy, but since you did the heavy lifting this should be a fast process for me :)

  9. 9 Posted by rvt on 12 Aug, 2012 06:36 PM

    rvt's Avatar

    Yennick,

    I have been digging a bit deeper into the code and I think there is one bug in gradlefx and one area that needs improvements, so don't commit my pull request yet!

    First the bug:

    In the function copyFrameworkRSLs (Mxmlc.groovy) it will copy the swf (unsigned!!) library file from the *.swc file and put that in the projects output directory.
    However, Mxmlc compiles against the settings as found in flex-config.mxml where it's specified as:

        <runtime-shared-library-path>
                <path-element>libs/framework.swc</path-element>
                <rsl-url>http://fpdownload.adobe.com/pub/swz/flex/4.1.0.16076/framework_4.1.0.16076.swz</rsl-url>
                <policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
                <rsl-url>framework_4.1.0.16076.swz</rsl-url>
                <policy-file-url></policy-file-url>
        </runtime-shared-library-path>
    

    That means that if a flex application loads, it will first try to load the signed swz file from the adobe website, and if that couldn't get reached, it would load the swz file from the same host the application was loaded.

    That means that the function copyFrameworkRSLs(..) should not extract the unsigned library.swf from the *.swc file, but copy the swz file from the rsls directory.

    I will create a separate pull request to correct this because the current unsigned library (swf) files won't ever be used anyways.

    The improvement:
    I still want to keep using the setting : useDebugRSLSwfs but instead of the default of true I want to set it to false, this is essentially the current behavior.

    When set to true gradlefx will create a set runtime-shared-library-path entries for the compiler that will instruct it to load the unsigned swf files.
    The created compiler arguments will look like this:
    -runtime-shared-library-path=/libs/framework.swc,framework.swf

    I think that will be better then my current pull request.

  10. 10 Posted by rvt on 12 Aug, 2012 08:50 PM

    rvt's Avatar

    Yennick,

    here is the pull request to fix the above items: https://github.com/GradleFx/GradleFx/pull/51

    it has been tested with both the internet on and off for the signed swz. When the internet was off, the local swz where loaded. When the internet was on, the versions from adobe where loaded

    When the option useDebugRSLSwfs was set to true, gradlefx will include the unsigned swf version instead of the swz version and are loaded as such.

    For each test I made sure the browser caches was cleared and that flash-cache was empties so I could see exactly what files where loaded.

  11. Support Staff 11 Posted by Yennick Trevels on 13 Aug, 2012 01:56 PM

    Yennick Trevels's Avatar

    Thanks again :)

  12. Support Staff 12 Posted by Yennick Trevels on 15 Aug, 2012 02:02 PM

    Yennick Trevels's Avatar

    I've merged your pull request with the develop branch. Closing this discussion.

  13. Yennick Trevels closed this discussion on 15 Aug, 2012 02:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac