diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2007-09-24 14:25:39 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2007-09-24 14:25:39 +0000 |
| commit | 79c053bee466285de59351981b9d178179ba36b1 (patch) | |
| tree | 6a6d968d36735f539ecb4977faf75d4bf1f655d8 /qpid/java/plugins | |
| parent | 172343d1aa61b96bd5fd6aec2504086e0b4d39d2 (diff) | |
| download | qpid-python-79c053bee466285de59351981b9d178179ba36b1.tar.gz | |
rerun generate script when it is modified
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@578826 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/plugins')
| -rw-r--r-- | qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java index 50af9c257e..85dffeb4bf 100644 --- a/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java +++ b/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java @@ -52,7 +52,7 @@ public class JythonMojo extends AbstractMojo * * @parameter */ - private File source; + private File[] sources; /** * Optional timestamp. @@ -63,27 +63,37 @@ public class JythonMojo extends AbstractMojo public void execute() throws MojoExecutionException { - if (source != null && timestamp != null) + boolean stale = true; + + if (sources != null && sources.length > 0 && timestamp != null) { - if (timestamp.lastModified() > source.lastModified()) + stale = false; + for (File source : sources) { - return; + if (source.lastModified() > timestamp.lastModified()) + { + stale = true; + break; + } } } - jython.main(params); - - if (timestamp != null) + if (stale) { - try - { - timestamp.createNewFile(); - } - catch (IOException e) + jython.main(params); + + if (timestamp != null) { - throw new MojoExecutionException("cannot create timestamp", e); + try + { + timestamp.createNewFile(); + } + catch (IOException e) + { + throw new MojoExecutionException("cannot create timestamp", e); + } + timestamp.setLastModified(System.currentTimeMillis()); } - timestamp.setLastModified(System.currentTimeMillis()); } } |
