Repository: flex-falcon Updated Branches: refs/heads/feature/maven-migration 508897783 -> dec07727a
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dec07727/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileMojo.java ---------------------------------------------------------------------- diff --git a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileMojo.java b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileMojo.java new file mode 100644 index 0000000..0846ecd --- /dev/null +++ b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/CompileMojo.java @@ -0,0 +1,59 @@ +package org.apache.flex.maven.flexjs; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.flex.tools.FlexTool; +import org.apache.flex.tools.FlexToolGroup; +import org.apache.flex.tools.FlexToolRegistry; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +import java.io.File; + +/** + * goal which compiles a project into a flexjs swc library. + */ +@Mojo(name="compile",defaultPhase = LifecyclePhase.PROCESS_SOURCES) +public class CompileMojo + extends AbstractMojo +{ + + @Parameter(defaultValue="${basedir}/src/main/config/compile-config.xml") + private File configFile; + + @Parameter(defaultValue="${project.build.directory}") + private File outputDirectory; + + @Parameter(defaultValue = "${project.artifactId}-${project.version}.swc") + private String outputFileName; + + public void execute() + throws MojoExecutionException + { + FlexToolRegistry toolRegistry = new FlexToolRegistry(); + FlexToolGroup toolGroup = toolRegistry.getToolGroup("Falcon"); + FlexTool compc = toolGroup.getFlexTool(FlexTool.FLEX_TOOL_COMPC); + File outputFile = new File(outputDirectory, outputFileName); + String[] args = {"+flexlib=externs", "-debug", "-load-config=" + configFile.getPath(), + "-output=" + outputFile.getPath()}; + compc.execute(args); + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dec07727/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/ExterncMojo.java ---------------------------------------------------------------------- diff --git a/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/ExterncMojo.java b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/ExterncMojo.java new file mode 100644 index 0000000..555fde6 --- /dev/null +++ b/flexjs-maven-plugin/src/main/java/org/apache/flex/maven/flexjs/ExterncMojo.java @@ -0,0 +1,52 @@ +package org.apache.flex.maven.flexjs; + +/* + * Copyright 2001-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.flex.tools.FlexTool; +import org.apache.flex.tools.FlexToolGroup; +import org.apache.flex.tools.FlexToolRegistry; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; + +import java.io.File; + +/** + * goal which generates actionscript code from javascript. + */ +@Mojo(name="generate",defaultPhase = LifecyclePhase.PROCESS_SOURCES) +public class ExterncMojo + extends AbstractMojo +{ + + @Parameter(defaultValue="${basedir}/src/main/config/generate-config.xml") + private File configFile; + + public void execute() + throws MojoExecutionException + { + FlexToolRegistry toolRegistry = new FlexToolRegistry(); + FlexToolGroup toolGroup = toolRegistry.getToolGroup("FlexJS"); + // TODO: Change this to a flex-tool-api constant ... + FlexTool compc = toolGroup.getFlexTool("EXTERNC"); + String[] args = {"+flexlib=externs", "-debug", "-load-config=" + configFile.getPath()}; + compc.execute(args); + } + +} http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dec07727/maven/falcon-jx-compiler.pom ---------------------------------------------------------------------- diff --git a/maven/falcon-jx-compiler.pom b/maven/falcon-jx-compiler.pom index 752dbd9..2703356 100644 --- a/maven/falcon-jx-compiler.pom +++ b/maven/falcon-jx-compiler.pom @@ -52,7 +52,7 @@ <dependency> <groupId>com.google.javascript</groupId> <artifactId>closure-compiler</artifactId> - <version>v20150609</version> + <version>v20151015</version> </dependency> <dependency> <groupId>org.clojure</groupId> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dec07727/migrate-to-maven.sh ---------------------------------------------------------------------- diff --git a/migrate-to-maven.sh b/migrate-to-maven.sh index ebe4fad..3eb42e3 100755 --- a/migrate-to-maven.sh +++ b/migrate-to-maven.sh @@ -98,3 +98,43 @@ git rm -r compiler.jx.tests/src/org compiler.jx/src/test/java/org/apache/flex/ut mkdir -p compiler.jx/src/test/resources git mv compiler.jx.tests/test-files/* compiler.jx/src/test/resources +############################################# +## Convert the externs +############################################# + +# asdocs + +# cordova +mkdir -p externs/cordova/src/main/javascript +git mv externs/cordova/externs/* externs/cordova/src/main/javascript +rm -r externs/cordova/externs + +#createjs +mkdir -p externs/createjs/src/main/javascript +git mv externs/createjs/missing.js externs/createjs/src/main/javascript + +# GCL +mkdir -p externs/GCL/src/main/flex +git mv externs/GCL/src/goog externs/GCL/src/main/flex/goog +git rm -r externs/GCL/externs +rm -r externs/GCL/out + +# google_maps + +# jasmine + +# jquery + +# js +mkdir -p externs/js/src/main/flex/__AS3__/vec +git mv externs/js/src/AS3.as externs/js/src/main/flex/AS3.as +git mv externs/js/src/Vector.as externs/js/src/main/flex/__AS3__/vec/Vector.as +git rm externs/js/src/Vector-template.as +mkdir -p externs/js/src/main/javascript +git mv externs/js/missing.js externs/js/src/main/javascript + +# node +mkdir -p externs/node/src/main/javascript +git mv externs/node/externs/* externs/node/src/main/javascript +rm -r externs/node/externs + http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/dec07727/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 3c0df3b..2c4d4e8 100644 --- a/pom.xml +++ b/pom.xml @@ -58,6 +58,7 @@ <module>compiler</module> <module>compiler.jx</module> <module>flex-compiler-oem</module> + <module>externs</module> </modules> </profile> @@ -66,6 +67,7 @@ <modules> <module>compiler-build-tools</module> <module>compiler-jburg-types</module> + <module>flexjs-maven-plugin</module> </modules> </profile> </profiles>
