Skip to content

Commit

Permalink
press command line tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Robinson committed Oct 3, 2008
1 parent ecc39ff commit 964cb66
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tools/build.xml
Expand Up @@ -10,6 +10,7 @@
<file name = "objjc/build.xml" />
<file name = "steam/build.xml" />
<file name = "bake/build.xml" />
<file name = "press/build.xml" />
<file name = "Utilities/build.xml" />
<file name = "NewApplication/build.xml" />
</filelist>
Expand Down
39 changes: 39 additions & 0 deletions Tools/press/build.xml
@@ -0,0 +1,39 @@
<?xml version = "1.0"?>
<project name = "press" default = "build" basedir = "." >

<import file = "../../common.xml" />

<property name = "Build.Intermediate" location = "${Build}/press.build/${Configuration}" />
<property name = "Build.press" location = "${Build}/${Configuration}/press" />

<target name = "clean">
<delete dir = "${Build.press}" verbose = "true" />
</target>

<target name = "build">

<mkdir dir = "${Build.press}" />

<copy file = "${basedir}/press.j" tofile = "${Build.press}/press.j" />
<copy file = "${basedir}/objj-analysis-tools.j" tofile = "${Build.press}/objj-analysis-tools.j" />

<copy file = "${basedir}/press" tofile = "${Build.press}/press" />

<chmod file = "${Build.press}/press" perm = "+x" />

</target>

<target name = "release" depends = "build">

<antcall target = "prepare-release" />

<copy file = "${Build.press}/press.j" tofile = "${Build.Cappuccino.Tools.Lib}/press.j" />
<copy file = "${Build.press}/objj-analysis-tools.j" tofile = "${Build.Cappuccino.Tools.Lib}/objj-analysis-tools.j" />

<copy file = "${Build.press}/press" tofile = "${Build.Cappuccino.Tools.Bin}/press" />

<chmod file = "${Build.Cappuccino.Tools.Bin}/press" perm = "+x" />

</target>

</project>
36 changes: 36 additions & 0 deletions Tools/press/press
@@ -0,0 +1,36 @@
#!/bin/sh

# 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`

# check to ensure it exists, print message
if [ -d $OBJJ_HOME ]; then
echo "OBJJ_HOME not set, defaulting to $OBJJ_HOME" 1>&2
else
echo "OBJJ_HOME not set, default at $OBJJ_HOME doesn't exist, exiting" 1>&2
exit 2
fi
fi

OBJJ_LIB="$OBJJ_HOME/lib"

PRESS="$OBJJ_LIB/press.j"

# convert paths for Cygwin
if [[ `uname` == CYGWIN* ]]; then
OBJJ_HOME=`cygpath -w "$OBJJ_HOME"`
PRESS=`cygpath -w "$PRESS"`
fi

objj $PRESS $@

0 comments on commit 964cb66

Please sign in to comment.