Issue with embedded assets in nested modules

Hello,

I am fairly new to IntelliJ.  My development team is attempting to transition from FlashBuilder 4 to IntelliJ.  We have a series of flex projects that are currently building without issue in FlashBuilder.  I have imported the projects into IntelliJ and resolved most of the issues.  However, there is one problem that is driving me crazy.

We have the following project structures:

assets.swc
- Source\Flex\assets\blank_report.gif

styles.swc
- Source\Flex\ImageLibrary.css
--  This css file has references to the images in the assets project like this:  blankReport: Embed("assets/blank_report.gif");

application.swf
- Source\Flex\Application.mxml includes the stylesheet from the styles.swc
- Compilation fails with the following error:  Invalid Embed directive in stylesheet - can't resolve source 'Embed("assets/blank_report.gif")'.

I originally had problems compiling the styles project.  I was able to get that working by creating a library for the assets project and using that as a dependency.  That trick did not work for the main application project.  Any help would be greatly appreciated.  We really want to move to IntelliJ, but this issue is blocking that effort.

Thanks,

Brock

0

Spec requires leading slash, but FB uses own path resolver and doesn't care about Adobe's own spec. So to make code clean please write Embed("/assets/blank_report.gif")

0
Avatar
Permanently deleted user

I have tried that as well.  It doesn't work.  Interestingly enough, it breaks the build in FlashBuilder.

0

Then this seems to be a different case. Please try to use 2 other compilers available at File | Settings | Compiler | Flex Compiler, will the issue remain?

0
Avatar
Permanently deleted user

Same problem with those as well.

0

Is it possible to attach a sample project? (FB or IDEA or both).

0
Avatar
Permanently deleted user

No, I am going to try to replicate the problem in a test project that I could attach if it doesn't work.

0

Yes, sample project would be very helpful to investigate the issue.

0
Avatar
Permanently deleted user

I believe this sample shows the problem.  The assettest.application module doesn't compile due to the same problem I'm having in our other projects.



Attachment(s):
AssetTest.zip
0

Thank you for the sample, your problem is clear now.

That's correct that you have checked 'Include resource files in SWC' check box. And that's correct that resource patterns contain ?*.png. So logo_facebook.png file gets included in resulting assettest_assets.swc.

But if you look into this swc file content (it has zip format, so just open it with any unzipper) you'll notice that logo_facebook.png is in the root of swc, whereas you expect it to be in 'assets' subfolder. IDEA preserves paths relative to source roots when packaging files into SWC, but your 'assettest.assets' module structure is rather strange: you have both 'Flex' and nested 'assets' folders marked as source roots. Unmark 'assets' and you'll get correct compilation.

0
Avatar
Permanently deleted user

Thank you so much.  That solved the problem!!  Goodbye FlashBuilder!!

0

请先登录再写评论。