-
-
Save gkossakowski/3915650 to your computer and use it in GitHub Desktop.
rewire sbt's directory structure so it adheres to a standard eclipse can deal with
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE=$HOME/git/xsbt/ | |
for SRC in `find $BASE -not -path '*/src*/*' -name '*.scala'`;do | |
PKG=`grep "^\s*package " $SRC | perl -pse 's/\s*package\s*(\w*?)\b/package $1/' | tr -d '\r' | tr -d ';' | cut -d' ' -f2 | tr '\n.' '//'` | |
mkdir -p `dirname $SRC`/src/main/scala/$PKG | |
ln -s $SRC `dirname $SRC`/src/main/scala/$PKG`basename $SRC` | |
done | |
for SRC in `find $BASE -path '*/target/src_managed/*' -name '*.scala'`;do | |
PKG=`grep "^\s*package " $SRC | perl -pse 's/\s*package\s*(\w*?)\b/package $1/' | tr -d '\r' | tr -d ';' | cut -d' ' -f2 | tr '\n.' '//'` | |
TGT=`dirname $SRC | perl -pe 's/src_managed/src_managed-sane/'` | |
mkdir -p $TGT/scala/$PKG | |
ln -s $SRC $TGT/scala/$PKG`basename $SRC` | |
done | |
mkdir -p $BASE/ivy/src/main/java-sane/sbt/ | |
ln -s $BASE/ivy/src/main/java/ResolverAdapter.java $BASE/ivy/src/main/java-sane/sbt/ResolverAdapter.java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment