This is an automated email from the ASF dual-hosted git repository.
carlosrovira 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 66ef164 avoid create the source map file for @externs files
(complete/improve apache/royale-compiler/#89)
66ef164 is described below
commit 66ef1643b2139778e579b8b3ef342a5bc5b08571
Author: Carlos Rovira <[email protected]>
AuthorDate: Sun Jun 2 18:45:59 2019 +0200
avoid create the source map file for @externs files (complete/improve
apache/royale-compiler/#89)
---
.../royale/compiler/clients/COMPJSCRoyale.java | 30 ++++++++++++++--------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
index 1fd2b83..402e7af 100644
---
a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
+++
b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/COMPJSCRoyale.java
@@ -341,18 +341,26 @@ public class COMPJSCRoyale extends MXMLJSCRoyale
zipOutputStream.flush();
zipOutputStream.closeEntry();
fileList.append(" <file path=\"" +
outputClassFile + "\" mod=\"" + System.currentTimeMillis() + "\"/>\n");
- if(sourceMapTemp != null)
- {
- String sourceMapFile = getOutputSourceMapFile(
- cu.getQualifiedNames().get(0),
- isExterns ? externsOut : jsOut,
- false).getPath();
System.out.println("Writing file: " +
sourceMapFile);
- zipOutputStream.putNextEntry(new
ZipEntry(sourceMapFile));
- sourceMapTemp.writeTo(zipOutputStream);
- zipOutputStream.flush();
- zipOutputStream.closeEntry();
- fileList.append(" <file path=\"" +
sourceMapFile + "\" mod=\"" + System.currentTimeMillis() + "\"/>\n");
+
+ // if the file is @externs DON'T create source map
file
+ boolean createSourceMapFile = false;
+ if (writer instanceof JSWriter)
+ createSourceMapFile =
!((JSWriter)writer).isExterns();
+ if(createSourceMapFile)
+ {
+ if(sourceMapTemp != null)
+ {
+ String sourceMapFile =
getOutputSourceMapFile(
+ cu.getQualifiedNames().get(0),
+ isExterns ? externsOut : jsOut,
+ false).getPath();
+ zipOutputStream.putNextEntry(new
ZipEntry(sourceMapFile));
+ sourceMapTemp.writeTo(zipOutputStream);
+ zipOutputStream.flush();
+ zipOutputStream.closeEntry();
+ fileList.append(" <file path=\"" +
sourceMapFile + "\" mod=\"" + System.currentTimeMillis() + "\"/>\n");
+ }
}
writer.close();
}