You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/10/06 13:49:15 UTC
[3/8] git commit: [flex-utilities]
[refs/heads/feature/flash-downloader] - npm-flexjs: NPM scripts in js/bin now
call the real scripts so that changes don't need to be reflected. NPM scripts
in js/bin are now Node scripts so that they work better cross-p
npm-flexjs: NPM scripts in js/bin now call the real scripts so that changes don't need to be reflected.
NPM scripts in js/bin are now Node scripts so that they work better cross-platform, such as Windows without Cygwin.
Added missing asnodec, compc, and externc scripts in js/bin.
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/6d79d5b0
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/6d79d5b0
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/6d79d5b0
Branch: refs/heads/feature/flash-downloader
Commit: 6d79d5b00ad79939337be6cabb0137710893028f
Parents: 5cba209
Author: Josh Tynjala <jo...@apache.org>
Authored: Mon Sep 12 13:20:42 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Mon Sep 12 13:20:42 2016 -0700
----------------------------------------------------------------------
npm-flexjs/js/bin/asjscnpm | 119 ++++++++++++++-------------------
npm-flexjs/js/bin/asjscompcnpm | 119 ++++++++++++++-------------------
npm-flexjs/js/bin/asnodecnpm | 49 ++++++++++++++
npm-flexjs/js/bin/compcnpm | 49 ++++++++++++++
npm-flexjs/js/bin/externcnpm | 49 ++++++++++++++
npm-flexjs/js/bin/mxmlcnpm | 129 ++++++++++++++----------------------
npm-flexjs/package.json | 5 +-
7 files changed, 298 insertions(+), 221 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/asjscnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscnpm b/npm-flexjs/js/bin/asjscnpm
index 8a5f4cf..8c9e9f8 100755
--- a/npm-flexjs/js/bin/asjscnpm
+++ b/npm-flexjs/js/bin/asjscnpm
@@ -1,70 +1,49 @@
-#!/bin/sh
-
-################################################################################
-##
-## 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.
-##
-################################################################################
-
-
-#
-# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
-# In Windows Command Prompt, use mxmlc.bat instead.
-#
-
-SCRIPT_HOME="$0"
-# try to find the real script if $0 is a symlink
-pushd . > /dev/null
-if [ -h "$SCRIPT_HOME" ]; then
- cd "`dirname "$SCRIPT_HOME"`"
- SCRIPT_HOME="`readlink "\`basename $SCRIPT_HOME\`"`"
-fi
-cd "`dirname "${SCRIPT_HOME}"`"
-SCRIPT_HOME="`pwd`"
-popd > /dev/null
-FALCON_HOME=${SCRIPT_HOME}/../..
-FLEX_HOME=${SCRIPT_HOME}/../..
-
-case `uname` in
- CYGWIN*)
- OS="Windows"
- ;;
- *)
- OS=Unix
-esac
-
-D32=''
-
-if [ $OS = "Windows" ]; then
-
- SCRIPT_HOME=`cygpath -m $SCRIPT_HOME`
- FALCON_HOME=`cygpath -m $FALCON_HOME`
- FLEX_HOME=`cygpath -m $FLEX_HOME`
-
-elif [ $OS = "Unix" ]; then
-
- check64="`java -version 2>&1 | grep -i 64-Bit`"
- isOSX="`uname | grep -i Darwin`"
- javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
-
- if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
- D32='-d32'
- fi
-fi
-
-VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
-
-java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" -js-output-type=jsc -external-library-path="$SCRIPT_HOME/../libs/js.swc" "$@"
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "asjsc";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/asjscompcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asjscompcnpm b/npm-flexjs/js/bin/asjscompcnpm
index 12177d2..0cc2402 100755
--- a/npm-flexjs/js/bin/asjscompcnpm
+++ b/npm-flexjs/js/bin/asjscompcnpm
@@ -1,70 +1,49 @@
-#!/bin/sh
-
-################################################################################
-##
-## 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.
-##
-################################################################################
-
-
-#
-# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
-# In Windows Command Prompt, use mxmlc.bat instead.
-#
-
-SCRIPT_HOME="$0"
-# try to find the real script if $0 is a symlink
-pushd . > /dev/null
-if [ -h "$SCRIPT_HOME" ]; then
- cd "`dirname "$SCRIPT_HOME"`"
- SCRIPT_HOME="`readlink "\`basename $SCRIPT_HOME\`"`"
-fi
-cd "`dirname "${SCRIPT_HOME}"`"
-SCRIPT_HOME="`pwd`"
-popd > /dev/null
-FALCON_HOME=${SCRIPT_HOME}/../..
-FLEX_HOME=${SCRIPT_HOME}/../..
-
-case `uname` in
- CYGWIN*)
- OS="Windows"
- ;;
- *)
- OS=Unix
-esac
-
-D32=''
-
-if [ $OS = "Windows" ]; then
-
- SCRIPT_HOME=`cygpath -m $SCRIPT_HOME`
- FALCON_HOME=`cygpath -m $FALCON_HOME`
- FLEX_HOME=`cygpath -m $FLEX_HOME`
-
-elif [ $OS = "Unix" ]; then
-
- check64="`java -version 2>&1 | grep -i 64-Bit`"
- isOSX="`uname | grep -i Darwin`"
- javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
-
- if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
- D32='-d32'
- fi
-fi
-
-VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
-
-java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/compc.jar" +flexlib="$FLEX_HOME/frameworks" -js-output-type=jsc -external-library-path="$SCRIPT_HOME/../libs/js.swc" "$@"
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "asjscompc";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/asnodecnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/asnodecnpm b/npm-flexjs/js/bin/asnodecnpm
new file mode 100644
index 0000000..8654736
--- /dev/null
+++ b/npm-flexjs/js/bin/asnodecnpm
@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "asnodec";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/compcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/compcnpm b/npm-flexjs/js/bin/compcnpm
new file mode 100755
index 0000000..e9e22af
--- /dev/null
+++ b/npm-flexjs/js/bin/compcnpm
@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "compc";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/externcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/externcnpm b/npm-flexjs/js/bin/externcnpm
new file mode 100755
index 0000000..a6c5c3a
--- /dev/null
+++ b/npm-flexjs/js/bin/externcnpm
@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "externc";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/js/bin/mxmlcnpm
----------------------------------------------------------------------
diff --git a/npm-flexjs/js/bin/mxmlcnpm b/npm-flexjs/js/bin/mxmlcnpm
index 0f29d98..5a6c710 100755
--- a/npm-flexjs/js/bin/mxmlcnpm
+++ b/npm-flexjs/js/bin/mxmlcnpm
@@ -1,80 +1,49 @@
-#!/bin/sh
-
-################################################################################
-##
-## 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.
-##
-################################################################################
-
-
-#
-# mxmlc shell script to launch falcon-mxmlc.jar on OSX, Unix, or Cygwin.
-# In Windows Command Prompt, use mxmlc.bat instead.
-#
-
-SCRIPT_HOME="$0"
-# try to find the real script if $0 is a symlink
-pushd . > /dev/null
-if [ -h "$SCRIPT_HOME" ]; then
- cd "`dirname "$SCRIPT_HOME"`"
- SCRIPT_HOME="`readlink "\`basename $SCRIPT_HOME\`"`"
-fi
-cd "`dirname "${SCRIPT_HOME}"`"
-SCRIPT_HOME="`pwd`"
-popd > /dev/null
-if [ "x${FALCON_HOME}" = "x" ]
-then
- FALCON_HOME=${SCRIPT_HOME}/../..
-fi
-
-echo Using Falcon codebase: $FALCON_HOME
-
-if [ "x${FLEX_HOME}" = "x" ]
-then
- FLEX_HOME=${SCRIPT_HOME}/../..
-fi
-echo Using Flex SDK: $FLEX_HOME
-
-case `uname` in
- CYGWIN*)
- OS="Windows"
- ;;
- *)
- OS=Unix
-esac
-
-D32=''
-
-if [ $OS = "Windows" ]; then
-
- SCRIPT_HOME=`cygpath -m $SCRIPT_HOME`
- FALCON_HOME=`cygpath -m $FALCON_HOME`
- FLEX_HOME=`cygpath -m $FLEX_HOME`
-
-elif [ $OS = "Unix" ]; then
-
- check64="`java -version 2>&1 | grep -i 64-Bit`"
- isOSX="`uname | grep -i Darwin`"
- javaVersion="`java -version 2>&1 | awk -F '[ ".]+' 'NR==1 {print $3 "." $4}'`"
-
- if [ "$isOSX" != "" -a "$HOSTTYPE" = "x86_64" -a "$check64" != "" -a "$javaVersion" = "1.6" ]; then
- D32='-d32'
- fi
-fi
-
-VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false "
-
-java $VMARGS $D32 $SETUP_SH_VMARGS -Dflexcompiler="$FALCON_HOME" -Dflexlib="$FLEX_HOME/frameworks" -jar "$SCRIPT_HOME/../lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" -js-output-type=FLEXJS -sdk-js-lib="$FLEX_HOME/frameworks/js/FlexJS/src" "$@"
+#!/usr/bin/env node
+
+/*
+ *
+ * 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.
+ *
+ */
+
+var child_process = require("child_process");
+var path = require("path");
+
+var scriptName = "mxmlc";
+if(process.platform === "win32")
+{
+ scriptName += ".bat";
+}
+
+var scriptPath = path.join(__dirname, scriptName);
+try
+{
+ child_process.execFileSync(scriptPath, process.argv.slice(2),
+ {
+ stdio: "inherit",
+ encoding: "utf8"
+ });
+}
+catch(error)
+{
+ if(error.status === null)
+ {
+ console.error("Error executing " + scriptName + " with code: " + error.code);
+ process.exit(1);
+ }
+ process.exit(error.status);
+}
+process.exit(0);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/6d79d5b0/npm-flexjs/package.json
----------------------------------------------------------------------
diff --git a/npm-flexjs/package.json b/npm-flexjs/package.json
index 85d7677..32631b5 100644
--- a/npm-flexjs/package.json
+++ b/npm-flexjs/package.json
@@ -32,7 +32,10 @@
"bin": {
"asjsc": "./js/bin/asjscnpm",
"asjscompc": "./js/bin/asjscompcnpm",
- "mxmlc": "./js/bin/mxmlcnpm"
+ "asnodec": "./js/bin/asnodecnpm",
+ "mxmlc": "./js/bin/mxmlcnpm",
+ "compc": "./js/bin/compcnpm",
+ "externc": "./js/bin/externcnpm"
},
"org_apache_flex": {
"flexjs_path_binary": "flex/flexjs/0.7.0/binaries/",