You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/11/09 19:44:17 UTC
[5/5] git commit: [flex-falcon]
[refs/heads/feature-autobuild/example-maven-dirs] - fix issue now that we
don't blow away output folders
fix issue now that we don't blow away output folders
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ecdfde81
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ecdfde81
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ecdfde81
Branch: refs/heads/feature-autobuild/example-maven-dirs
Commit: ecdfde81cd8205235c4ebcbd2a41726f0393ea02
Parents: d82f28a
Author: Alex Harui <ah...@apache.org>
Authored: Wed Nov 9 11:42:08 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Nov 9 11:44:01 2016 -0800
----------------------------------------------------------------------
.../codegen/mxml/flexjs/MXMLFlexJSPublisher.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ecdfde81/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
index 90f9d80..d742162 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSPublisher.java
@@ -117,11 +117,15 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements IJSPublisher
outputParentFolder = new File(outputPathParameter);
}
}
- // Default to the output folder being the same directory as the one containing the main class
- // FIXME: This sounds like a bad default ...
else
{
- outputParentFolder = new File(configuration.getTargetFileDirectory()).getParentFile();
+ String mainClassFolder = configuration.getTargetFileDirectory();
+ if (mainClassFolder.endsWith("src"))
+ outputParentFolder = new File(configuration.getTargetFileDirectory()).getParentFile();
+ else if (mainClassFolder.endsWith("src/main/flex"))
+ outputParentFolder = new File(configuration.getTargetFileDirectory()).getParentFile().getParentFile().getParentFile();
+ else
+ outputParentFolder = new File(configuration.getTargetFileDirectory());
}
outputParentFolder = new File(outputParentFolder, FLEXJS_OUTPUT_DIR_NAME);
@@ -167,7 +171,7 @@ public class MXMLFlexJSPublisher extends JSGoogPublisher implements IJSPublisher
// Only create a release directory for release builds.
if (configuration.release()) {
- if (!releaseDir.mkdirs()) {
+ if (!releaseDir.exists() && !releaseDir.mkdirs()) {
throw new IOException("Unable to create release directory at " + releaseDir.getAbsolutePath());
}
}