You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/01/31 19:26:10 UTC
svn commit: r1441104 - in
/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler:
clients/JSConfiguration.java internal/js/driver/goog/GoogBackend.java
internal/js/driver/goog/JSGoogConfiguration.java
Author: erikdebruin
Date: Thu Jan 31 18:26:10 2013
New Revision: 1441104
URL: http://svn.apache.org/viewvc?rev=1441104&view=rev
Log:
- added command line configuration options for JS and JSGoog handling, in preparation of the implementation of the Closure Compiler for 'goog' JS output
Added:
flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java (with props)
Modified:
flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/clients/JSConfiguration.java
flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java
Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/clients/JSConfiguration.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/clients/JSConfiguration.java?rev=1441104&r1=1441103&r2=1441104&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/clients/JSConfiguration.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/clients/JSConfiguration.java Thu Jan 31 18:26:10 2013
@@ -21,16 +21,16 @@ package org.apache.flex.compiler.clients
import org.apache.flex.compiler.config.Configuration;
import org.apache.flex.compiler.config.ConfigurationValue;
-import org.apache.flex.compiler.exceptions.ConfigurationException.BadValue;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
import org.apache.flex.compiler.internal.config.annotations.Config;
import org.apache.flex.compiler.internal.config.annotations.Mapping;
/**
- * The {@link JSConfiguration} class holds all compiler arguments needed
- * for compiling ActionScript to JavaScript.
+ * The {@link JSConfiguration} class holds all compiler arguments needed for
+ * compiling ActionScript to JavaScript.
* <p>
- * Specific flags are implemented here for the configuration to be loaded by
- * the configure() method of {@link MXMLJSC}.
+ * Specific flags are implemented here for the configuration to be loaded by the
+ * configure() method of {@link MXMLJSC}.
* <p>
* This class inherits all compiler arguments from the MXMLC compiler.
*
@@ -41,23 +41,24 @@ public class JSConfiguration extends Con
public JSConfiguration()
{
}
-
+
//
- // 'mxmljsc.foo-bar' option
+ // 'js-output-type'
//
- private String fooBar;
+ private String jsOutputType;
- public String getFooBar()
+ public String getJSOutputType()
{
- return fooBar;
+ return jsOutputType;
}
- @Config(allowMultiple = false)
- @Mapping({ "mxmljsc", "foo-bar" })
- public void setFooBar(ConfigurationValue cv, String value)
- throws BadValue
+ @Config
+ @Mapping("js-output-type")
+ public void setJSOutputType(ConfigurationValue cv, String value)
+ throws ConfigurationException
{
- fooBar = value;
+ jsOutputType = value;
}
+
}
Modified: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java?rev=1441104&r1=1441103&r2=1441104&view=diff
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java (original)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/GoogBackend.java Thu Jan 31 18:26:10 2013
@@ -24,6 +24,7 @@ import java.io.FilterWriter;
import org.apache.flex.compiler.as.codegen.IASEmitter;
import org.apache.flex.compiler.as.codegen.IDocEmitter;
import org.apache.flex.compiler.clients.IBackend;
+import org.apache.flex.compiler.config.Configurator;
import org.apache.flex.compiler.internal.js.codegen.goog.JSGoogDocEmitter;
import org.apache.flex.compiler.internal.js.codegen.goog.JSGoogEmitter;
import org.apache.flex.compiler.internal.js.driver.JSBackend;
@@ -37,6 +38,13 @@ import org.apache.flex.compiler.js.codeg
*/
public class GoogBackend extends JSBackend
{
+
+ @Override
+ public Configurator createConfigurator()
+ {
+ return new Configurator(JSGoogConfiguration.class);
+ }
+
@Override
public IDocEmitter createDocEmitter(IASEmitter emitter)
{
Added: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java?rev=1441104&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java (added)
+++ flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java Thu Jan 31 18:26:10 2013
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ *
+ */
+
+package org.apache.flex.compiler.internal.js.driver.goog;
+
+import org.apache.flex.compiler.clients.JSConfiguration;
+import org.apache.flex.compiler.clients.MXMLJSC;
+import org.apache.flex.compiler.config.ConfigurationValue;
+import org.apache.flex.compiler.exceptions.ConfigurationException;
+import org.apache.flex.compiler.internal.config.annotations.Config;
+import org.apache.flex.compiler.internal.config.annotations.Mapping;
+
+/**
+ * The {@link JSGoogConfiguration} class holds all compiler arguments needed for
+ * compiling ActionScript to JavaScript the 'goog' way.
+ * <p>
+ * Specific flags are implemented here for the configuration to be loaded by the
+ * configure() method of {@link MXMLJSC}.
+ * <p>
+ * This class inherits all compiler arguments from the MXMLC compiler.
+ *
+ * @author Erik de Bruin
+ */
+public class JSGoogConfiguration extends JSConfiguration
+{
+ public JSGoogConfiguration()
+ {
+ }
+
+ //
+ // 'closure-lib'
+ //
+
+ private String closureLib;
+
+ public String getClosureLib()
+ {
+ return closureLib;
+ }
+
+ @Config
+ @Mapping("closure-lib")
+ public void setClosureLib(ConfigurationValue cv, String value)
+ throws ConfigurationException
+ {
+ closureLib = value;
+ }
+
+ //
+ // 'vanilla-sdk-lib'
+ //
+
+ private String vanillaSDKLib;
+
+ public String getVanillaSDKLib()
+ {
+ return vanillaSDKLib;
+ }
+
+ @Config
+ @Mapping("vanilla-sdk-lib")
+ public void setVanillaSDKLib(ConfigurationValue cv, String value)
+ throws ConfigurationException
+ {
+ vanillaSDKLib = value;
+ }
+
+}
Propchange: flex/falcon/trunk/compiler.jx/src/org/apache/flex/compiler/internal/js/driver/goog/JSGoogConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native