I don't think we have to keep things the way they are, but I know that using current directory would definitely mess me up because I'm used to the way MXMLC works.
In a brief check of compilers, javac, tsc and the regular MXMLC all default to placing the compiled file next to the source file. FalconJX (MXMLJSC) could do the same, but it also generates a ton of other files, copying in Google Closure Library and JS files from the SWCs, so having all of that output in a folder is easier to clean up. Thoughts? -Alex On 1/11/17, 11:51 AM, "Josh Tynjala" <[email protected]> wrote: >MXMLFlexJSPublisher contains the following code that is run when no output >path is specified in the compiler options: > >//begin code >String mainClassFolder = configuration.getTargetFileDirectory(); >if (mainClassFolder.endsWith("src")) > outputParentFolder = new >File(configuration.getTargetFileDirectory()).getParentFile(); >else if (mainClassFolder.endsWith("src/main/flex") || >mainClassFolder.endsWith("src\\main\\flex")) > outputParentFolder = new >File(configuration.getTargetFileDirectory()).getParentFile().getParentFile >().getParentFile(); >else > outputParentFolder = new File(configuration.getTargetFileDirectory()); >//end code > >In plain English: > >1. If the main class is in a src directory, bin will be created in the >parent directory of src. > >2. If the main class is in a src/main/flex directory (in other words, if >it's a Maven project), bin will be created in ../../.. > >3. Otherwise, bin will be created in the same directory as the main class. > >I often use "source" rather than "src", so I was getting source/bin as my >output directory, which was unexpected. > >Rather than hardcoding a couple of special paths, maybe we should create >bin relative to the current working directory instead. I think that's a >common behavior for command line tools. > >With this change, both of these commands should continue to work exactly >the same way: > >mxmlc src/Main.mxml >mxmlc src/main/flex/Main.mxml > >I assume that Maven sets the CWD to the correct location before it runs >the >compiler too. > >This would also allow other build tools with different project structures >to work without modifying the compiler. > >Thoughts? > >- Josh
