aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-01-12 11:28:55 +0200
committerTeemu Suo-Anttila <teemusa@vaadin.com>2015-01-12 11:28:55 +0200
commit2286f9871f7f77dea6139d0cd1dfc6754b1946d5 (patch)
treec8a978d77dff74788b5a290f6c7928e39932b8a5 /scripts
parent35d91245de3218283c8f4c733a3aa72ea395fb1c (diff)
parent3f27e02f121c0a39b217532afcf9530bfd2caba7 (diff)
downloadvaadin-framework-2286f9871f7f77dea6139d0cd1dfc6754b1946d5.tar.gz
vaadin-framework-2286f9871f7f77dea6139d0cd1dfc6754b1946d5.zip
Merge remote-tracking branch 'origin/master' into grid
Change-Id: Ic6b667ea6ceff43a609ce2037f656c6274871fb7
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/format.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/format.sh b/scripts/format.sh
new file mode 100755
index 0000000000..540a35627c
--- /dev/null
+++ b/scripts/format.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Find eclipse binary
+if [ "$ECLIPSE" = "" ]
+then
+ ECLIPSE=`which eclipse`
+fi
+
+if [ "$ECLIPSE" = "" ]
+then
+ echo "Could not find 'eclipse' in PATH"
+ echo "Either add it to the PATH or set the ECLIPSE variable to point to the Eclipse binary"
+ echo "e.g. ECLIPSE=\"/some/where/eclipse\" $0"
+ exit 1
+fi
+
+# Resolve project root directory
+basedir=`dirname $0`/..
+pushd "$basedir" > /dev/null
+basedir=`pwd`
+popd > /dev/null
+
+SRC=`ls -d $basedir/*/src $basedir/*/tests/src`
+
+# Use project formatting settings
+config="$basedir/.settings/org.eclipse.jdt.core.prefs"
+
+"$ECLIPSE" -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter -config "$config" $SRC