Flex project - "unable to open defaults.css"

I have a default css file specified in my compiler args, and the compiler fails instantly complaining about being unable to open it.  It's specified:
-include-file defaults.css defaults.css

What do I need to do to get this to work?  This is copied straight over from my FlashBuilder project.

9 comments
Comment actions Permalink

Try to use path relative to project root (where .idea folder or *.ipr file resides) or use absolute path as the first argument of -include-file option

0
Comment actions Permalink

FlashBuilder/Eclipse syntax...I'm not used to the whole module thing yet...

Because I have so many projects referencing shared libs, I keep my projects in a common location, and allow them to be shared.  I don't have them inside my workspace folder or anything like that.

Are you saying that I need to change the include-file to be a path from my workspace to my actual projects?  so if my structure is:

/Code/Proj1
/Projects/MyProject

I'd need to configure Proj1's settings to use ../Code/Proj1/src/defaults.css?

0
Comment actions Permalink

Eclipse's workspace is similar to IDEA's project.
Eclipse's project becomes IDEA's module.

IDEA's project root is a folder in which '.idea' folder resides (if your IDEA's project has directory-based format) or a folder in which *.ipr file resides (if your IDEA's project has file-based format).

Flex compiler launched by IDEA has IDEA's project root as a home directory, so you should use paths relative to it or absolute. Unfortunately IDEA doesn't update relative paths automatically when importing Flash Builder projects, this should be fixed.

0
Comment actions Permalink

I'm not sure what I'm doing wrong...I'm storing my modules in the project folder now (which I hate doing).

I setup one of the modules to reference the defaults.css: -include-file defaults.css \MyProx-3.x\src\defaults.css

It still complains about being unable to open it.

0
Comment actions Permalink
I'm storing my modules in the project folder now (which I hate doing).

What's the need of doing this? You can keep modules anywhere, not under project root, even on a different drive.

For example project root is D:\work\SomeProject,
module root is D:\work\SomeModule,
I just checked that this option works: -include-file default.css ..\SomeModule\default.css

By the way what is your IDEA version and which compiler do you use (see File | Settings | Compiler | Flex Compiler)?

Also there's an option 'Include resource files in SWC at Advanced tab of Flex Compielr Settings. If checked then all files that are located under module source roots and that match resource patterns (configured at File | Settings | Compiler | Resource patterns) will be included in SWC. I'm not sure that it can be used instead of Additional compielr options for you as it probably will include too many extra files in SWC. So it's just for information.

0
Comment actions Permalink

I put the modules in my project because I don't want to do a long line of changing directories to get from the project to the module files (my defaults.css).

IDEA is 10.5.1

The compiler mxmlc.

0
Comment actions Permalink

I managed to get it to work, my initial \ was throwing it off...does that make it start at the root of the drive instead of the root of the project?

0
Comment actions Permalink

Yes, I think. It is compiler behavior, not IDEA's. FB uses own path resolver when compiling, so its behavior is sometimes different.

0
Comment actions Permalink

By the way, I just recalled one more opportunity: use ${MODULE_DIR} macros. You additional options will look like
-include-file default.css ${MODULE_DIR}/src/default.css
and you absolutely do not care where the module is placed on the disk.

0

Please sign in to leave a comment.