summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdistribution/makedist.py32
-rw-r--r--js/bin/HttpServer.js46
-rw-r--r--js/config/build.js23
3 files changed, 61 insertions, 40 deletions
diff --git a/distribution/makedist.py b/distribution/makedist.py
index e02c72b1dd8..d14b7b0b60d 100755
--- a/distribution/makedist.py
+++ b/distribution/makedist.py
@@ -71,12 +71,14 @@ for l in ["/java", "/py", "/php", "/cs", "/cpp/demo"]:
]
#
-# Files from the top-level, cpp, java and cs config directories to include in the demo
+# Files from the top-level, cpp, java, cs and js config directories to include in the demo
# source distribution config directory.
#
demoConfigFiles = [ \
"Make.*", \
"common.xml", \
+ "build.js", \
+ "makebundle.js", \
]
#
@@ -395,8 +397,8 @@ sys.stdout.flush()
copy("ICE_LICENSE", demoDir)
copy(os.path.join(distFilesDir, "src", "common", "README.DEMOS"), demoDir)
-copyMatchingFiles(os.path.join("certs"), os.path.join(demoDir, "certs"), demoCertsFiles)
-for d in ["", "cpp", "java", "cs"]:
+copyMatchingFiles(os.path.join(srcDir, "certs"), os.path.join(demoDir, "certs"), demoCertsFiles)
+for d in ["", "cpp", "java", "cs", "js"]:
copyMatchingFiles(os.path.join(d, "config"), os.path.join(demoDir, "config"), demoConfigFiles)
copy(os.path.join(distFilesDir, "src", "common", "Make.rules"), os.path.join(demoDir, "config"), False)
@@ -417,6 +419,18 @@ for d in os.listdir('.'):
if os.path.isdir(d) and os.path.exists(os.path.join(d, "demo")):
copy(os.path.join(d, "demo"), os.path.join(demoDir, getMappingDir("demo", d)))
+copy(os.path.join(srcDir, "js", "bin"), os.path.join(demoDir, "demojs", "bin"))
+copy(os.path.join(srcDir, "js", "assets"), os.path.join(demoDir, "demojs", "assets"))
+
+FixUtil.fileMatchAndReplace(os.path.join(demoDir, "demojs", "assets", "Makefile"),
+ [(re.compile("top_srcdir.*= .."), "top_srcdir = ../..")],
+ False)
+os.chdir(os.path.join(demoDir, "demojs", "assets"))
+if os.system("make > /dev/null") != 0:
+ print "Error building JS assets"
+ sys.exit(1)
+os.chdir(srcDir)
+
configSubstituteExprs = [(re.compile(regexpEscape("../../certs")), "../certs")]
for root, dirnames, filesnames in os.walk(demoDir):
for f in filesnames:
@@ -446,6 +460,18 @@ for sd in os.listdir(winSrcDir):
if os.path.isdir(d) and os.path.exists(os.path.join(d, "demo")):
copy(os.path.join(d, "demo"), os.path.join(winDemoDir, getMappingDir("demo", sd)))
+copy(os.path.join(winSrcDir, "js", "bin"), os.path.join(winDemoDir, "demojs", "bin"))
+copy(os.path.join(winSrcDir, "js", "assets"), os.path.join(winDemoDir, "demojs", "assets"))
+
+for f in ["common.min.js", "common.min.js.gz", "common.css", "common.css.gz"]:
+ copy(os.path.join(demoDir, "demojs", "assets", f),
+ os.path.join(winDemoDir, "demojs", "assets", f))
+
+
+FixUtil.fileMatchAndReplace(os.path.join(winDemoDir, "demojs", "assets", "Makefile.mak"),
+ [(re.compile("top_srcdir.*= .."), "top_srcdir = ..\\..")],
+ False)
+
rmFiles = []
projectSubstituteExprs = [(re.compile(re.escape('"README"')), '"README.txt"'),
diff --git a/js/bin/HttpServer.js b/js/bin/HttpServer.js
index 05a64abdc2e..752a7bafaad 100644
--- a/js/bin/HttpServer.js
+++ b/js/bin/HttpServer.js
@@ -36,7 +36,7 @@ var MimeTypes =
png: "image/png",
};
-var iceJsHome = process.env.ICE_JS_HOME;
+var iceHome = process.env.ICE_HOME;
var useBinDist = process.env.USE_BIN_DIST && process.env.USE_BIN_DIST == "yes";
var srcDist;
try
@@ -50,10 +50,10 @@ catch(e)
var iceJs = process.env.OPTIMIZE == "yes" ? "Ice.min.js" : "Ice.js";
//
-// If this is a source distribution and ICE_JS_HOME isn't set ensure
+// If this is a source distribution and ICE_HOME isn't set ensure
// that Ice libraries has been build.
//
-if(srcDist && !iceJsHome && !useBinDist)
+if(srcDist && !iceHome && !useBinDist)
{
var build;
try
@@ -67,22 +67,22 @@ if(srcDist && !iceJsHome && !useBinDist)
if(!build)
{
console.error("error Unable to find " + iceJs + " in " + path.join(__dirname, "..", "lib") + ", please verify " +
- "that the sources has been build or configure ICE_JS_HOME to use a binary distribution.");
+ "that the sources has been build or configure ICE_HOME to use a binary distribution.");
process.exit(1);
}
}
//
-// If this is a demo distribution ensure that ICE_JS_HOME is set or install in a default location.
+// If this is a demo distribution ensure that ICE_HOME is set or install in a default location.
//
if(!srcDist || useBinDist)
{
//
- // if ICE_JS_HOME is not set check if it is install in the default location.
+ // if ICE_HOME is not set check if it is install in the default location.
//
- if(!process.env.ICE_JS_HOME)
+ if(!process.env.ICE_HOME)
{
- var dist = "IceJS-0.1.0";
+ var dist = "Ice-3.5.1";
[
"C:\\Program Files\\ZeroC",
"C:\\Program Files (x86)\\ZeroC",
@@ -95,7 +95,7 @@ if(!srcDist || useBinDist)
{
if(fs.statSync(path.join(basePath, dist, "lib", iceJs)).isFile())
{
- iceJsHome = path.join(basePath, dist);
+ iceHome = path.join(basePath, dist);
return true;
}
}
@@ -106,37 +106,35 @@ if(!srcDist || useBinDist)
});
}
- if(!iceJsHome)
+ if(!iceHome)
{
console.error("error Ice for JavaScript not found in the default installation directories\n" +
- "ICE_JS_HOME environment variable must be set, and point to the Ice for\n" +
- "JavaScript installation directory.");
+ "ICE_HOME environment variable must be set, and point to the Ice installation directory.");
process.exit(1);
}
}
//
-// If ICE_JS_HOME is set ensure that Ice libraries exists in that location.
+// If ICE_HOME is set ensure that Ice libraries exists in that location.
//
-if(iceJsHome)
+if(iceHome)
{
- var iceJsHomeValid;
+ var iceHomeValid;
try
{
- iceJsHomeValid = fs.statSync(path.join(iceJsHome, "lib", iceJs)).isFile();
+ iceHomeValid = fs.statSync(path.join(iceHome, "lib", iceJs)).isFile();
}
catch(e)
{
}
- if(!iceJsHomeValid)
+ if(!iceHomeValid)
{
- console.error("error Unable to find " + iceJs + " in " + path.join(iceJsHome, "lib") +
- ", please verify ICE_JS_HOME is properly configured and Ice for JavaScript " +
- "is correctly installed");
+ console.error("error Unable to find " + iceJs + " in " + path.join(iceHome, "lib") +
+ ", please verify ICE_HOME is properly configured and Ice is correctly installed");
process.exit(1);
}
- console.log("Using Ice libraries from " + path.join(iceJsHome, "lib"));
+ console.log("Using Ice libraries from " + path.join(iceHome, "lib"));
}
var libraries = ["/lib/Ice.js", "/lib/Ice.min.js",
@@ -157,11 +155,11 @@ HttpServer.prototype.processRequest = function(req, res)
var iceLib = libraries.indexOf(req.url.pathname) !== -1;
//
- // If ICE_JS_HOME has been set resolve Ice libraries paths into ICE_JS_HOME.
+ // If ICE_HOME has been set resolve Ice libraries paths into ICE_HOME.
//
- if(iceJsHome && iceLib)
+ if(iceHome && iceLib)
{
- filePath = path.join(iceJsHome, req.url.pathname);
+ filePath = path.join(iceHome, req.url.pathname);
}
else
{
diff --git a/js/config/build.js b/js/config/build.js
index 2cdbb623a1b..000513d2226 100644
--- a/js/config/build.js
+++ b/js/config/build.js
@@ -10,7 +10,6 @@
var fs = require("fs");
var path = require("path");
-var iceJsDist = "IceJS-0.1.0";
var iceDist = "Ice-3.5.1";
var defaultInstallLocations = [
@@ -20,8 +19,6 @@ var defaultInstallLocations = [
"/opt"];
var iceHome = process.env.ICE_HOME;
-
-var iceJsHome = process.env.ICE_JS_HOME;
var useBinDist = process.env.USE_BIN_DIST == "yes";
var srcDist;
@@ -99,18 +96,18 @@ if(!srcDist || useBinDist)
}
//
- // If ICE_JS_HOME is not set, check if it is installed in the default location.
+ // If ICE_HOME is not set, check if it is installed in the default location.
//
- if(!process.env.ICE_JS_HOME)
+ if(!process.env.ICE_HOME)
{
defaultInstallLocations.some(
function(basePath)
{
try
{
- if(fs.statSync(path.join(basePath, iceJsDist, "bin", slice2js)).isFile())
+ if(fs.statSync(path.join(basePath, iceDist, "bin", slice2js)).isFile())
{
- iceJsHome = path.join(basePath, iceJsDist);
+ iceHome = path.join(basePath, iceDist);
return true;
}
}
@@ -121,10 +118,10 @@ if(!srcDist || useBinDist)
});
}
- if(!iceJsHome)
+ if(!iceHome)
{
- console.error("error: Ice for JavaScript not found in the default installation directories. Set the ICE_JS_HOME environment\n" +
- "variable to point to the Ice for JavaScript installation directory.");
+ console.error("error: Ice not found in the default installation directories. Set the ICE_HOME environment\n" +
+ "variable to point to the Ice installation directory.");
process.exit(1);
}
}
@@ -133,11 +130,11 @@ if(!srcDist || useBinDist)
var sliceDir = iceHome ? path.join(iceHome, "slice") :
path.join(__dirname, "..", "..", "slice");
-var binDir = iceJsHome ? path.join(iceJsHome, "bin") :
+var binDir = iceHome ? path.join(iceHome, "bin") :
path.join(__dirname, "..", "..", "cpp", "bin");
-var libDir = iceJsHome ? path.join(iceJsHome, libSubDir) :
- path.join(__dirname, "..", "..", "cpp", libSubDir);
+var libDir = iceHome ? path.join(iceHome, libSubDir) :
+ path.join(__dirname, "..", "..", "cpp", libSubDir);
module.exports.build = function(basePath, files, args)
{