Preliminary Windows built tool support (objj, objjc, steam and parts of the ant tasks work).

bake updated (now just provide a path of any type: ssh://, git://, etc)

Reviewed by Francisco.
This commit is contained in:
Tom Robinson committed 2008-09-04 06:13:00 -07:00
1 parent 36b4508afc
commit d797b2fe80
8 files changed
+98 -70

No files matched your search

+15 -12
View File
@@ -1,12 +1,20 @@
#!/bin/sh
# if OBJJ_HOME isn't set, try to determine it out
# if OBJJ_HOME isn't set, try to determine it
if [ -z $OBJJ_HOME ]; then
# get path of the executable
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
# resolve symlinks
if [ -h $SELF_PATH ]; then
SELF_PATH=`readlink $SELF_PATH`
fi
# get second ancestor directory
SELF_DIR=`dirname $SELF_PATH`
export OBJJ_HOME=`dirname $SELF_DIR`
export OBJJ_HOME="`dirname $SELF_DIR`/share/objj"
# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
@@ -20,14 +28,9 @@ OBJJ_LIB="$OBJJ_HOME/lib"
BAKE="$OBJJ_LIB/bake.j"
# convert paths for Cygwin
UNAME=`uname`
case "$UNAME" in
CYGWIN*)
OBJJ_HOME=`cygpath -w "$OBJJ_HOME"`
BAKE=`cygpath -w "$BAKE"`
;;
*)
;;
esac
if [[ `uname` == CYGWIN* ]]; then
OBJJ_HOME=`cygpath -w "$OBJJ_HOME"`
BAKE=`cygpath -w "$BAKE"`
fi
objj $BAKE $@
+3 -4
View File
@@ -42,7 +42,7 @@ function update()
switch (source.type)
{
case "git-ssh":
case "git":
if (new File(sourcePath).isDirectory())
{
CPLog.debug("git pull (" + sourcePath + ")");
@@ -50,9 +50,8 @@ function update()
}
else
{
var gitPath = "ssh://" + source.server + source.path;
CPLog.debug("git clone (" + gitPath + ")");
exec(["git", "clone", gitPath, sourcePath]);
CPLog.debug("git clone (" + source.path + ")");
exec(["git", "clone", source.path, sourcePath]);
}
break;
default :
+4 -7
View File
@@ -1,9 +1,8 @@
{
"sources" : [
{
"type" : "git-ssh",
"server" : "git@git.myserver.com",
"path" : "/home/git/cappuccino.git",
"type" : "git",
"path" : "git://github.com/280north/cappuccino.git",
"parts" : [
{
"src" : "Objective-J",
@@ -26,9 +25,8 @@
]
},
{
"type" : "git-ssh",
"server" : "git@git.myserver.com",
"path" : "/home/git/myapp.git",
"type" : "git",
"server" : "ssh://git@git.myserver.com/home/git/myapp.git",
"parts" : [
{
"src" : "Editor/Server",
@@ -40,7 +38,6 @@
"deployments" : [
{ "host" : "deploy@myserver.com", "path" : "/var/www/mysite/public" }
],
"templatePath" : "index.html",
"templateVars" : {
"APPLICATION_NAME" : "My Application",
"BACKGROUND_COLOR" : "black",
+19 -16
View File
@@ -2,11 +2,19 @@
# if OBJJ_HOME isn't set, try to determine it out
if [ -z $OBJJ_HOME ]; then
# get path of the executable
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
# resolve symlinks
if [ -h $SELF_PATH ]; then
SELF_PATH=`readlink $SELF_PATH`
fi
# get second ancestor directory
SELF_DIR=`dirname $SELF_PATH`
export OBJJ_HOME=`dirname $SELF_DIR`
export OBJJ_HOME="`dirname $SELF_DIR`/share/objj"
# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
@@ -16,7 +24,7 @@ if [ -z $OBJJ_HOME ]; then
fi
OBJJ_LIB="$OBJJ_HOME/lib"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar:$CLASSPATH"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar"
OBJJ="$OBJJ_LIB/objj.js"
RLWRAP=`which rlwrap`
@@ -29,19 +37,14 @@ if [ -d "lib" ]; then
fi
# convert paths for Cygwin
UNAME=`uname`
case "$UNAME" in
CYGWIN*)
OBJJ_HOME=`cygpath -wp "$OBJJ_HOME"`
OBJJ_LIB=`cygpath -wp "$OBJJ_LIB"`
OBJJ=`cygpath -wp "$OBJJ"`
FRAMEWORKS=`cygpath -w "$FRAMEWORKS"`
STEAM_BUILD=`cygpath -w "$STEAM_BUILD"`
CLASSPATH=`cygpath -wp "$CLASSPATH"`
;;
*)
;;
esac
if [[ `uname` == CYGWIN* ]]; then
OBJJ_HOME=`cygpath -wp "$OBJJ_HOME"`
OBJJ_LIB=`cygpath -wp "$OBJJ_LIB"`
OBJJ=`cygpath -wp "$OBJJ"`
FRAMEWORKS=`cygpath -w "$FRAMEWORKS"`
STEAM_BUILD=`cygpath -w "$STEAM_BUILD"`
CLASSPATH=`cygpath -wp "$CLASSPATH"`
fi
#if [ -e $STEAM_BUILD/Objective-J.build/Release/Rhino ]; then
$RLWRAP java -classpath $CLASSPATH objj $OBJJ_LIB $STEAM_BUILD $@
+15 -12
View File
@@ -1,12 +1,20 @@
#!/bin/sh
# if OBJJ_HOME isn't set, try to determine it out
# if OBJJ_HOME isn't set, try to determine it
if [ -z $OBJJ_HOME ]; then
# get path of the executable
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
# resolve symlinks
if [ -h $SELF_PATH ]; then
SELF_PATH=`readlink $SELF_PATH`
fi
# get second ancestor directory
SELF_DIR=`dirname $SELF_PATH`
export OBJJ_HOME=`dirname $SELF_DIR`
export OBJJ_HOME="`dirname $SELF_DIR`/share/objj"
# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
@@ -16,16 +24,11 @@ if [ -z $OBJJ_HOME ]; then
fi
OBJJ_LIB="$OBJJ_HOME/lib"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar:$CLASSPATH"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar"
# convert paths for Cygwin
UNAME=`uname`
case "$UNAME" in
CYGWIN*)
CLASSPATH=`cygpath -wp "$CLASSPATH"`
;;
*)
;;
esac
if [[ `uname` == CYGWIN* ]]; then
CLASSPATH=`cygpath -wp "$CLASSPATH"`
fi
java -classpath $CLASSPATH objjc $@
+3 -1
View File
@@ -29,7 +29,9 @@ function preprocess(aFilePath, outFilePath, gccArgs, shouldObjjPreprocess)
{
print("Statically Preprocessing " + aFilePath);
var tmpFile = java.io.File.createTempFile("OBJJC", "");
// FIXME: figure out why this doesn't work on Windows/Cygwin
//var tmpFile = java.io.File.createTempFile("OBJJC", "");
var tmpFile = new java.io.File(outFilePath+".tmp");
tmpFile.deleteOnExit();
// -E JUST preprocess.
+16 -12
View File
@@ -1,12 +1,20 @@
#!/bin/sh
# if OBJJ_HOME isn't set, try to determine it out
# if OBJJ_HOME isn't set, try to determine it
if [ -z $OBJJ_HOME ]; then
# get path of the executable
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && pwd -P) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
# resolve symlinks
if [ -h $SELF_PATH ]; then
SELF_PATH=`readlink $SELF_PATH`
fi
# get second ancestor directory
SELF_DIR=`dirname $SELF_PATH`
export OBJJ_HOME=`dirname $SELF_DIR`
export OBJJ_HOME="`dirname $SELF_DIR`/share/objj"
# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
@@ -16,16 +24,12 @@ if [ -z $OBJJ_HOME ]; then
fi
OBJJ_LIB="$OBJJ_HOME/lib"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar:$CLASSPATH"
CLASSPATH="$OBJJ_LIB:$OBJJ_LIB/js.jar"
# convert paths for Cygwin
UNAME=`uname`
case "$UNAME" in
CYGWIN*)
CLASSPATH=`cygpath -wp "$CLASSPATH"`
;;
*)
;;
esac
if [[ `uname` == CYGWIN* ]]; then
CLASSPATH=`cygpath -wp "$CLASSPATH"`
STEAM_BUILD=`cygpath -wp "$STEAM_BUILD"`
fi
java -classpath $CLASSPATH steam $@
+23 -6
View File
@@ -199,7 +199,7 @@ Project.prototype.build = function()
replacedFiles = [];
hasModifiedJFiles = false;
shouldObjjPreprocess = true,
objjcComponents = ["objjc"];
objjcComponents = ["bash", OBJJ_HOME + "/bin/objjc"];
if (!shouldObjjPreprocess)
objjcComponents.push("-E");
@@ -232,7 +232,7 @@ Project.prototype.build = function()
var oFiles = getFiles(buildObjects, 'o'),
sjFile = new File(buildProducts.getCanonicalPath() + '/' + this._activeTarget.name() + ".sj"),
catComponents = [OBJJ_HOME + "/lib/cat", OBJJ_HOME + "/lib/sjheader.txt"];
catComponents = ["bash", OBJJ_HOME + "/lib/cat", OBJJ_HOME + "/lib/sjheader.txt"];
for (index = 0, count = oFiles.length; index < count; ++index)
catComponents.push(oFiles[index].getCanonicalPath());
@@ -265,8 +265,7 @@ Project.prototype.copyIndexFile = function()
{
var indexFile = new File(this._root.getAbsolutePath() + "/index.html").getCanonicalFile();
if (indexFile.exists())
exec(["rsync", "-avz", indexFile.getAbsolutePath(), this.buildProducts().getAbsolutePath()]);
rsync(indexFile, this.buildProducts());
}
Project.prototype.writeInfoPlist = function()
@@ -280,8 +279,7 @@ Project.prototype.writeInfoPlist = function()
Project.prototype.copyResources = function()
{
if (this._resources.exists())
exec(["rsync", "-avz", this._resources.getAbsolutePath() + '/', this.buildProducts().getAbsolutePath() + "/Resources"]);
rsync(this._resources, this.buildProducts());
}
function main()
@@ -469,6 +467,25 @@ function exec(/*Array*/ command, /*Boolean*/ showOutput)
return output;
}
function rsync(srcFile, dstFile)
{
var src, dst;
if (String(java.lang.System.getenv("OS")).indexOf("Windows") < 0)
{
src = srcFile.getAbsolutePath();
dst = dstFile.getAbsolutePath();
}
else
{
src = exec(["cygpath", "-u", srcFile.getAbsolutePath() + '/']);
dst = exec(["cygpath", "-u", dstFile.getAbsolutePath() + "/Resources"]);
}
if (srcFile.exists())
exec(["rsync", "-avz", src, dst]);
}
function getFileName(aPath)
{
var index = aPath.lastIndexOf('/');