From 644f60e93cc967563741a855f143061b44c68574 Mon Sep 17 00:00:00 2001 From: Christian Oder Date: Tue, 19 Jan 2016 10:45:51 +0100 Subject: [PATCH] idegen: Add compatibility for custom out directory At the moment the script looks for the jar iside the out dir. However, if the our dir is set to a different directory via OUT_DIR_COMMON_BASE the script does not notice that, and errors out saying a build is needed. This commits checks if the OUT_DIR_COMMON_BASE is set, then searches the jar in the proper path. If OUT_DIR_COMMON_BASE is unset, search in "out" like it did before. Test: Build with OUT_DIR_COMMON_BASE set and unset and verify idegen works in both cases. Change-Id: Icfcf41af13139bd81f8589bb900debe5ee616022 --- tools/idegen/idegen.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/idegen/idegen.sh b/tools/idegen/idegen.sh index d7e6986d8..a24fca58e 100755 --- a/tools/idegen/idegen.sh +++ b/tools/idegen/idegen.sh @@ -5,9 +5,14 @@ if [ ! -d development ]; then exit 1 fi +if [[ -z ${OUT_DIR_COMMON_BASE} ]]; then idegenjar=`find out -name idegen.jar -follow | grep -v intermediates` +else +idegenjar=`find $OUT_DIR_COMMON_BASE/$(basename "$PWD") -name idegen.jar -follow | grep -v intermediates` +fi + if [ "" = "$idegenjar" ]; then echo "Couldn't find idegen.jar. Please run make first." -else +else java -cp $idegenjar Main fi