This sample shell script has some time-saving aliases to help with downloading and running chandler:
- getchandler - does an svn checkout to get chandler
- updatechandler - updates the chandler tree using svn
- clean - removes the repository and log file
- runrelease - runs the release build of chandler
- taillog - opens the chandler log file
Note: You must edit some of the settings at the top of the file, to tell it what kind of machine it's running on, what path to check out source into, etc.
# Edit these setting - use '' or '1' for each. There should only be one '1'
export ONWINDOWS='1'
export ONMAC=''
export ONLINUX=''
# Set to '1' for anonymous access to source
# comment out the line if you have an svn account
export SVN_ANONYMOUS='1'
# To run the launch chandler unit test
export CHANDLER_LAUNCH_TEST=1
# Put in the location of your OSAF working directory here:
export OSAF="/cygdrive/c/Development/OSAF"
# Here's the path for your main work at the trunk of the tree:
export TRUNK="$OSAF/trunk"
# For torture-testing Chandler, you may want to give it a internationalized path (works on the Mac)
# export TRUNK="$OSAF/trünk"
# Put in the tag used to identify the Branch:
export BRANCHTAG='CHANDLER_DEMO_D_2005'
# Here's the path for branches, if working on a branch:
export BRANCHES="$OSAF/branches"
# We set up BUILD_ROOT for building external from scratch
if test -z $BUILD_ROOT; then
export BUILD_ROOT="$OSAF/trunk/external"
fi
if test -d "$TRUNK"; then
echo "main trunk at " $TRUNK
else
echo "making " $TRUNK
mkdir $TRUNK
fi
if test -z $BRANCHES; then
echo "no branches set"
else
if test -d "$BRANCHES/$BRANCHTAG"; then
echo "branches for $BRANCHTAG at " $BRANCHES/$BRANCHTAG
else
if test ! -d "$BRANCHES"; then
echo "making branches directory at " $BRANCHES
mkdir $BRANCHES
fi
echo "making branch for $BRANCHTAG at " $BRANCHES/$BRANCHTAG
mkdir $BRANCHES/$BRANCHTAG
fi
fi
# set up Profile Directory environment variable, for deleting the repository and log
if test -z "$PROFILEDIR"; then
if test ! -z $ONMAC; then
# MAC case, should work without editing
echo "Mac case"
export PROFILEDIR="/Users/$USER/Library/Application Support/Open Source Applications Foundation/Chandler"
elif test ! -z $ONLINUX; then
echo "linux case"
# Edit manually for Linux - not sure what's here will work
export PROFILEDIR="$TRUNK/chandler/release"
elif test ! -z $ONWINDOWS; then
echo "windows case"
# Windows case - edit manually unless you are using the default (APPDATA)
export PROFILEDIR="$APPDATA""\Open Source Applications Foundation\Chandler"
else
echo "Error - you need to specify one of: ONMAC, ONWINDOWS, ONLINUX"
fi
else
echo "using profile directory " $PROFILEDIR
fi
if test -z $ONWINDOWS; then
export DOTBAT=''
else
export DOTBAT='.bat'
fi
if test -z $SVNCHANDLER; then
export SVNCHANDLER='svn.osafoundation.org'
fi
# To use a different SVN user, get the username from $SVNUSER
if test ! -z $SVNUSER; then
export SVNUSERARG=$SVNUSER@
else
export SVNUSERARG=''
fi
# set up SVN_ACCESS to access either anonymous or the SVNUSER through svn+ssh
if test -z $SVN_ACCESS; then
if test -z $SVN_ANONYMOUS; then
export SVN_ACCESS="svn+ssh://$SVNUSERARG$SVNCHANDLER/svn"
else
export SVN_ACCESS='http://'"$SVNCHANDLER"
fi
fi
# chandler aliases
alias getchandler='cd $TRUNK; svn co $SVN_ACCESS/chandler/trunk/chandler chandler; cd chandler; make install'
alias gethardhat='cd $TRUNK; svn co $SVN_ACCESS/chandler/trunk/hardhat hardhat'
alias getinternal='cd $TRUNK; svn co $SVN_ACCESS/chandler/trunk/internal internal'
alias getexternal='cd $TRUNK; svn co $SVN_ACCESS/chandler/trunk/external external'
alias getdocs='cd $TRUNK; svn co $SVN_ACCESS/docs docs'
alias wxdemo='cd $TRUNK/internal/wx/wxPython/demo; $TRUNK/hardhat/hardhat.py demo.py'
alias unittests='cd $TRUNK/chandler; ./tools/do_tests.sh -u .'
alias hh='$TRUNK/hardhat/hardhat.py'
alias updatechandler='cd $TRUNK/chandler; svn up; make install; clean'
alias updatehardhat='cd $TRUNK/hardhat; svn up'
alias updaterelease='cd $TRUNK/chandler; make install; clean'
alias updatedebug='cd $TRUNK/chandler; make DEBUG=1 install; clean'
alias updateinternal='cd $TRUNK/internal; svn up'
alias updateexternal='cd $TRUNK/external; svn up'
alias updateruntime='cd $TRUNK/chandler; make install; make DEBUG=1 install; clean'
alias runrelease='cd $TRUNK/chandler; ./release/RunChandler$DOTBAT --stderr'
alias rundebug='cd $TRUNK/chandler; ./debug/RunChandler$DOTBAT --stderr'
alias wingdebug='cd $TRUNK/chandler; ./debug/RunChandler$DOTBAT --wing --stderr'
alias clean='rm -rf "$PROFILEDIR/"__repository__ "$PROFILEDIR/"chandler.log "$PROFILEDIR/"*.default'
alias purge='cd $TRUNK/chandler; ./debug/RunPython$DOTBAT tools/purge.py .'
alias run_test='$TRUNK/chandler/debug/RunPython$DOTBAT -m run_tests -v'
alias run_tests='cd $TRUNK/chandler; ./debug/RunPython$DOTBAT -m run_tests application crypto osaf repository'
# Aliases for working on a branch
# Note that these aliases don't automatically 'clean' or make install when we update on the
# branch - you should do that manually.
alias getbranch='cd $BRANCHES/$BRANCHTAG; svn co $SVN_ACCESS/chandler/branches/$BRANCHTAG/chandler chandler; cd chandler; make install'
alias updatebranch='cd $BRANCHES/$BRANCHTAG/chandler; svn up'
alias runbranch='cd $BRANCHES/$BRANCHTAG/chandler; ./release/RunChandler$DOTBAT --stderr'
alias gobranch='cd $BRANCHES/$BRANCHTAG/chandler'
alias gomain='cd $TRUNK/chandler'
#PLATFORM-SPECIFIC STUFF YOU MIGHT NOT WANT
#------------------------------------------
#add cygwin /usr/bin to the path for user scripts like pgrep
export PATH="$PATH":~
if test ! -z $ONMAC; then
# for Mac, just open the log file with the right application (Console)
alias taillog='open "$PROFILEDIR/chandler.log"'
else
alias taillog='cd "$PROFILEDIR"; tail -f chandler.log'
fi
if test -n $ONMAC; then
alias o='open -a /Applications/TextEdit.app $1'
alias wing='open -a /Applications/WingIDE-Professional-2.0.2/WingIDE.app $1'
fi
#END
#---
cd $TRUNK
echo "done."
-- DonnDenman - Updated for Subversion on 26 May 2005