Best way to create Resource Modules

Ed Mitchell's Avatar

Ed Mitchell

23 Oct, 2015 07:53 PM


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:

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.

  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:

  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


? 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

07 May, 2023 04:17 PM
28 Apr, 2023 11:22 PM
23 Apr, 2023 09:43 AM
03 Nov, 2022 01:22 AM
29 Jun, 2022 05:39 PM


04 Aug, 2021 12:50 PM
15 Apr, 2021 06:10 PM
15 Jan, 2021 06:56 PM
09 Mar, 2020 11:11 PM
09 Mar, 2020 11:09 PM
17 Apr, 2019 02:51 PM