|
|
|
Not an injection.
A similar bug was fixed for css during flex 3 in changelist #181629 This prevents us from embedding assets in automated builds. Please to fix.
Matt,
"Injections" usually mean that something worked previously but then a changed caused something to break in a newer build. Not an injection means that this behavior isnt new to Flex 3, and existed in earlier versions/builds. Peter As Robert Ames mentions, this bug prevents automated build scripts, like Ant, to create embedded asset statements using resource paths from another directory other than the current source file. This is a very common action in automated builds scripts, so please fix these bug.
I'm running into the problem as well and noticed that a somewhat hacked workaround is to embed the absolute path into the Embed statement, instead of a proposed relative one that should be resolved via the -source-path compiler option. I guess the code in the compiler is assuming that "/" at the beginning should really look at the absolute file path instead of a relative one. Here's what's happening.
Overview: --- FB provides a custom PathResolver (com.adobe.flexbuilder.project.ProjectSourcePathResolver) to MXMLC for resources/embeds. It uses Eclipse/FB's path resolution code and provides a real File object given a path. Paths that start with a "/" have special meaning, relevant "to page 965 of the Flex Developer Guide" as stated above -- they basically work that way in Eclipse, slash means root of the project and can be relative or on the source path. Which is why it works in FB. In MXMLC, the code which does the same thing (for both Embed and @Embed, so we need to add test cases and fix it for @Embed too) has a very descriptive comment which explicitly does not provide this functionality. It only adds the relative source path of the main mxml/as file, and the 'owner' path, whatever that means (IFF the owner is a path resolver, if the owner is a SourceList, etc., then nothing happens). I spent a while trying to get access to the source path (specified in Configuration), in EmbedUtil where the resolution code lives. Unless the 'owner' should encapsulate it somehow. Unless 'owner', Source, or CompilationUnit have access to source path, there's really no way to get at it in EmbedUtil without serious refactoring. Commentary: --- I don't know how these docs got written, but the code in MXMLC doesn't seem to ever have known it was supposed to do this. Further, I don't know if the syntax for this is workable... Absolute paths on a mac start with a slash -- granted we could improve the logic in mxmlc, but it's currently written to only check if it starts with a slash. Also, I'm not sure what the EXACT semantics are supposed to be. I assume we're supposed to search all source paths for a file name -- what if there are collisions in the name, you can surely have two jpgs of the same name in two different source paths. I don't know how FB resolves this situation, but there's a good chance there will be a disparity in functionality if we implement it here, unless we ask FB to NOT resolve resources anymore, and have mxmlc do it. Is the workaround of "../" really not feasible? Can "./" be used for the current directory? I don't see why an image should be found "on some source path" -- is there a reason that someone cannot specify a relative path? Resolution: I feel like we should deprecate this functionality and update the docs. Or someone knows a technical reason that we can implement this feature in a desired way based on what I wrote above, and/or we come up with a better syntax like "sp:/". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
http://tech.groups.yahoo.com/group/flexcoders/message/103050