improve FB integration. Get a better list of source files so we can compare timestamps so we know when to recompile. Also don't fail if just warnings. FB seemed to keep requesting compiles when we failed with just warnings and never ask for the Report. But if you fail with errors it doesn't keep requesting compiles. Go figure
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ad8fb20e Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ad8fb20e Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ad8fb20e Branch: refs/heads/master Commit: ad8fb20ee552f44c3c717824af0da9d140ec6425 Parents: eadadca Author: Alex Harui <[email protected]> Authored: Sun May 14 21:59:30 2017 -0700 Committer: Alex Harui <[email protected]> Committed: Sun May 14 21:59:30 2017 -0700 ---------------------------------------------------------------------- .../src/main/java/flex2/compiler/Source.java | 12 ++++++++++++ .../src/main/java/flex2/tools/oem/Application.java | 14 ++++++++++++-- .../main/java/flex2/tools/oem/internal/OEMReport.java | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ad8fb20e/flex-compiler-oem/src/main/java/flex2/compiler/Source.java ---------------------------------------------------------------------- diff --git a/flex-compiler-oem/src/main/java/flex2/compiler/Source.java b/flex-compiler-oem/src/main/java/flex2/compiler/Source.java index 91a1ce6..3869b40 100644 --- a/flex-compiler-oem/src/main/java/flex2/compiler/Source.java +++ b/flex-compiler-oem/src/main/java/flex2/compiler/Source.java @@ -19,6 +19,8 @@ package flex2.compiler; +import java.io.File; + import flex2.compiler.io.VirtualFile; /** @@ -118,6 +120,16 @@ public final class Source implements Comparable<Source> return file.getNameForReporting(); } + public String getSourceFileName() + { + String s = getName(); + if (relativePath.length() > 0) + s += relativePath; + s += File.separator; + s += shortName; + return s; + } + public boolean exists() { return file.getLastModified() > 0; http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ad8fb20e/flex-compiler-oem/src/main/java/flex2/tools/oem/Application.java ---------------------------------------------------------------------- diff --git a/flex-compiler-oem/src/main/java/flex2/tools/oem/Application.java b/flex-compiler-oem/src/main/java/flex2/tools/oem/Application.java index 0d9a307..11b14aa 100644 --- a/flex-compiler-oem/src/main/java/flex2/tools/oem/Application.java +++ b/flex-compiler-oem/src/main/java/flex2/tools/oem/Application.java @@ -43,6 +43,7 @@ import org.apache.flex.swf.ISWF; import org.apache.flex.swf.types.RGB; import flash.swf.tags.SetBackgroundColor; +import flex2.compiler.CompilerException; import flex2.compiler.Source; import flex2.compiler.SourceList; import flex2.compiler.io.FileUtil; @@ -635,7 +636,7 @@ public class Application implements Builder mxmljsc.noLink = true; //int returnValue = mxmlc.mainCompileOnly(constructCommandLine2(tempOEMConfiguration.configuration), null); int returnValue = mxmljsc.mainNoExit(constructCommandLine(oemConfiguration), null, true); - if (returnValue == 0) + if (returnValue == 0 || returnValue == 2) returnValue = OK; else returnValue = FAIL; @@ -673,8 +674,10 @@ public class Application implements Builder ApplicationCompilerConfiguration acc = ((ApplicationCompilerConfiguration)config.configuration); sources = new ArrayList<Source>(); VirtualFile[] sourcePaths = acc.getCompilerConfiguration().getSourcePath(); + List<String> sourceFiles = mxmljsc.getSourceList(); String mainFile = mxmljsc.getMainSource(); + VirtualFile mainVirtualFile = null; for (String sourceFile : sourceFiles) { for (VirtualFile sourcePath : sourcePaths) @@ -689,10 +692,17 @@ public class Application implements Builder boolean isRoot = sourceFile.equals(mainFile); Source source = new Source(sourcePath, relPath, shortName, null, false, isRoot); sources.add(source); - break; + if (pathName.equals(mainFile)) + mainVirtualFile = sourcePath; } } } + try { + sourceList = new SourceList(new ArrayList<VirtualFile>(), sourcePaths, mainVirtualFile, new String[0]); + } catch (CompilerException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } ProblemQuery pq = mxmljsc.getProblemQuery(); List<ICompilerProblem> probs = pq.getProblems(); for (ICompilerProblem prob : probs) http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ad8fb20e/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMReport.java ---------------------------------------------------------------------- diff --git a/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMReport.java b/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMReport.java index 21b1d73..e628e08 100644 --- a/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMReport.java +++ b/flex-compiler-oem/src/main/java/flex2/tools/oem/internal/OEMReport.java @@ -530,7 +530,7 @@ public class OEMReport implements Report // use this version for now for (Source s : sources) { - sourceNames.add(s.getName()); + sourceNames.add(s.getSourceFileName()); } /* // AJH not sure why all this is needed
