No problem! It's done. - Josh
On Thu, Apr 7, 2016 at 11:49 AM, Alex Harui <aha...@adobe.com> wrote: > Ok. I won't have time to rework it until this evening. If you have time > to do it sooner that is fine too. > > > Sent from my LG G3, an AT&T 4G LTE smartphone > > > ------ Original message------ > > *From: *Josh Tynjala > > *Date: *Thu, Apr 7, 2016 11:36 AM > > *To: *dev@flex.apache.org; > > *Subject:*Re: [1/2] git commit: [flex-falcon] [refs/heads/develop] - > changes to get XML in the requires > > > Hey Alex, > > The require for Language does not need to be appended in > MXMLFlexJSPublisher anymore. I moved it into the postProcess() step of > JSFlexJSEmitter. The reason I did this is because inserting an extra line > near the top of the file, after the file had already been written, broke > its source map. Everything was off by one line. In the emitter, it's still > possible to adjust the source maps to account for that extra line before > the file gets written. > > Ideally, the require for XML would be part of the emitter's postProcess() > too, for the same reason. > > - Josh > > On Thu, Apr 7, 2016 at 10:55 AM, <aha...@apache.org> wrote: > > > Repository: flex-falcon > > Updated Branches: > > refs/heads/develop 88a9bc28c -> bdc933e4c > > > > > > changes to get XML in the requires > > > > > > Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo > > Commit: > http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/6c6584da > > Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/6c6584da > > Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/6c6584da > > > > Branch: refs/heads/develop > > Commit: 6c6584da5be8ab5c4df0012110479b4d7d336a8b > > Parents: 88a9bc2 > > Author: Alex Harui <aha...@apache.org> > > Authored: Thu Apr 7 10:39:28 2016 -0700 > > Committer: Alex Harui <aha...@apache.org> > > Committed: Thu Apr 7 10:42:59 2016 -0700 > > > > ---------------------------------------------------------------------- > > .../js/flexjs/TestFlexJSGlobalClasses.java | 1 + > > .../codegen/js/flexjs/TestFlexJSProject.java | 15 +++ > > .../flex/compiler/internal/test/TestBase.java | 98 > ++++++++++++++------ > > .../flexjs/projects/interfaces/Test_result.js | 1 + > > .../flexjs/projects/super/Base_result.js | 1 + > > .../flexjs/projects/xml_requires/XMLRequire.as | 30 ++++++ > > .../projects/xml_requires/XMLRequire_result.js | 74 +++++++++++++++ > > .../codegen/js/jx/PackageHeaderEmitter.java | 2 +- > > .../mxml/flexjs/MXMLFlexJSPublisher.java | 71 ++++++++++++++ > > .../internal/projects/FlexJSProject.java | 5 + > > compiler.tests/.classpath | 1 + > > 11 files changed, 270 insertions(+), 29 deletions(-) > > ---------------------------------------------------------------------- > > > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java > > index df663af..32f28f5 100644 > > --- > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java > > +++ > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalClasses.java > > @@ -27,6 +27,7 @@ import > > org.apache.flex.compiler.internal.projects.FlexJSProject; > > import org.apache.flex.compiler.internal.tree.as.VariableNode; > > import org.apache.flex.compiler.tree.as.IASNode; > > import org.apache.flex.compiler.tree.as.IBinaryOperatorNode; > > +import org.apache.flex.compiler.tree.as.IFileNode; > > import org.apache.flex.compiler.tree.as.IForLoopNode; > > import org.apache.flex.compiler.tree.as.IFunctionCallNode; > > import org.apache.flex.compiler.tree.as.IFunctionNode; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java > > index fec0d2f..c057f92 100644 > > --- > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java > > +++ > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSProject.java > > @@ -131,6 +131,21 @@ public class TestFlexJSProject extends > TestGoogProject > > } > > > > @Test > > + public void test_XMLRequires() > > + { > > + String testDirPath = projectDirPath + "/xml_requires"; > > + > > + String fileName = "XMLRequire"; > > + > > + sourcePath = new > > File(TestAdapterFactory.getTestAdapter().getUnitTestBaseDir(), > > + projectDirPath + "/xml_requires").getPath(); > > + > > + List<String> compiledFileNames = compileProject(fileName, > > testDirPath); > > + > > + assertProjectOut(compiledFileNames, testDirPath); > > + } > > + > > + @Test > > public void test_Overrides() > > { > > String testDirPath = projectDirPath + "/overrides"; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java > > index 186f690..d8d6e36 100644 > > --- > > > a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java > > +++ > > > b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java > > @@ -40,6 +40,7 @@ import java.util.List; > > import org.apache.flex.compiler.codegen.as.IASEmitter; > > import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter; > > import org.apache.flex.compiler.config.Configurator; > > +import org.apache.flex.compiler.constants.IASLanguageConstants; > > import org.apache.flex.compiler.driver.IBackend; > > import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens; > > import org.apache.flex.compiler.internal.codegen.as.ASFilterWriter; > > @@ -350,7 +351,7 @@ public class TestBase implements ITestBase > > qname = mainCU.getQualifiedNames().get(0); > > final File outputClassFile = getOutputClassFile(qname > > + "_output", outputRootDir); > > - appendLanguage(outputClassFile.getAbsolutePath(), qname); > > + appendLanguageAndXML(outputClassFile.getAbsolutePath(), > > qname); > > } catch (InterruptedException e) { > > // TODO Auto-generated catch block > > e.printStackTrace(); > > @@ -374,34 +375,75 @@ public class TestBase implements ITestBase > > fw.close(); > > } > > > > - private void appendLanguage(String path, String projectName) > > - throws IOException > > - { > > - StringBuilder appendString = new StringBuilder(); > > - > > appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > - > appendString.append(ASEmitterTokens.PAREN_OPEN.getToken()); > > - > > appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > - > > appendString.append(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken()); > > - > > appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > - > > appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken()); > > - > appendString.append(ASEmitterTokens.SEMICOLON.getToken()); > > - > > - String fileData = readCode(new File(path)); > > - int reqidx = fileData.indexOf(appendString.toString()); > > - > > + private void appendLanguageAndXML(String path, String projectName) > > throws IOException > > + { > > + StringBuilder appendString = new StringBuilder(); > > + > appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + appendString.append(ASEmitterTokens.PAREN_OPEN.getToken()); > > + appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + > > appendString.append(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken()); > > + appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken()); > > + appendString.append(ASEmitterTokens.SEMICOLON.getToken()); > > + appendString.append("\n"); > > + > > + String fileData = readCode(new File(path)); > > + int reqidx = fileData.indexOf(appendString.toString()); > > if (reqidx == -1 && project instanceof FlexJSProject && > > ((FlexJSProject)project).needLanguage) > > - { > > - reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > - if (reqidx == -1) > > - reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > - reqidx = fileData.indexOf(";", reqidx); > > - String after = fileData.substring(reqidx + 1); > > - String before = fileData.substring(0, reqidx + 1); > > - String s = before + "\n" + appendString.toString() + > > after; > > - writeFile(path, s, false); > > - } > > - } > > - > > + { > > + boolean afterProvide = false; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + { > > + afterProvide = true; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + } > > + reqidx = fileData.indexOf(";", reqidx); > > + String after = fileData.substring(reqidx + 1); > > + String before = fileData.substring(0, reqidx + 1); > > + if (afterProvide) > > + before += "\n"; > > + String s = before + "\n" + appendString.toString() + after; > > + writeFile(path, s, false); > > + } > > + > > + StringBuilder appendStringXML = new StringBuilder(); > > + > > appendStringXML.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + appendStringXML.append(ASEmitterTokens.PAREN_OPEN.getToken()); > > + appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendStringXML.append(IASLanguageConstants.XML); > > + appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendStringXML.append(ASEmitterTokens.PAREN_CLOSE.getToken()); > > + appendStringXML.append(ASEmitterTokens.SEMICOLON.getToken()); > > + appendStringXML.append("\n"); > > + > > + if (project instanceof FlexJSProject && > > ((FlexJSProject)project).needXML) > > + { > > + fileData = readCode(new File(path)); > > + reqidx = fileData.indexOf(appendStringXML.toString()); > > + if (reqidx == -1) > > + { > > + boolean afterProvide = false; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + { > > + afterProvide = true; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + } > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + reqidx = fileData.indexOf(";", reqidx); > > + String after = fileData.substring(reqidx + 1); > > + String before = fileData.substring(0, reqidx + 1); > > + if (afterProvide) > > + before += "\n"; > > + String s = before + "\n" + appendStringXML.toString() > > + after; > > + writeFile(path, s, false); > > + } > > + } > > + } > > + > > protected String readCode(File file) > > { > > String code = ""; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js > > ---------------------------------------------------------------------- > > diff --git > > a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js > > b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js > > index 42ab0f4..92bb29f 100644 > > --- > > a/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js > > +++ > > b/compiler.jx.tests/test-files/flexjs/projects/interfaces/Test_result.js > > @@ -29,6 +29,7 @@ goog.require('org.apache.flex.utils.Language'); > > > > > > > > + > > /** > > * @constructor > > * @extends {classes.A} > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js > > ---------------------------------------------------------------------- > > diff --git > > a/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js > > b/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js > > index 1306674..db3ade9 100644 > > --- a/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js > > +++ b/compiler.jx.tests/test-files/flexjs/projects/super/Base_result.js > > @@ -26,6 +26,7 @@ goog.require('org.apache.flex.utils.Language'); > > > > > > > > + > > /** > > * @constructor > > * @extends {Super} > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire.as > > ---------------------------------------------------------------------- > > diff --git > > a/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire.as > > b/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire.as > > new file mode 100644 > > index 0000000..4a997c9 > > --- /dev/null > > +++ > > b/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire.as > > @@ -0,0 +1,30 @@ > > > > > +//////////////////////////////////////////////////////////////////////////////// > > +// > > +// Licensed to the Apache Software Foundation (ASF) under one or more > > +// contributor license agreements. See the NOTICE file distributed > with > > +// this work for additional information regarding copyright ownership. > > +// The ASF licenses this file to You under the Apache License, Version > > 2.0 > > +// (the "License"); you may not use this file except in compliance with > > +// the License. You may obtain a copy of the License at > > +// > > +// http://www.apache.org/licenses/LICENSE-2.0 > > +// > > +// Unless required by applicable law or agreed to in writing, software > > +// distributed under the License is distributed on an "AS IS" BASIS, > > +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > +// See the License for the specific language governing permissions and > > +// limitations under the License. > > +// > > > > > +//////////////////////////////////////////////////////////////////////////////// > > +package > > +{ > > + > > + public class XMLRequire > > + { > > + public function XMLRequire() > > + { > > + var myXML:XML = <node />; > > + } > > + } > > + > > +} > > \ No newline at end of file > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire_result.js > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire_result.js > > > b/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire_result.js > > new file mode 100644 > > index 0000000..d6affbe > > --- /dev/null > > +++ > > > b/compiler.jx.tests/test-files/flexjs/projects/xml_requires/XMLRequire_result.js > > @@ -0,0 +1,74 @@ > > +/** > > + * Licensed under the Apache License, Version 2.0 (the "License"); > > + * you may not use this file except in compliance with the License. > > + * You may obtain a copy of the License at > > + * > > + * http://www.apache.org/licenses/LICENSE-2.0 > > + * > > + * Unless required by applicable law or agreed to in writing, software > > + * distributed under the License is distributed on an "AS IS" BASIS, > > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > implied. > > + * See the License for the specific language governing permissions and > > + * limitations under the License. > > + */ > > +/** > > + * XMLRequire > > + * > > + * @fileoverview > > + * > > + * @suppress {checkTypes|accessControls} > > + */ > > + > > +goog.provide('XMLRequire'); > > + > > +goog.require('XML'); > > + > > + > > + > > + > > + > > +/** > > + * @constructor > > + */ > > +XMLRequire = function() { > > + var /** @type {XML} */ myXML = new XML( '<node />') ; > > +}; > > + > > + > > +/** > > + * Metadata > > + * > > + * @type {Object.<string, Array.<Object>>} > > + */ > > +XMLRequire.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'XMLRequire', > > qName: 'XMLRequire'}] }; > > + > > + > > +/** > > + * Prevent renaming of class. Needed for reflection. > > + */ > > +goog.exportSymbol('XMLRequire', XMLRequire); > > + > > + > > + > > +/** > > + * Reflection > > + * > > + * @return {Object.<string, Function>} > > + */ > > +XMLRequire.prototype.FLEXJS_REFLECTION_INFO = function () { > > + return { > > + variables: function () { > > + return { > > + }; > > + }, > > + accessors: function () { > > + return { > > + }; > > + }, > > + methods: function () { > > + return { > > + 'XMLRequire': { type: '', declaredBy: 'XMLRequire'} > > + }; > > + } > > + }; > > +}; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > > > b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > > index 48acf5b..d47c6dc 100644 > > --- > > > a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > > +++ > > > b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java > > @@ -208,7 +208,7 @@ public class PackageHeaderEmitter extends > JSSubEmitter > > implements > > > > if (NativeUtils.isNative(imp)) > > { > > - if (!(imp.equals("QName") || > > imp.equals("Namespace"))) > > + if (!(imp.equals("QName") || > > imp.equals("Namespace") || imp.equals("XML") || imp.equals("XMLList"))) > > continue; > > } > > > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java > > > b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java > > index 347e01c..4dcc1be 100644 > > --- > > > a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java > > +++ > > > b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java > > @@ -42,6 +42,7 @@ import > org.apache.commons.io.filefilter.RegexFileFilter; > > import org.apache.flex.compiler.clients.problems.ProblemQuery; > > import org.apache.flex.compiler.codegen.js.IJSPublisher; > > import org.apache.flex.compiler.config.Configuration; > > +import org.apache.flex.compiler.constants.IASLanguageConstants; > > import org.apache.flex.compiler.css.ICSSPropertyValue; > > import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens; > > import org.apache.flex.compiler.internal.codegen.js.JSSharedData; > > @@ -278,6 +279,7 @@ public class MXMLFlexJSPublisher extends > > JSGoogPublisher implements IJSPublisher > > > > appendExportSymbol(projectIntermediateJSFilePath, projectName); > > appendEncodedCSS(projectIntermediateJSFilePath, projectName); > > + appendLanguageAndXML(projectIntermediateJSFilePath, > projectName); > > > > // if (!subsetGoog) > > // { > > @@ -525,6 +527,75 @@ public class MXMLFlexJSPublisher extends > > JSGoogPublisher implements IJSPublisher > > } > > } > > > > + private void appendLanguageAndXML(String path, String projectName) > > throws IOException > > + { > > + StringBuilder appendString = new StringBuilder(); > > + > appendString.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + appendString.append(ASEmitterTokens.PAREN_OPEN.getToken()); > > + appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + > > appendString.append(JSFlexJSEmitterTokens.LANGUAGE_QNAME.getToken()); > > + appendString.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendString.append(ASEmitterTokens.PAREN_CLOSE.getToken()); > > + appendString.append(ASEmitterTokens.SEMICOLON.getToken()); > > + appendString.append("\n"); > > + > > + String fileData = readCode(new File(path)); > > + int reqidx = fileData.indexOf(appendString.toString()); > > + if (reqidx == -1 && project.needLanguage) > > + { > > + boolean afterProvide = false; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + { > > + afterProvide = true; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + } > > + reqidx = fileData.indexOf(";", reqidx); > > + String after = fileData.substring(reqidx + 1); > > + String before = fileData.substring(0, reqidx + 1); > > + if (afterProvide) > > + before += "\n"; > > + String s = before + "\n" + appendString.toString() + after; > > + writeFile(path, s, false); > > + } > > + > > + StringBuilder appendStringXML = new StringBuilder(); > > + > > appendStringXML.append(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + appendStringXML.append(ASEmitterTokens.PAREN_OPEN.getToken()); > > + appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendStringXML.append(IASLanguageConstants.XML); > > + appendStringXML.append(ASEmitterTokens.SINGLE_QUOTE.getToken()); > > + appendStringXML.append(ASEmitterTokens.PAREN_CLOSE.getToken()); > > + appendStringXML.append(ASEmitterTokens.SEMICOLON.getToken()); > > + appendStringXML.append("\n"); > > + > > + if (project.needXML) > > + { > > + fileData = readCode(new File(path)); > > + reqidx = fileData.indexOf(appendStringXML.toString()); > > + if (reqidx == -1) > > + { > > + boolean afterProvide = false; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + { > > + afterProvide = true; > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + } > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_REQUIRE.getToken()); > > + if (reqidx == -1) > > + reqidx = > > fileData.lastIndexOf(JSGoogEmitterTokens.GOOG_PROVIDE.getToken()); > > + reqidx = fileData.indexOf(";", reqidx); > > + String after = fileData.substring(reqidx + 1); > > + String before = fileData.substring(0, reqidx + 1); > > + if (afterProvide) > > + before += "\n"; > > + String s = before + "\n" + appendStringXML.toString() > > + after; > > + writeFile(path, s, false); > > + } > > + } > > + } > > + > > protected String readCode(File file) > > { > > String code = ""; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java > > ---------------------------------------------------------------------- > > diff --git > > > a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java > > > b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java > > index a1098a7..67869ab 100644 > > --- > > > a/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java > > +++ > > > b/compiler.jx/src/org/apache/flex/compiler/internal/projects/FlexJSProject.java > > @@ -101,7 +101,11 @@ public class FlexJSProject extends FlexProject > > } > > } > > else if (!isExternalLinkage(to) || > > qname.equals("Namespace")) > > + { > > + if (qname.equals("XML")) > > + needXML = true; > > reqs.put(qname, dt); > > + } > > } > > } > > else > > @@ -134,6 +138,7 @@ public class FlexJSProject extends FlexProject > > > > public boolean needLanguage; > > public boolean needCSS; > > + public boolean needXML; > > > > private LinkageChecker linkageChecker; > > private ITargetSettings ts; > > > > > > > http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6c6584da/compiler.tests/.classpath > > ---------------------------------------------------------------------- > > diff --git a/compiler.tests/.classpath b/compiler.tests/.classpath > > index c8aaecc..7508ebe 100644 > > --- a/compiler.tests/.classpath > > +++ b/compiler.tests/.classpath > > @@ -9,5 +9,6 @@ > > <classpathentry kind="lib" path="/compiler/lib/commons-io.jar"/> > > <classpathentry kind="src" path="/compiler"/> > > <classpathentry kind="lib" path="/compiler/lib/guava.jar"/> > > + <classpathentry kind="lib" > > path="/compiler.tests/lib/commons-compress-1.10.jar"/> > > <classpathentry kind="output" path="classes"/> > > </classpath> > > > > >