Imported Upstream version 4.8.10

This commit is contained in:
Mario Fetka
2021-10-03 11:06:28 +02:00
parent 10dfc9587b
commit 03a8170b15
2361 changed files with 1883897 additions and 338759 deletions

View File

@@ -1,5 +1,5 @@
build.js is builded dojo builder, with applied patches from 'patches' folder, by
itself and compiled using uglify.js
itself and compiled using python3-rjsmin
_base/configRhino.js is unmodifed file from dojo/dojo. Required for a build to work.
@@ -9,4 +9,4 @@ Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
= License =
Full Dojo license is in LICENSE file.
Full Dojo license is in LICENSE file.

View File

@@ -0,0 +1,108 @@
exports.config = function(config){
// summary:
// This module provides bootstrap configuration for running dojo in node.js
// any command line arguments with the load flag are pushed into deps
for(var deps = [], args = [], i = 0; i < process.argv.length; i++){
var arg = (process.argv[i] + "").split("=");
if(arg[0] == "load"){
deps.push(arg[1]);
}else if(arg[0] == "mapPackage") {
var parts = arg[1].split(":"),
name = parts[0],
location=parts[1],
isPrexisting = false;
for (var j = 0; j < config.packages.length; j++) {
var pkg = config.packages[j];
if (pkg.name === name) {
pkg.location = location;
isPrexisting = true;
break;
}
}
if (!isPrexisting) {
config.packages.push({
name: name,
location: location
});
}
}else{
args.push(arg);
}
}
var fs = require("fs");
// make sure global require exists
//if (typeof global.require=="undefined"){
// global.require= {};
//}
// reset the has cache with node-appropriate values;
var hasCache = {
"host-node":1,
"host-browser":0,
"dom":0,
"dojo-has-api":1,
"dojo-xhr-factory":0,
"dojo-inject-api":1,
"dojo-timeout-api":0,
"dojo-trace-api":1,
"dojo-dom-ready-api":0,
"dojo-publish-privates":1,
"dojo-sniff":0,
"dojo-loader":1,
"dojo-test-xd":0,
"dojo-test-sniff":0
};
for(var p in hasCache){
config.hasCache[p] = hasCache[p];
}
var vm = require('vm'),
path = require('path');
// reset some configuration switches with node-appropriate values
var nodeConfig = {
baseUrl: path.dirname(process.argv[1]),
commandLineArgs:args,
deps:deps,
timeout:0,
// TODO: really get the locale
locale:"en-us",
loaderPatch: {
log:function(item){
// define debug for console messages during dev instead of console.log
// (node's heavy async makes console.log confusing sometimes)
var util = require("util");
util.debug(util.inspect(item));
},
eval: function(__text, __urlHint){
return vm.runInThisContext(__text, __urlHint);
},
injectUrl: function(url, callback){
try{
vm.runInThisContext(fs.readFileSync(url, "utf8"), url);
callback();
}catch(e){
this.log("failed to load resource (" + url + ")");
this.log(e);
}
},
getText: function(url, sync, onLoad){
// TODO: implement async and http/https handling
onLoad(fs.readFileSync(url, "utf8"));
}
}
};
for(p in nodeConfig){
config[p] = nodeConfig[p];
}
};

View File

@@ -1,121 +0,0 @@
function rhinoDojoConfig(config, baseUrl, rhinoArgs){
// summary:
// This module provides bootstrap configuration for running dojo in rhino.
// TODO: v1.6 tries to set dojo.doc and dojo.body in rhino; why?
// get a minimal console up
var log = function(hint, args){
print((hint ? hint + ":" : "") + args[0]);
for(var i = 1; i < args.length; i++){
print(", " + args[i]);
}
};
// intentionally define console in the global namespace
console= {
log: function(){ log(0, arguments); },
error: function(){ log("ERROR", arguments); },
warn: function(){ log("WARN", arguments); }
};
// any command line arguments with the load flag are pushed into deps
for(var deps = [], i = 0; i < rhinoArgs.length; i++){
var arg = (rhinoArgs[i] + "").split("=");
if(arg[0] == "load"){
deps.push(arg[1]);
}
}
// provides timed callbacks using Java threads
if(typeof setTimeout == "undefined" || typeof clearTimeout == "undefined"){
var timeouts = [];
clearTimeout = function(idx){
if(!timeouts[idx]){ return; }
timeouts[idx].stop();
};
setTimeout = function(func, delay){
var def = {
sleepTime:delay,
hasSlept:false,
run:function(){
if(!this.hasSlept){
this.hasSlept = true;
java.lang.Thread.currentThread().sleep(this.sleepTime);
}
try{
func();
}catch(e){
console.debug("Error running setTimeout thread:" + e);
}
}
};
var runnable = new java.lang.Runnable(def);
var thread = new java.lang.Thread(runnable);
thread.start();
return timeouts.push(thread) - 1;
};
}
var isLocal = function(url){
return (new java.io.File(url)).exists();
};
// reset the has cache with node-appropriate values;
var hasCache = {
"host-rhino":1,
"host-browser":0,
"dom":0,
"dojo-has-api":1,
"dojo-xhr-factory":0,
"dojo-inject-api":1,
"dojo-timeout-api":0,
"dojo-trace-api":1,
"dojo-loader-catches":1,
"dojo-dom-ready-api":0,
"dojo-publish-privates":1,
"dojo-sniff":0,
"dojo-loader":1,
"dojo-test-xd":0,
"dojo-test-sniff":0
};
for(var p in hasCache){
config.hasCache[p] = hasCache[p];
}
// reset some configuration switches with rhino-appropriate values
var rhinoConfig = {
baseUrl:baseUrl,
commandLineArgs:rhinoArgs,
deps:deps,
timeout:0,
locale:String(java.util.Locale.getDefault().toString().replace('_', '-').toLowerCase()),
loaderPatch:{
injectUrl: function(url, callback){
try{
if(isLocal(url)){
load(url);
}else{
require.eval(readUrl(url, "UTF-8"));
}
callback();
}catch(e){
console.log("failed to load resource (" + url + ")");
console.log(e);
}
},
getText: function(url, sync, onLoad){
// TODO: test https://bugzilla.mozilla.org/show_bug.cgi?id=471005; see v1.6 hostenv_rhino
// note: async mode not supported in rhino
onLoad(isLocal(url) ? readFile(url, "UTF-8") : readUrl(url, "UTF-8"));
}
}
};
for(p in rhinoConfig){
config[p] = rhinoConfig[p];
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
From c0962cfb520d25c367689243b71e43af1dcc0601 Mon Sep 17 00:00:00 2001
From be32e8039fca859a8fc9202c50dcd8663023dd53 Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvoborni@redhat.com>
Date: Thu, 8 Nov 2012 13:22:30 +0100
Subject: [PATCH] Make dojo builder buildable by itself
Subject: [PATCH 1/2] Make dojo builder buildable by itself
Dojo builder is now buildable by itself. It just needed a packackage information,
profile and separating of internal definition of commanLineArgs module to separate
@@ -22,7 +22,7 @@ get rid of this dependency.
create mode 100644 build/package.json
diff --git a/build/argv.js b/build/argv.js
index 18bda74b0eb80e37d9c83cb23a10f29f8ffe91d9..997576687eb74cbb6a6a293b3a855a6d15142368 100644
index c6589afb..98d95bf8 100644
--- a/build/argv.js
+++ b/build/argv.js
@@ -5,7 +5,7 @@ define([
@@ -36,7 +36,7 @@ index 18bda74b0eb80e37d9c83cb23a10f29f8ffe91d9..997576687eb74cbb6a6a293b3a855a6d
"./messages",
diff --git a/build/build.profile.js b/build/build.profile.js
new file mode 100644
index 0000000000000000000000000000000000000000..507728c283c5703106fe029c0fd282cb864c994d
index 00000000..507728c2
--- /dev/null
+++ b/build/build.profile.js
@@ -0,0 +1,32 @@
@@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..507728c283c5703106fe029c0fd282cb
\ No newline at end of file
diff --git a/build/commandLineArgs.js b/build/commandLineArgs.js
new file mode 100644
index 0000000000000000000000000000000000000000..41df62e31a05ef2c00e1eb609c0fabe8641e2d03
index 00000000..41df62e3
--- /dev/null
+++ b/build/commandLineArgs.js
@@ -0,0 +1,7 @@
@@ -88,7 +88,7 @@ index 0000000000000000000000000000000000000000..41df62e31a05ef2c00e1eb609c0fabe8
+});
\ No newline at end of file
diff --git a/build/main.js b/build/main.js
index eeb329c91c0eb4df94178cdfc445e5235409401a..89ad7a9d639257ec99ca86be59abdb74d54939a3 100644
index 131ed644..c0eb36e9 100644
--- a/build/main.js
+++ b/build/main.js
@@ -33,16 +33,14 @@
@@ -105,7 +105,7 @@ index eeb329c91c0eb4df94178cdfc445e5235409401a..89ad7a9d639257ec99ca86be59abdb74
- return process.argv.slice(2);
- });
+ //arg[0] is node; argv[1] is dojo.js; therefore, start with argv[2]
+ commandLineArgs.push(process.argv.slice(2));
+ commandLineArgs.push.apply(commandLineArgs, process.argv.slice(2));
- // helps during dev or heavily async node...
+ // helps during dev or heavily async node
@@ -137,13 +137,13 @@ index eeb329c91c0eb4df94178cdfc445e5235409401a..89ad7a9d639257ec99ca86be59abdb74
}else{
diff --git a/build/package.json b/build/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..568101cb1a182d3415c73d02e151359e1ce3e27d
index 00000000..576030f2
--- /dev/null
+++ b/build/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "build",
+ "version":"1.8.1",
+ "version":"1.13.0",
+ "directories": {
+ "lib": "."
+ },
@@ -165,5 +165,5 @@ index 0000000000000000000000000000000000000000..568101cb1a182d3415c73d02e151359e
+ "dojoBuild": "build.profile.js"
+}
--
1.7.11.7
2.14.3