Skip to content

Rebuild dotc if new *.scala files are found in dotty/src #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions bin/dotc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,21 @@ function checkjar {
else
echo "The required jar file was built successfully."
fi
else
NEW_FILES="$(find "$DOTTY_ROOT/$3" -iname "*.scala" -newer "$1")"
if [ ! -z "$NEW_FILES" ];
then
echo "new files detected. rebuilding"
cd $DOTTY_ROOT
sbt $2
touch "$1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to do this manually? At a first sight, sbt should update the jar file when rebuilding, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes sbt is smart enough to see that it does not need to rebuild the project, though timestamps changed. Eg if you make a change and revert it.

cd -
fi
fi
}

checkjar $MAIN_JAR package
checkjar $TEST_JAR test:package
checkjar $MAIN_JAR package src
checkjar $TEST_JAR test:package test

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