Best way to create Resource Modules

Ed Mitchell's Avatar

Ed Mitchell

23 Oct, 2015 07:53 PM

Hello!

As part of my project, we need to have resource modules separate from the final output .swf file.

To summarize, we have one .swf file that contains the source code, and 3 .swf modules that contain the resource files.

Directory structure is:


src/main/actionscript src/main/locale/build.gradle

I want the final output to be:


build/Output.swf build/Output-.swf

where Output.swf has the compiled src code, and the Output- files just contain the resource files.

Right now I have the Output.swf compiled fine, but I am having trouble configuring a new org.gradlefx.tasks.compile.Compile task from scratch to compile the resource files.

More information about resource modules: https://www.adobe.com/devnet/flex/articles/flex-localization-pt2.html

Is this something that gradlefx supports? Or is it something that I could at least hack together? Any advice would be helpful.

  1. 1 Posted by dpeeters on 25 Oct, 2015 11:13 PM

    dpeeters's Avatar

    Don't know if gradlefx supports this, but you can always create your own gradle tasks on which the build task depends.

    For compiling the resource modules you can use mxmlc as an ant task. Take a look at the following page where I use adt with my own arguments. You can do the same for mxmlc. http://support.gradlefx.org/discussions/questions/3577-how-can-i-bu...

  2. 2 Posted by Ed Mitchell on 26 Oct, 2015 04:51 AM

    Ed Mitchell's Avatar

    Yeah, I was hoping I wouldn't have to implement an ant task, it's not the end of the world, but something I would've liked to avoid.

    Is there not a way to define a task as the type org.gradlefx.tasks.compile.Compile like you can with other gradle tasks like Copy?

  3. Support Staff 3 Posted by Yennick Trevels on 27 Oct, 2015 06:33 PM

    Yennick Trevels's Avatar

    In a similar discussion I provided an example on how to create a custom task which calls the mxmlc compiler: http://support.gradlefx.org/discussions/problems/2195-compile-css-t...

  4. 4 Posted by Ed Mitchell on 27 Oct, 2015 07:09 PM

    Ed Mitchell's Avatar

    Yeah, what I ended up doing is a little bit differently.

    I overrode the functionality in the currently existing Compile class like so:

    Defined a new class that extends CompilerInstructionsBuilder that does not call addMainClass()
    Defined a new class that extends Mxmlc that uses that CompilerInstructionsBuilder
    Defined a new class that extends Compile that overrides createDelegate to return the new Mxmlc extended class

    Seems to work pretty well, I'd love if this functionality was added to Gradlefx, but for now, this works for me.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

24 Mar, 2017 07:10 PM
19 Mar, 2017 04:39 AM
22 Jan, 2017 07:46 AM
11 Oct, 2016 01:18 PM
20 Sep, 2016 04:36 PM

 

06 Sep, 2016 08:05 PM
03 Aug, 2016 11:15 AM
01 Jun, 2016 05:20 PM
03 May, 2016 09:17 PM
07 Apr, 2016 07:43 AM
24 Mar, 2016 05:55 PM