You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by er...@apache.org on 2017/11/16 10:39:51 UTC
[royale-asjs] branch feature/wast updated (cab80bf -> 1047779)
This is an automated email from the ASF dual-hosted git repository.
erikdebruin pushed a change to branch feature/wast
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.
from cab80bf Merge branch 'develop' into wast
new b6df1ba Move environment checks to create.js; make http-server install conditional in install.js
add 5a96d04 Remove unneccassery null check and use "dataField" for assign data to href (closes #67)
new 1047779 Merge branch 'develop' into wast
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../mdl/itemRenderers/FooterLinkItemRenderer.as | 36 +++++++++------
wast/create.js | 44 +++++++++++++++++-
wast/resources/build.js | 50 ++------------------
.../HelloWorldIT.java => wast/resources/install.js | 54 ++++++++++++++--------
4 files changed, 103 insertions(+), 81 deletions(-)
copy examples/examples-integrationtests/src/test/java/org/apache/royale/examples/helloworld/HelloWorldIT.java => wast/resources/install.js (53%)
--
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <co...@royale.apache.org>'].
[royale-asjs] 01/02: Move environment checks to create.js;
make http-server install conditional in install.js
Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
erikdebruin pushed a commit to branch feature/wast
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit b6df1ba58c6b8a5df74556d6319286f1a6d9d474
Author: Erik de Bruin <er...@ixsoftware.nl>
AuthorDate: Thu Nov 16 11:39:20 2017 +0100
Move environment checks to create.js; make http-server install conditional in install.js
Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>
---
wast/create.js | 44 +++++++++++++++++++++++++++++++--
wast/resources/build.js | 50 +++-----------------------------------
wast/resources/install.js | 62 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 108 insertions(+), 48 deletions(-)
diff --git a/wast/create.js b/wast/create.js
index 1d5b23c..c5708ec 100644
--- a/wast/create.js
+++ b/wast/create.js
@@ -19,7 +19,8 @@
'use strict';
-let args, createFile, dir, fs, projectName, projectPath, projectSrcPath, royaleHome;
+let args, createFile, dir, fs, playerHome, playerVersion, projectName,
+ projectPath, projectSrcPath, royaleHome, wastcJar;
@@ -61,6 +62,41 @@ royaleHome.pop(); // remove 'create.js'
royaleHome.pop(); // remove 'wast'
royaleHome = royaleHome.join('/');
+wastcJar = royaleHome + '/wast/lib/wastc.jar';
+if (!fs.existsSync(wastcJar)) {
+ console.log('Transpiler \'wastc\' not found. This sdk appears not to be an sdk that is compatible with this project.');
+
+ process.exit();
+}
+
+playerHome = args['playerglobal-home'];
+if (!playerHome || '' === playerHome) {
+ playerHome = process.env.PLAYERGLOBAL_HOME;
+ if (!playerHome || '' === playerHome) {
+ console.log('PLAYERGLOBAL_HOME is not defined. Create an environment variable (PLAYERGLOBAL_HOME) and point it to the skd dir, or use \'npm run build -- -playerglobal-home=[playerglobal dir]\'.');
+
+ process.exit();
+ }
+}
+
+playerVersion = args['player-version'];
+if (!playerVersion || '' === playerVersion) {
+ playerVersion = process.env.PLAYERGLOBAL_VERSION;
+}
+if (!playerVersion || '' === playerVersion) {
+ playerVersion = '11.1';
+
+ console.log('PLAYERGLOBAL_VERSION was undefined. It is now set to \'11.1\'. To override this default, create an environment variable (PLAYERGLOBAL_VERSION) and set it to required version, or use \'npm run build -- -player-version=[version]\'.');
+} else {
+ console.log('PLAYERGLOBAL_VERSION is ' + playerVersion + '.');
+}
+
+if (!fs.existsSync(playerHome + '/' + playerVersion + '/playerglobal.swc')) {
+ console.log('\'playerglobal.swc\' could not be found. Make sure you have set PLAYERGLOBAL_HOME to a correctly downloaded and stored playerglobal.swc');
+
+ process.exit();
+}
+
dir = args['dir'];
if (!fs.existsSync(dir)) {
console.log(`The intended target directory ('${dir}') does not exist.`);
@@ -88,13 +124,17 @@ npm run build
fs.createReadStream('resources/build.js')
.pipe(fs.createWriteStream(projectPath + '/build.js'));
+fs.createReadStream('resources/install.js')
+.pipe(fs.createWriteStream(projectPath + '/install.js'));
+
createFile(projectPath + '/package.json', `{
+
"dependencies": {
"http-server" : "0.10.0"
},
"scripts": {
- "build": "npm install; node build.js -royale-home=${royaleHome} -src=src/${projectName}.as; http-server bin/ -s -o -p3546"
+ "build": "node install.js; node build.js -wastc-jar=${wastcJar} -playerglobal-home=${playerHome} -playerglobal-version=${playerVersion} -src=src/${projectName}.as; http-server ./bin -o -a localhost -p 1337 -c-1"
}
}
diff --git a/wast/resources/build.js b/wast/resources/build.js
index 4b95b28..91c5cb4 100644
--- a/wast/resources/build.js
+++ b/wast/resources/build.js
@@ -19,12 +19,11 @@
'use strict';
-let args, cmd, exec, fs, playerHome, playerVersion, royaleHome, wastc;
+let args, cmd, exec, playerHome, playerVersion, wastcJar;
exec = require('child_process').exec;
-fs = require('fs');
@@ -45,54 +44,13 @@ process.argv.slice(2).forEach(function (value) {
}
});
-royaleHome = args['royale-home'];
-if (!royaleHome || '' === royaleHome) {
- royaleHome = process.env.ROYALE_HOME;
- if (!royaleHome || '' === royaleHome) {
- console.log('ROYALE_HOME is not defined. Create an environment variable (ROYALE_HOME) and point it to the skd dir, or use \'npm run build -- -royale-home=[sdk dir]\'.');
-
- process.exit();
- }
-}
-console.log('ROYALE_HOME is ' + royaleHome);
-
-wastc = royaleHome + '/wast/lib/wastc.jar';
-if (!fs.existsSync(wastc)) {
- console.log('Transpiler \'wastc\' not found. This sdk appears not to be an sdk that is compatible with this project.');
-
- process.exit();
-}
+wastcJar = args['wastc-jar'];
playerHome = args['playerglobal-home'];
-if (!playerHome || '' === playerHome) {
- playerHome = process.env.PLAYERGLOBAL_HOME;
- if (!playerHome || '' === playerHome) {
- console.log('PLAYERGLOBAL_HOME is not defined. Create an environment variable (PLAYERGLOBAL_HOME) and point it to the skd dir, or use \'npm run build -- -playerglobal-home=[playerglobal dir]\'.');
-
- process.exit();
- }
-}
-console.log('PLAYERGLOBAL_HOME is ' + playerHome);
-
-playerVersion = args['player-version'];
-if (!playerVersion || '' === playerVersion) {
- playerVersion = process.env.PLAYERGLOBAL_VERSION;
-}
-if (!playerVersion || '' === playerVersion) {
- playerVersion = '11.1';
-
- console.log('PLAYERGLOBAL_VERSION was undefined. It is now set to \'11.1\'. To override this default, create an environment variable (PLAYERGLOBAL_VERSION) and set it to required version, or use \'npm run build -- -player-version=[version]\'.');
-} else {
- console.log('PLAYERGLOBAL_VERSION is ' + playerVersion + '.');
-}
-
-if (!fs.existsSync(playerHome + '/' + playerVersion + '/playerglobal.swc')) {
- console.log('\'playerglobal.swc\' could not be found. Make sure you have set PLAYERGLOBAL_HOME to a correctly downloaded and stored playerglobal.swc');
- process.exit();
-}
+playerVersion = args['playerglobal-version'];
-cmd = `/usr/bin/java -Xmx384m -Dsun.io.useCanonCaches=false -jar "${wastc}" -external-library-path="${playerHome}/${playerVersion}/playerglobal.swc" ${args['src']}`;
+cmd = `/usr/bin/java -Xmx384m -Dsun.io.useCanonCaches=false -jar "${wastcJar}" -external-library-path="${playerHome}/${playerVersion}/playerglobal.swc" ${args['src']}`;
exec(cmd, function (error, stdout, stderr) {
console.log(stdout);
diff --git a/wast/resources/install.js b/wast/resources/install.js
new file mode 100644
index 0000000..6e1f1ac
--- /dev/null
+++ b/wast/resources/install.js
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+'use strict';
+
+let args, cmd, exec, fs;
+
+
+
+exec = require('child_process').exec;
+fs = require('fs');
+
+
+
+args = {};
+process.argv.slice(2).forEach(function (value) {
+ let valueArray;
+
+ valueArray = value.split('=');
+ if (1 < valueArray.length) {
+ let name, value;
+
+ name = valueArray[0].substr(1);
+ value = valueArray[1];
+
+ args[name] = value;
+
+ console.log('Set arg \'' + name + '\' to \'' + value + '\'');
+ }
+});
+
+if (!fs.existsSync('./node_modules/http-server/bin/http-server')) {
+ cmd = 'npm install';
+
+ exec(cmd, function (error, stdout, stderr) {
+ console.log(stdout);
+
+ if (stderr && '' !== stderr) {
+ console.log('stderr: ' + stderr);
+ }
+
+ if (error) {
+ console.log('exec error: ' + error);
+ }
+ });
+}
--
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.
[royale-asjs] 02/02: Merge branch 'develop' into wast
Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
erikdebruin pushed a commit to branch feature/wast
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 1047779dc6cf7d8026753628caa64983a2ed3c73
Merge: b6df1ba 5a96d04
Author: Erik de Bruin <er...@ixsoftware.nl>
AuthorDate: Thu Nov 16 11:39:42 2017 +0100
Merge branch 'develop' into wast
.../mdl/itemRenderers/FooterLinkItemRenderer.as | 36 +++++++++++++---------
1 file changed, 21 insertions(+), 15 deletions(-)
--
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.