diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java index 7672259b6..2310341bd 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java @@ -63,6 +63,7 @@ import com.as3mxml.asconfigc.air.AIROptionsParser; import com.as3mxml.asconfigc.air.AIRSigningOptions; import com.as3mxml.asconfigc.animate.AnimateOptions; +import com.as3mxml.asconfigc.compiler.ASDocOptions; import com.as3mxml.asconfigc.compiler.CompilerOptions; import com.as3mxml.asconfigc.compiler.CompilerOptionsParser; import com.as3mxml.asconfigc.compiler.ConfigName; @@ -242,6 +243,7 @@ public ASConfigC(ASConfigCOptions options) throws ASConfigCException { private ASConfigCOptions options; private List compilerOptions; + private List asdocOptions; private List> allModuleCompilerOptions; private List> allWorkerCompilerOptions; private List airOptions; @@ -250,6 +252,7 @@ public ASConfigC(ASConfigCOptions options) throws ASConfigCException { private String projectType; private boolean clean; private boolean watch; + private boolean includeAsdoc; private boolean debugBuild; private boolean copySourcePathAssets; private String jsOutputType; @@ -378,6 +381,7 @@ private void parseConfig(JsonNode json) throws ASConfigCException { debugBuild = options.debug != null && options.debug.equals(true); } compilerOptions = new ArrayList<>(); + asdocOptions = new ArrayList<>(); allModuleCompilerOptions = new ArrayList<>(); allWorkerCompilerOptions = new ArrayList<>(); if (options.debug != null) { @@ -393,6 +397,7 @@ private void parseConfig(JsonNode json) throws ASConfigCException { String configName = json.get(TopLevelFields.CONFIG).asText(); detectConfigRequirements(configName); compilerOptions.add("+configname=" + configName); + asdocOptions.add("+configname=" + configName); } if (json.has(TopLevelFields.COMPILER_OPTIONS)) { compilerOptionsJSON = json.get(TopLevelFields.COMPILER_OPTIONS); @@ -412,6 +417,13 @@ private void parseConfig(JsonNode json) throws ASConfigCException { jsOutputPath = compilerOptionsJSON.get(CompilerOptions.JS_OUTPUT).asText(); } } + if (json.has(TopLevelFields.ASDOC_OPTIONS)) { + JsonNode asdocOptionsJSON = json.get(TopLevelFields.ASDOC_OPTIONS); + CompilerOptionsParser.parseASDoc(asdocOptionsJSON, asdocOptions); + if (asdocOptionsJSON.has(ASDocOptions.INCLUDE)) { + includeAsdoc = asdocOptionsJSON.get(ASDocOptions.INCLUDE).asBoolean(); + } + } if (json.has(TopLevelFields.ADDITIONAL_OPTIONS)) { JsonNode jsonAdditionalOptions = json.get(TopLevelFields.ADDITIONAL_OPTIONS); if (jsonAdditionalOptions.isArray()) { @@ -845,6 +857,7 @@ private void readCompilerOptions(JsonNode compilerOptionsJson) throws ASConfigCE CompilerOptionsParser parser = new CompilerOptionsParser(); try { parser.parse(compilerOptionsJson, options.debug, compilerOptions); + parser.parseForASDoc(compilerOptionsJson, asdocOptions); } catch (Exception e) { StringWriter stackTrace = new StringWriter(); e.printStackTrace(new PrintWriter(stackTrace)); @@ -1079,6 +1092,10 @@ private void compileProject() throws ASConfigCException { List moduleCompilerOptions = allModuleCompilerOptions.get(i); options.compiler.compile(projectType, moduleCompilerOptions, workspacePath, sdkPath); } + + if (includeAsdoc && swfOutputPath != null) { + options.compiler.buildASDoc(projectType, swfOutputPath, asdocOptions, workspacePath, sdkPath); + } } private void copySourcePathAssetToOutputDirectory(String assetPath, String mainFile, List sourcePaths, @@ -1645,4 +1662,4 @@ private void packageAIR() throws ASConfigCException { throw new ASConfigCException("Failed to execute Adobe AIR Packager: " + e.getMessage()); } } -} \ No newline at end of file +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/TopLevelFields.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/TopLevelFields.java index 5e8d9c783..4ed7ad810 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/TopLevelFields.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/TopLevelFields.java @@ -30,4 +30,5 @@ public class TopLevelFields { public static final String MAIN_CLASS = "mainClass"; public static final String MODULES = "modules"; public static final String WORKERS = "workers"; -} \ No newline at end of file + public static final String ASDOC_OPTIONS = "asdocOptions"; +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/ASDocOptions.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/ASDocOptions.java new file mode 100644 index 000000000..442cebb3c --- /dev/null +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/ASDocOptions.java @@ -0,0 +1,8 @@ +package com.as3mxml.asconfigc.compiler; + +public class ASDocOptions { + public static final String INCLUDE = "include"; + public static final String DOC_SOURCES = "doc-sources"; + public static final String DOC_CLASSES = "doc-classes"; + public static final String DOC_NAMESPACES = "doc-namespaces"; +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/CompilerOptionsParser.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/CompilerOptionsParser.java index f498120f3..3fab6a2af 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/CompilerOptionsParser.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/CompilerOptionsParser.java @@ -512,6 +512,162 @@ public void parse(JsonNode options, Boolean debugBuild, List result) thr } } + public void parseForASDoc(JsonNode options, List result) + throws UnknownCompilerOptionException { + Iterator iterator = options.fieldNames(); + while (iterator.hasNext()) { + String key = iterator.next(); + switch (key) { + case CompilerOptions.DEFINE: { + setDefine(key, options.get(key), result); + break; + } + case CompilerOptions.EXTERNAL_LIBRARY_PATH: { + List values = JsonUtils.jsonNodeToListOfStrings(options.get(key)); + OptionsFormatter.appendPaths(key, values, result); + break; + } + case CompilerOptions.INCLUDE_LIBRARIES: { + List values = JsonUtils.jsonNodeToListOfStrings(options.get(key)); + OptionsFormatter.appendPaths(key, values, result); + break; + } + case CompilerOptions.LIBRARY_PATH: { + List values = JsonUtils.jsonNodeToListOfStrings(options.get(key)); + OptionsFormatter.appendPaths(key, values, result); + break; + } + case CompilerOptions.LOAD_CONFIG: { + List values = JsonUtils.jsonNodeToListOfStrings(options.get(key)); + OptionsFormatter.appendPaths(key, values, result); + break; + } + case CompilerOptions.STRICT: { + OptionsFormatter.setBoolean(key, options.get(key).asBoolean(), result); + break; + } + case CompilerOptions.SOURCE_PATH: { + List values = JsonUtils.jsonNodeToListOfStrings(options.get(key)); + OptionsFormatter.appendPaths(key, values, result); + break; + } + case CompilerOptions.ACCESSIBLE: + case CompilerOptions.ADVANCED_TELEMETRY: + case CompilerOptions.ALLOW_ABSTRACT_CLASSES: + case CompilerOptions.ALLOW_IMPORT_ALIASES: + case CompilerOptions.ALLOW_PRIVATE_CONSTRUCTORS: + case CompilerOptions.BENCHMARK: + case CompilerOptions.DEBUG: + case CompilerOptions.DEBUG_PASSWORD: + case CompilerOptions.DEFAULT_BACKGROUND_COLOR: + case CompilerOptions.DEFAULT_FRAME_RATE: + case CompilerOptions.DEFAULT_SIZE: + case CompilerOptions.DEFAULTS_CSS_FILES: + case CompilerOptions.JS_DEFINE: + case CompilerOptions.DIRECTORY: + case CompilerOptions.DUMP_CONFIG: + case CompilerOptions.EXCLUDE_DEFAULTS_CSS_FILES: + case CompilerOptions.EXPORT_PUBLIC_SYMBOLS: + case CompilerOptions.EXPORT_PROTECTED_SYMBOLS: + case CompilerOptions.EXPORT_INTERNAL_SYMBOLS: + case CompilerOptions.HTML_OUTPUT_FILENAME: + case CompilerOptions.HTML_TEMPLATE: + case CompilerOptions.INCLUDE_CLASSES: + case CompilerOptions.INCLUDE_FILE: + case CompilerOptions.INCLUDE_NAMESPACES: + case CompilerOptions.INCLUDE_SOURCES: + case CompilerOptions.INLINE_CONSTANTS: + case CompilerOptions.JS_COMPILER_OPTION: + case CompilerOptions.JS_COMPLEX_IMPLICIT_COERCIONS: + case CompilerOptions.JS_DEFAULT_INITIALIZERS: + case CompilerOptions.JS_DYNAMIC_ACCESS_UNKNOWN_MEMBERS: + case CompilerOptions.JS_EXTERNAL_LIBRARY_PATH: + case CompilerOptions.JS_LIBRARY_PATH: + case CompilerOptions.JS_OUTPUT: + case CompilerOptions.JS_OUTPUT_OPTIMIZATION: + case CompilerOptions.JS_OUTPUT_TYPE: + case CompilerOptions.JS_VECTOR_EMULATION_CLASS: + case CompilerOptions.JS_VECTOR_INDEX_CHECKS: + case CompilerOptions.KEEP_ALL_TYPE_SELECTORS: + case CompilerOptions.KEEP_AS3_METADATA: + case CompilerOptions.KEEP_GENERATED_ACTIONSCRIPT: + case CompilerOptions.LINK_REPORT: + case CompilerOptions.JS_LOAD_CONFIG: + case CompilerOptions.LOAD_EXTERNS: + case CompilerOptions.LOCALE: + case CompilerOptions.NAMESPACE: + case CompilerOptions.OPTIMIZE: + case CompilerOptions.OMIT_TRACE_STATEMENTS: + case CompilerOptions.OUTPUT: + case CompilerOptions.PRELOADER: + case CompilerOptions.PREVENT_RENAME_PUBLIC_SYMBOLS: + case CompilerOptions.PREVENT_RENAME_PUBLIC_STATIC_METHODS: + case CompilerOptions.PREVENT_RENAME_PUBLIC_INSTANCE_METHODS: + case CompilerOptions.PREVENT_RENAME_PUBLIC_STATIC_VARIABLES: + case CompilerOptions.PREVENT_RENAME_PUBLIC_INSTANCE_VARIABLES: + case CompilerOptions.PREVENT_RENAME_PUBLIC_STATIC_ACCESSORS: + case CompilerOptions.PREVENT_RENAME_PUBLIC_INSTANCE_ACCESSORS: + case CompilerOptions.PREVENT_RENAME_PROTECTED_SYMBOLS: + case CompilerOptions.PREVENT_RENAME_PROTECTED_STATIC_METHODS: + case CompilerOptions.PREVENT_RENAME_PROTECTED_INSTANCE_METHODS: + case CompilerOptions.PREVENT_RENAME_PROTECTED_STATIC_VARIABLES: + case CompilerOptions.PREVENT_RENAME_PROTECTED_INSTANCE_VARIABLES: + case CompilerOptions.PREVENT_RENAME_PROTECTED_STATIC_ACCESSORS: + case CompilerOptions.PREVENT_RENAME_PROTECTED_INSTANCE_ACCESSORS: + case CompilerOptions.PREVENT_RENAME_INTERNAL_SYMBOLS: + case CompilerOptions.PREVENT_RENAME_INTERNAL_STATIC_METHODS: + case CompilerOptions.PREVENT_RENAME_INTERNAL_INSTANCE_METHODS: + case CompilerOptions.PREVENT_RENAME_INTERNAL_STATIC_VARIABLES: + case CompilerOptions.PREVENT_RENAME_INTERNAL_INSTANCE_VARIABLES: + case CompilerOptions.PREVENT_RENAME_INTERNAL_STATIC_ACCESSORS: + case CompilerOptions.PREVENT_RENAME_INTERNAL_INSTANCE_ACCESSORS: + case CompilerOptions.REMOVE_CIRCULARS: + case CompilerOptions.SHOW_UNUSED_TYPE_SELECTOR_WARNINGS: + case CompilerOptions.SIZE_REPORT: + case CompilerOptions.SOURCE_MAP: + case CompilerOptions.SOURCE_MAP_SOURCE_ROOT: + case CompilerOptions.STATIC_LINK_RUNTIME_SHARED_LIBRARIES: + case CompilerOptions.STRICT_IDENTIFIER_NAMES: + case CompilerOptions.SWF_EXTERNAL_LIBRARY_PATH: + case CompilerOptions.SWF_LIBRARY_PATH: + case CompilerOptions.SWF_VERSION: + case CompilerOptions.TARGET_PLAYER: + case CompilerOptions.TARGETS: + case CompilerOptions.THEME: + case CompilerOptions.TOOLS_LOCALE: + case CompilerOptions.USE_DIRECT_BLIT: + case CompilerOptions.USE_GPU: + case CompilerOptions.USE_NETWORK: + case CompilerOptions.USE_RESOURCE_BUNDLE_METADATA: + case CompilerOptions.VERBOSE_STACKTRACES: + case CompilerOptions.WARNINGS: + case CompilerOptions.WARN_PUBLIC_VARS: + break; + default: { + throw new UnknownCompilerOptionException(key); + } + } + } + } + + public static void parseASDoc(JsonNode options, List result) { + if (options.has(ASDocOptions.DOC_SOURCES)) { + for (String source : JsonUtils.jsonNodeToListOfStrings(options.get(ASDocOptions.DOC_SOURCES))) { + result.add(0, "-doc-sources+=" + source); + } + } + if (options.has(ASDocOptions.DOC_CLASSES)) { + for (String source : JsonUtils.jsonNodeToListOfStrings(options.get(ASDocOptions.DOC_CLASSES))) { + result.add(0, "-doc-classes+=" + source); + } + } + if (options.has(ASDocOptions.DOC_NAMESPACES)) { + for (String source : JsonUtils.jsonNodeToListOfStrings(options.get(ASDocOptions.DOC_NAMESPACES))) { + result.add(0, "-doc-namespaces+=" + source); + } + } + } + private void appendNamespace(JsonNode values, List result) { int size = values.size(); if (size == 0) { @@ -578,4 +734,4 @@ private void parseIncludeFile(JsonNode files, List result) { result.add("--" + CompilerOptions.INCLUDE_FILE + "+=" + dest + "," + src); } } -} \ No newline at end of file +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/DefaultCompiler.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/DefaultCompiler.java index 7c26c0be1..52b8779d8 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/DefaultCompiler.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/DefaultCompiler.java @@ -17,9 +17,15 @@ import java.io.File; import java.io.IOException; +import java.net.URI; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; import com.as3mxml.asconfigc.ASConfigCException; import com.as3mxml.asconfigc.utils.ApacheRoyaleUtils; @@ -38,18 +44,15 @@ public DefaultCompiler(boolean verbose, List jvmargs) { private boolean verbose = false; private List jvmargs = null; - public void compile(String projectType, List compilerOptions, Path workspaceRoot, Path sdkPath) - throws ASConfigCException { - if (verbose) { - if (ProjectType.LIB.equals(projectType)) { - System.out.println("Compiling library..."); - } else // app - { - System.out.println("Compiling application..."); - } - } + private void fixOptions(List options, String projectType, boolean isASDoc, Path workspaceRoot, + Path sdkPath) throws ASConfigCException { boolean sdkIsRoyale = ApacheRoyaleUtils.isValidSDK(sdkPath) != null; - Path jarPath = ProjectUtils.findCompilerJarPath(projectType, sdkPath.toString(), !sdkIsRoyale); + Path jarPath = null; + if (!isASDoc) { + jarPath = ProjectUtils.findCompilerJarPath(projectType, sdkPath.toString(), !sdkIsRoyale); + } else { + jarPath = ProjectUtils.findAsdocJarPath(sdkPath.toString()); + } if (jarPath == null) { throw new ASConfigCException("Compiler not found in SDK. Expected in SDK: " + sdkPath); } @@ -57,31 +60,46 @@ public void compile(String projectType, List compilerOptions, Path works if (sdkIsRoyale) { // royale is a special case that has renamed many of the common // configuration options for the compiler - compilerOptions.add(0, "+royalelib=" + frameworkPath.toString()); - compilerOptions.add(0, jarPath.toString()); - compilerOptions.add(0, "-jar"); - compilerOptions.add(0, "-Droyalelib=" + frameworkPath.toString()); - compilerOptions.add(0, "-Droyalecompiler=" + sdkPath.toString()); + options.add(0, "+royalelib=" + frameworkPath.toString()); + options.add(0, jarPath.toString()); + options.add(0, "-jar"); + options.add(0, "-Droyalelib=" + frameworkPath.toString()); + options.add(0, "-Droyalecompiler=" + sdkPath.toString()); // Royale requires this so that it doesn't changing the encoding of // UTF-8 characters and display ???? instead - compilerOptions.add(0, "-Dfile.encoding=UTF8"); + options.add(0, "-Dfile.encoding=UTF8"); } else { // other SDKs all use the same options - compilerOptions.add(0, "+flexlib=" + frameworkPath.toString()); - compilerOptions.add(0, jarPath.toString()); - compilerOptions.add(0, "-jar"); - compilerOptions.add(0, "-Dflexlib=" + frameworkPath.toString()); - compilerOptions.add(0, "-Dflexcompiler=" + sdkPath.toString()); + options.add(0, "+flexlib=" + frameworkPath.toString()); + options.add(0, jarPath.toString()); + options.add(0, "-jar"); + options.add(0, "-Dflexlib=" + frameworkPath.toString()); + options.add(0, "-Dflexcompiler=" + sdkPath.toString()); + options.add(0, "-Dflex.compiler.theme="); } if (jvmargs != null) { - compilerOptions.addAll(0, jvmargs); + options.addAll(0, jvmargs); } boolean isMacOS = System.getProperty("os.name").toLowerCase().startsWith("mac os"); if (isMacOS) { - compilerOptions.add(0, "-Dapple.awt.UIElement=true"); + options.add(0, "-Dapple.awt.UIElement=true"); } Path javaExecutablePath = Paths.get(System.getProperty("java.home"), "bin", "java"); - compilerOptions.add(0, javaExecutablePath.toString()); + options.add(0, javaExecutablePath.toString()); + } + + public void compile(String projectType, List compilerOptions, Path workspaceRoot, Path sdkPath) + throws ASConfigCException { + if (verbose) { + if (ProjectType.LIB.equals(projectType)) { + System.out.println("Compiling library..."); + } else // app + { + System.out.println("Compiling application..."); + } + } + + fixOptions(compilerOptions, projectType, false, workspaceRoot, sdkPath); if (verbose) { System.out.println(String.join(" ", compilerOptions)); @@ -99,4 +117,52 @@ public void compile(String projectType, List compilerOptions, Path works throw new ASConfigCException("Failed to execute compiler: " + e.getMessage()); } } -} \ No newline at end of file + + public void buildASDoc(String projectType, String swcToOutputTo, List asdocOptions, Path workspaceRoot, + Path sdkPath) + throws ASConfigCException { + System.out.println("Building ASDoc for inclusion..."); + + asdocOptions.add(0, "-lenient=true"); + asdocOptions.add(0, "-keep-xml=true"); + asdocOptions.add(0, "-skip-xsl=true"); + asdocOptions.add(0, "-compiler.fonts.local-fonts-snapshot="); + + String outputPath = swcToOutputTo + "TempDoc"; + + asdocOptions.add(0, outputPath); + asdocOptions.add(0, "--output"); + + fixOptions(asdocOptions, projectType, true, workspaceRoot, sdkPath); + + if (verbose) { + System.out.println(String.join(" ", asdocOptions)); + } + try { + File cwd = new File(System.getProperty("user.dir")); + Process process = new ProcessBuilder().command(asdocOptions).directory(cwd).inheritIO().start(); + int status = process.waitFor(); + if (status != 0) { + throw new ASConfigCException(status); + } + + try (FileSystem zipfs = FileSystems + .newFileSystem(URI.create("jar:" + Paths.get(swcToOutputTo).toUri().toString()), new HashMap<>())) { + Path zipPath = zipfs.getPath("docs"); + Files.createDirectory(zipPath); + for (Path xmlPath : Files.list(Paths.get(outputPath, "tempdita")).collect(Collectors.toList())) { + if (!xmlPath.getFileName().toString().equals("ASDoc_Config.xml") + && !xmlPath.getFileName().toString().equals("overviews.xml")) { + Path newXMLPath = zipPath.resolve(xmlPath.getFileName().toString()); + + Files.copy(xmlPath, newXMLPath); + } + } + } + } catch (InterruptedException e) { + throw new ASConfigCException("Failed to execute compiler: " + e.getMessage()); + } catch (IOException e) { + throw new ASConfigCException("Failed to execute compiler: " + e.getMessage()); + } + } +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/IASConfigCCompiler.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/IASConfigCCompiler.java index 5117e0de4..cd23a8a3a 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/IASConfigCCompiler.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/compiler/IASConfigCCompiler.java @@ -26,4 +26,8 @@ public interface IASConfigCCompiler { public void compile(String projectType, List compilerOptions, Path workspaceRoot, Path sdkPath) throws ASConfigCException; -} \ No newline at end of file + + public void buildASDoc(String projectType, String swcToIncludeIn, List asdocOptions, Path workspaceRoot, + Path sdkPath) + throws ASConfigCException; +} diff --git a/asconfigc/src/main/java/com/as3mxml/asconfigc/utils/ProjectUtils.java b/asconfigc/src/main/java/com/as3mxml/asconfigc/utils/ProjectUtils.java index 69cf07efc..12a100fbc 100644 --- a/asconfigc/src/main/java/com/as3mxml/asconfigc/utils/ProjectUtils.java +++ b/asconfigc/src/main/java/com/as3mxml/asconfigc/utils/ProjectUtils.java @@ -241,6 +241,22 @@ public static Path findCompilerJarPath(String projectType, String sdkPath, boole return jarPath; } + public static Path findAsdocJarPath(String sdkPath) { + Path jarPath = Paths.get(sdkPath, "lib", "asdoc.jar"); + + if (Files.exists(jarPath)) { + return jarPath; + } + + jarPath = Paths.get(sdkPath, "lib", "legacy", "asdoc.jar"); + + if (Files.exists(jarPath)) { + return jarPath; + } + + return null; + } + public static Path findAdobeAIRPackagerJarPath(String sdkPath) { Path jarPath = Paths.get(sdkPath, "lib", JAR_NAME_ADT); if (Files.exists(jarPath)) { @@ -401,4 +417,4 @@ public static String findAIRDescriptorNamespace(String airDescriptorContents) { } return airDescriptorContents.substring(startIndex, endIndex); } -} \ No newline at end of file +} diff --git a/distribution/src/assembly/schemas/asconfig.schema.json b/distribution/src/assembly/schemas/asconfig.schema.json index 3fe096315..1bb70fa1a 100644 --- a/distribution/src/assembly/schemas/asconfig.schema.json +++ b/distribution/src/assembly/schemas/asconfig.schema.json @@ -37,7 +37,8 @@ "type": "string", "description": "Indicates if the project is an application or library. Supported values include \"app\" and \"lib\". Then default value is \"app\".", "pattern": "^lib$" - } + }, + "asdocOptions": { "$ref": "#/definitions/asdocOptions" } }, "required": ["type"] } @@ -1024,6 +1025,52 @@ "mainClass": { "type": "string", "description": "The fully qualified class name (including the package name, if any) of the main class to use as the application entry point." + }, + "asdocOptions": { + "type": "object", + "description": "Instructs the ActionScript and MXML compiler how to build the ASDoc.", + "anyOf": [ + { + "required": ["doc-sources"] + }, + { + "required": ["doc-classes"] + }, + { + "required": ["doc-namespaces"] + } + ], + "properties": { + "include": { + "type": "boolean", + "description": "Whether to include the ASDoc in the generated SWC", + "default": false + }, + "doc-sources": { + "type": "array", + "description": "Source directories to compile ASDoc from. Defaults to empty", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "doc-classes": { + "type": "array", + "description": "Classes to include in the documentation. Defaults to empty", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "doc-namespaces": { + "type": "array", + "description": "Namespaces to include in the documentation. Defaults to empty", + "items": { + "type": "string" + }, + "minItems": 1 + } + } } } } diff --git a/language-server/src/main/java/com/as3mxml/vscode/compiler/CompilerShell.java b/language-server/src/main/java/com/as3mxml/vscode/compiler/CompilerShell.java index 34f50018a..72114a7c5 100644 --- a/language-server/src/main/java/com/as3mxml/vscode/compiler/CompilerShell.java +++ b/language-server/src/main/java/com/as3mxml/vscode/compiler/CompilerShell.java @@ -129,6 +129,11 @@ public void compile(String projectType, List compilerOptions, Path works } } + public void buildASDoc(String projectType, String swcToOutputTo, List compilerOptions, Path workspaceRoot, + Path sdkPath) { + + } + public void dispose() { if (process == null) { return;