This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
The following commit(s) were added to refs/heads/develop by this push: new e179dae per platform json output e179dae is described below commit e179daeb2d33793021830ec5529558bd12a3f1bc Author: Alex Harui <aha...@apache.org> AuthorDate: Fri Feb 23 16:53:18 2018 -0800 per platform json output --- .../apache/royale/compiler/clients/ASDOCJSC.java | 16 ++++++++++++-- .../codegen/js/royale/JSRoyaleASDocEmitter.java | 25 +++++++++++++++++----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java index c4a78e9..d8c4601 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/ASDOCJSC.java @@ -27,6 +27,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Set; import org.apache.commons.io.FilenameUtils; import org.apache.royale.compiler.clients.problems.ProblemQuery; @@ -211,7 +212,16 @@ public class ASDOCJSC extends MXMLJSCRoyale if (errors.size() > 0) return false; } - + + Map<String, String> defs = config.getCompilerDefine(); + String swf = defs.get("COMPILE::SWF"); + if (swf != null) + { + if (swf.equals("true")) + middle = ".swf"; + else + middle = ".js"; + } String outputFolderName = getOutputFilePath(); File outputFolder = null; @@ -359,6 +369,8 @@ public class ASDOCJSC extends MXMLJSCRoyale } } + String middle = ""; + /** * Get the output class file. This includes the (sub)directory in which the * original class file lives. If the directory structure doesn't exist, it @@ -387,7 +399,7 @@ public class ASDOCJSC extends MXMLJSCRoyale qname = cname[cname.length - 1]; } - return new File(sdirPath + qname + "." + project.getBackend().getOutputExtension()); + return new File(sdirPath + qname + middle + "." + project.getBackend().getOutputExtension()); } /** diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java index 44befd2..d8a3d84 100644 --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/royale/JSRoyaleASDocEmitter.java @@ -795,10 +795,25 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit return description.substring(0, c + 1); return description; } + + private String getMiddle(RoyaleASDocProject project) + { + Map<String, String> defs = project.config.getCompilerDefine(); + String swf = defs.get("COMPILE::SWF"); + String middle = ""; + if (swf != null) + { + if (swf.equals("true")) + middle = ".swf"; + else + middle = ".js"; + } + return middle; + } public void outputIndex(File outputFolder, RoyaleASDocProject project) throws IOException { - final File indexFile = new File(outputFolder, "index.json"); + final File indexFile = new File(outputFolder, "index" + getMiddle(project) + ".json"); FileWriter out = new FileWriter(indexFile); out.write("{ \"index\": ["); System.out.println("Compiling file: " + indexFile); @@ -991,7 +1006,7 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit public void outputClasses(File outputFolder, RoyaleASDocProject project) throws IOException { - final File indexFile = new File(outputFolder, "classes.json"); + final File indexFile = new File(outputFolder, "classes" + getMiddle(project) + ".json"); FileWriter out = new FileWriter(indexFile); out.write("{ \"classes\": ["); System.out.println("Compiling file: " + indexFile); @@ -1051,7 +1066,7 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit e.printStackTrace(); } - final File listFile = new File(outputFolder, "classlist.json"); + final File listFile = new File(outputFolder, "classlist" + getMiddle(project) + ".json"); out = new FileWriter(listFile); out.write("{ \"classnames\": ["); System.out.println("Compiling file: " + listFile); @@ -1083,7 +1098,7 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit } if (commentaryList.size() > 0) { - final File commentaryFile = new File(outputFolder, "commentary.json"); + final File commentaryFile = new File(outputFolder, "commentary" + getMiddle(project) + ".json"); FileWriter commentaryWriter = new FileWriter(commentaryFile); commentaryWriter.write("{ \"list\": ["); System.out.println("Building commentary comparison file: "+commentaryFile); @@ -1117,7 +1132,7 @@ public class JSRoyaleASDocEmitter extends JSGoogEmitter implements IJSRoyaleEmit public void outputTags(File outputFolder, RoyaleASDocProject project) throws IOException { - final File indexFile = new File(outputFolder, "tags.json"); + final File indexFile = new File(outputFolder, "tags" + getMiddle(project) + ".json"); FileWriter out = new FileWriter(indexFile); out.write("{ \"tags\": ["); System.out.println("Compiling file: " + indexFile); -- To stop receiving notification emails like this one, please contact aha...@apache.org.