Skip to content

Instantly share code, notes, and snippets.

View gkossakowski's full-sized avatar
🎯
Focusing

Grzegorz Kossakowski gkossakowski

🎯
Focusing
View GitHub Profile
@gkossakowski
gkossakowski / eclipsify_sbt.sh
Created October 19, 2012 00:54 — forked from adriaanm/eclipsify_sbt.sh
rewire sbt's directory structure so it adheres to a standard eclipse can deal with
#!/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