How to generate a SWC (and use that in a multimodule project)
Hey guys, how are you? First of all, thanks for this great build tool.
Currently I'm migrating a medium to big Flex project that is currently relying in FlexMojos.
The main problem is that I have to generate a test swc from the src/test/flex folder, and use that only in test scope.
The second thing - how do I reference it? Just plain test project(':commonTest') ?
Thanks in advance, and Kind Regards
Rafa
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
Support Staff 1 Posted by Yennick Trevels on 22 Oct, 2013 06:05 AM
Do you have other sources in src/main/flex? If not, then you can assign the src/test/flex folder to the srcDirs property, like this:
Then you can reference it as you suggested, so just "test project(':commonTest')"
2 Posted by rafanami on 22 Oct, 2013 07:33 PM
Thanks Yennick. I was using includeSources, but I'll try with srcDirs, because it really makes more sense.
Cheers, keep up the great work!
3 Posted by rafanami on 22 Oct, 2013 08:15 PM
Hey Yennick, I've tried the srcDirs, but since the test classes uses a test scoped flexunit setup, I have compilation errors. So I'm sticking with the includeSources for now.
Thanks!
Rafa
Support Staff 4 Posted by Yennick Trevels on 22 Oct, 2013 08:21 PM
Normally you can put the FlexUnit libraries on 'external' scope. Then, in the project where you want to use that test swc, include the FlexUnit libraries in 'test' scope.
5 Posted by rafanami on 27 Nov, 2013 11:16 PM
Hi Yennick, how are you?
Had to drop this for some time, but now that I have some time to follow it up, it seems that I'm having some problem to compile 2 dependent SWCs.
I have a layout like this:
project
swc1 build.gradle swc2 (depends on swc1) build.gradle swf build.gradle build.gradle
settings.gradle
As I'm using the includeSources in the swc1 subproject, It's getting really strange results, because when I do a gradle build, and the build arrives in swc2, there are some compile errors.
And plus, the size of the swc for swc1 is really tiny compared with the maven counterpart (as I've said earlier, I'm trying to migrate from Maven to GradleFx).
So far, I was following the same pattern described in the examples for multimodules project.
the root build.gradle had the following structure
for swc1:
and for swc2
Thanks in advance, and Kind Regards
Rafa
Support Staff 6 Posted by Yennick Trevels on 28 Nov, 2013 07:41 AM
for swc1, can you try this:
So combine the srcDirs property with the includeSources property. In case you get an error, please post it here.