Skip to content

Instantly share code, notes, and snippets.

@sebasjm
Last active August 29, 2015 14:27
Show Gist options
  • Save sebasjm/02993381111e759ab10c to your computer and use it in GitHub Desktop.
Save sebasjm/02993381111e759ab10c to your computer and use it in GitHub Desktop.
incremental javac with inotify & maven
function log(){
echo [status] $(date +%x-%X) $@
}
log install
mvn clean install || exit 1
log copy deps
mvn dependency:copy-dependencies || exit 1
log ready
inotifywait $(find src/main/java -type f) -m -e close_write | while read file op; do
log compiling $file
$JAVA_HOME/bin/javac -g -cp target/classes/:target/dependency/* -d target/classes $file && log ok
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment