forked from nuxeo/nuxeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fixeclipse
executable file
·29 lines (27 loc) · 914 Bytes
/
fixeclipse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
# $Id: fixeclipse 25099 2007-09-18 23:13:08Z fguillaume $
OLD_MAIN=target/classes
NEW_MAIN=bin/main
OLD_TEST=target/test-classes
NEW_TEST=bin/test
echo "Fixing eclipse classpath to use bin output directory instead of target..."
find . -maxdepth 4 -name .classpath |
xargs grep -El "path=\"$OLD_MAIN\"|output=\"$OLD_TEST\"" |
while read i; do
echo "$i"
perl -pi -e "s,path=\"$OLD_MAIN\",path=\"$NEW_MAIN\"," "$i"
perl -pi -e "s,output=\"$OLD_TEST\",output=\"$NEW_TEST\"," "$i"
done
echo "Done."
echo "Replacing missing or badly generated files with .*.ok files..."
find . -maxdepth 4 -name '.*.ok' |
while read file; do
newfile="${file%.ok}"
if diff -bB "$file" "$newfile" >/dev/null; then
: # same file
else
echo "$newfile"
cp -f "$file" "$newfile"
fi
done
echo "Done."