#!/bin/sh

# replaces wolips projects with symbolic links pointing into the woproject/wolips directory structure.
# This:
# - REMOVES the woproject/wolips/.../* projects (under the assumption that they do not contain any modified code)
# - moves the projects from the workspace into woproject/wolips/...
# - creates a symbolic link in the workspace pointing to the woproject/wolips/... projects
#
# The reason for doing the link in that direction and not the other way round is that ant wants directories
# and ignored symbolic links (even those pointing to directories), but Eclipse doesn't care.
#
# Marc Guenther, yod..chli.ch, 6.7.06

for dir in features plugins; do
(
  cd woproject/wolips/$dir
  for i in org.*; do
    if [ -d ../../../$i -a ! -h ../../../$i ]; then
      rm -rf $i
      mv ../../../$i $i
      ln -s woproject/wolips/$dir/$i ../../../$i
      echo "created link $i -> woproject/wolips/$dir/$i"
    fi
  done
)
done

