Try it. Try to @Embed an image file that isn't on the source path and see what the Flex compiler does. Try to add an <mx:Style source="styles.css"/> directive for a .css file that isn't on the source path and see what the Flex compiler does. Compilation fails, because, unlike javac, compc and mxmlc require that these types of resources be available on the compile path. All of our images and icons are in src/main/assets, and all of our CSS files are in src/main/styles. Therefore, they *must* be source paths. So what should we do? Collapse it all down into src/main/flex? That's foolish. The result would be much more difficult to navigate. Part of the reason Maven supports the concepts of source paths and resource paths is to allow splitting files out into logical groupings to make it clear where to find a given file.
The resource inclusion is unfortunate, that's true. Sadly, at least in FlexMojos 3.8, FlexMojos isn't very good at finding bundles without a little help. I've tried removing directives related to paths containing our resource bundles and doing so causes the build to fail because the compiler can't find them anymore. And don't say use FlexMojos 4. Our project can't use Maven 3 at the moment. There are politics involved in that decision that *I*, as a developer, do not have control over, and that's just how it is. Maybe our project is structured oddly, but you seem rather more interested in denouncing sins than elaborating solutions. If this isn't the way you feel it should be done, maybe you can find 5 minutes to write a useful e-mail making some coherent suggestions on how we could layout our project better, instead of saying we're doing something wrong but offering no insight on how we could do it right. Such an e-mail could benefit the entire FlexMojos community, instead of stirring up resentment. I'm certainly open to hearing your suggestions. The fact that you have the skills and understanding of the Flex toolkit that it takes to build and maintain FlexMojos is more than proof that you have insight to offer. This structure was laid out before I was even hired to work on this code. *I *did not do this. But given a choice between building this with Ant and building it with FlexMojos, even if I have to do some unfortunate things with my POMs, I'm going to build it with Maven every time. So here we are, living with reality, and it stays reality because we don't know another way to do it. Bryan Turner On Sun, Feb 13, 2011 at 2:35 PM, Marvin Froeder <[email protected]> wrote: > Ow you are.. adding all path for bundles is just one example on what you > shouldn't be doing... and still, I don't think all other are needed as > well.... at least no as an source entry. > > Sent from Android > > Em 13/02/2011 15:50, "Bryan Turner" <[email protected]>escreveu: > > > We're doing nothing wrong, and we're not "abusing" source paths. The Flex > compiler requires that resources like .css files, images, fonts, etc., in > addition to ActionScript and MXML code, be on the *source path* when it > compiles. This is not a requirement that the Java compiler has, by > comparison. As a result, we have a choice: Either we stuff *everything*into > src/main/flex so we can play nicely with the 1 source path FlexMojos > has by default, since even src/main/resources is not included as a > sourcePath by default, or we use the build helper plugin to add additional > sourcePaths, allowing us to separate our various resources out in a > sensible, clear manner that is readily intuitive to all of the developers on > the project. It's a decision that was imposed by the realities of the Flex > compiler, and is reinforced and supported by the same. > Please know, if the Flex compiler did not function the way it does, we > wouldn't have to muck with source paths to allow us to have a clean project > layout. Achieving the separation we want on a Java project is trivial, and > doesn't require a lot of sourcePaths. Unfortunately, on Flex, that's not the > case. > > Bryan Turner > > On Sun, Feb 13, 2011 at 12:39 PM, Marvin Froeder <[email protected]> > wrote: > >> > >> > You are doing something seriously wrong if you need to abuse of extra >> source paths like that....... >> >> >> >> >> >> Em 13/02/2011 15:26, "Bryan Turner" <[email protected]>escreveu: >> >> >> >> >> >> Apologies, it l... >> >> -- >> >> > You received this message because you are subscribed to the Google >> > Groups "Flex Mojos" group. >> > ... >> >> > > -- > You received this message because you are subscribed to the Google > Groups "Flex Mojos" group. > ... > > -- > You received this message because you are subscribed to the Google > Groups "Flex Mojos" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/flex-mojos > > http://flexmojos.sonatype.org/ > -- You received this message because you are subscribed to the Google Groups "Flex Mojos" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex-mojos http://flexmojos.sonatype.org/
