Repository: flex-falcon Updated Branches: refs/heads/develop 920b1d25a -> b0b010f72
- Made sure either playerglobal or airglobal are included, but not both - Added references to externs in CreateJSExample and FlexJSStore_jquery - Made sure variables are used for the playerglobal and airglobal libraries - Excluded "CustomEvent" from the js extern - Made it possible to add extern references in swf type projects (but only if added directly and not by parent or transitively) Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/b0b010f7 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/b0b010f7 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/b0b010f7 Branch: refs/heads/develop Commit: b0b010f726299e2e1633af70456ab83279d887f1 Parents: 920b1d2 Author: Christofer Dutz <[email protected]> Authored: Sat Jul 2 16:33:26 2016 +0200 Committer: Christofer Dutz <[email protected]> Committed: Sat Jul 2 16:33:26 2016 +0200 ---------------------------------------------------------------------- externs/js/pom.xml | 3 ++ .../org/apache/flex/maven/flexjs/BaseMojo.java | 38 +++++++++++++++++--- .../flex/maven/flexjs/CompileAppMojo.java | 4 ++- 3 files changed, 40 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b0b010f7/externs/js/pom.xml ---------------------------------------------------------------------- diff --git a/externs/js/pom.xml b/externs/js/pom.xml index 77343fa..d122ea3 100644 --- a/externs/js/pom.xml +++ b/externs/js/pom.xml @@ -160,6 +160,9 @@ <class-exclude> <className>controlRange</className> </class-exclude> + <class-exclude> + <className>CustomEvent</className> + </class-exclude> </class-excludes> <field-excludes> <field-exclude> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b0b010f7/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/BaseMojo.java ---------------------------------------------------------------------- diff --git a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/BaseMojo.java b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/BaseMojo.java index ba5a607..f032d99 100644 --- a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/BaseMojo.java +++ b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/BaseMojo.java @@ -62,11 +62,11 @@ public abstract class BaseMojo @Parameter private Define[] defines; - @Parameter - private String targetPlayer = "11.1"; + @Parameter(defaultValue = "11.1") + private String targetPlayer; - @Parameter - private boolean includeSources = false; + @Parameter(defaultValue = "false") + private boolean includeSources; @Parameter protected boolean debug = false; @@ -158,6 +158,36 @@ public abstract class BaseMojo return null; } + /*@SuppressWarnings("unchecked") + protected List<IncludeFile> getIncludedFiles() { + List<IncludeFile> includedFiles = new LinkedList<IncludeFile>(); + + // Add all manually added files. + if(includeFiles != null) { + includedFiles.addAll(Arrays.asList(includeFiles)); + } + + // Add all files in the resources directory. + if(project.getResources() != null) { + for(Resource resource : (List<Resource>) project.getResources()) { + File resourceDirectory = new File(resource.getDirectory()); + if(resourceDirectory.exists()) { + Collection<File> files = FileUtils.listFiles(resourceDirectory, + new RegexFileFilter("^(.*?)"), DirectoryFileFilter.DIRECTORY); + for(File file : files) { + IncludeFile includeFile = new IncludeFile(); + String relativePath = file.getPath().substring(resourceDirectory.getPath().length()); + includeFile.setName(relativePath); + includeFile.setPath(file.getPath()); + includedFiles.add(includeFile); + } + } + } + } + + return includedFiles; + }*/ + protected List<String> getCompilerArgs(File configFile) throws MojoExecutionException { List<String> args = new LinkedList<String>(); args.add("-load-config=" + configFile.getPath()); http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b0b010f7/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileAppMojo.java ---------------------------------------------------------------------- diff --git a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileAppMojo.java b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileAppMojo.java index 65d7a74..70f392f 100644 --- a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileAppMojo.java +++ b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileAppMojo.java @@ -196,7 +196,9 @@ public class CompileAppMojo @Override protected boolean includeLibrary(Artifact library) { - return !"extern".equalsIgnoreCase(library.getClassifier()); + // Strip out all externs except if the dependency was declared inside the pom itself. + return !"extern".equalsIgnoreCase(library.getClassifier()) || + (outputJavaScript && library.getDependencyTrail().size() == 2); } private void zipDirectory(File source, File target) {
