private void generateDebug(DebugInformationBuilder debugInformationBuilder) { try { DebugInformation debugInformation = debugInformationBuilder.getDebugInformation(); String sourceMapName = fileName + ".map"; try (Writer writer = new OutputStreamWriter(buildTarget.appendToResource(fileName), StandardCharsets.UTF_8)) { writer.append("\n//# sourceMappingURL=" + sourceMapName); } try (Writer writer = new OutputStreamWriter(buildTarget.createResource(sourceMapName), StandardCharsets.UTF_8)) { debugInformation.writeAsSourceMaps(writer, "src", fileName); } debugInformation.write(buildTarget.createResource(fileName + ".teavmdbg")); } catch (IOException e) { throw new RuntimeException("IO error occurred writing debug information", e); } }
if (decodeStack) { postBuild = (vm, file) -> { DebugInformation debugInfo = debugEmitter.getDebugInformation(); File sourceMapsFile = new File(file.getPath() + ".map"); File debugFile = new File(file.getPath() + ".teavmdbg");
private void additionalJavaScriptOutput(Writer writer) throws IOException { if (debugInformationGenerated) { assert debugEmitter != null; DebugInformation debugInfo = debugEmitter.getDebugInformation(); File debugSymbolFile = new File(targetDirectory, getResolvedTargetFileName() + ".teavmdbg"); try (OutputStream debugInfoOut = new BufferedOutputStream(new FileOutputStream(debugSymbolFile))) { debugInfo.write(debugInfoOut); } generatedFiles.add(debugSymbolFile); log.info("Debug information successfully written"); } if (sourceMapsFileGenerated) { assert debugEmitter != null; DebugInformation debugInfo = debugEmitter.getDebugInformation(); String sourceMapsFileName = getResolvedTargetFileName() + ".map"; writer.append("\n//# sourceMappingURL=").append(sourceMapsFileName); File sourceMapsFile = new File(targetDirectory, sourceMapsFileName); try (Writer sourceMapsOut = new OutputStreamWriter(new FileOutputStream(sourceMapsFile), StandardCharsets.UTF_8)) { debugInfo.writeAsSourceMaps(sourceMapsOut, "src", getResolvedTargetFileName()); } generatedFiles.add(sourceMapsFile); log.info("Source maps successfully written"); } if (sourceFilesCopied) { copySourceFiles(); log.info("Source files successfully written"); } }
DebugInformation debugInfo = debugEmitter.getDebugInformation(); File debugSymbolFile = new File(targetDirectory, getResolvedTargetFileName() + ".teavmdbg"); try (OutputStream debugInfoOut = new BufferedOutputStream(new FileOutputStream(debugSymbolFile))) { DebugInformation debugInfo = debugEmitter.getDebugInformation(); String sourceMapsFileName = getResolvedTargetFileName() + ".map"; writer.append("\n//# sourceMappingURL=").append(sourceMapsFileName);