diff options
author | Artur Signell <artur@vaadin.com> | 2014-12-29 14:04:45 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-12-30 10:28:10 +0000 |
commit | 7ca1b0d1a8aa29a9ab6d9aea41cc8b7c5c78e6b0 (patch) | |
tree | 3b677d61b7db515561f25f81c7b3e2d4c6fd24af | |
parent | f77c22e6afee80fcdfe27b7ff6ad5242ca836a40 (diff) | |
download | vaadin-framework-7ca1b0d1a8aa29a9ab6d9aea41cc8b7c5c78e6b0.tar.gz vaadin-framework-7ca1b0d1a8aa29a9ab6d9aea41cc8b7c5c78e6b0.zip |
Script for formatting the project using Eclipse
Change-Id: I9c4f210e29d14db29ea75b172f9b017f91b8bc7c
-rwxr-xr-x | scripts/format.sh | 28 |
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 |