Jonathan Hart | 8a030cd | 2014-10-07 10:52:29 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 2 | # ---------------------------------------------------------------------------- |
tom | 1a17eb4 | 2014-10-08 20:21:23 -0700 | [diff] [blame] | 3 | # Echoes project-level directory if a Java file within is newer than the |
| 4 | # target directory. |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 5 | # ---------------------------------------------------------------------------- |
tom | 1cd74ae | 2014-10-01 14:58:32 -0700 | [diff] [blame] | 6 | |
| 7 | javaFile=${1#*\/src\/*\/java/} |
| 8 | basename=${1/*\//} |
| 9 | |
| 10 | [ $basename = "package-info.java" ] && exit 0 |
| 11 | |
| 12 | src=${1/$javaFile/} |
| 13 | project=${src/src*/} |
tom | 1a17eb4 | 2014-10-08 20:21:23 -0700 | [diff] [blame] | 14 | target=$project/target |
tom | 1cd74ae | 2014-10-01 14:58:32 -0700 | [diff] [blame] | 15 | |
tom | 1a17eb4 | 2014-10-08 20:21:23 -0700 | [diff] [blame] | 16 | [ $target -nt ${src}$javaFile ] || echo ${src/src*/} |