Skip to content

Commit 3940818

Browse files
committed
Merge pull request #615 from dotty-staging/dotc-improve
Rebuild dotc if new *.scala files are found in `dotty/src`
2 parents 2bfbb8e + f870c31 commit 3940818

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bin/dotc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,21 @@ function checkjar {
5757
else
5858
echo "The required jar file was built successfully."
5959
fi
60+
else
61+
NEW_FILES="$(find "$DOTTY_ROOT/$3" -iname "*.scala" -newer "$1")"
62+
if [ ! -z "$NEW_FILES" ];
63+
then
64+
echo "new files detected. rebuilding"
65+
cd $DOTTY_ROOT
66+
sbt $2
67+
touch "$1"
68+
cd -
69+
fi
6070
fi
6171
}
6272

63-
checkjar $MAIN_JAR package
64-
checkjar $TEST_JAR test:package
73+
checkjar $MAIN_JAR package src
74+
checkjar $TEST_JAR test:package test
6575

6676
# Autodetecting the scala-library location, in case it wasn't provided by an environment variable
6777
if [ "$SCALA_LIBRARY_JAR" == "" ]

0 commit comments

Comments
 (0)