summaryrefslogtreecommitdiff
path: root/java/plugins/src
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2007-09-24 14:25:39 +0000
committerRafael H. Schloming <rhs@apache.org>2007-09-24 14:25:39 +0000
commit31f50b898ce632d5879bf5cd68c84fe2a5eaa87c (patch)
tree615afb9dff9bb860939009d0322695bc70df5e2f /java/plugins/src
parent9a9e2a2e84ccb329500960f680b22daf971e6fa4 (diff)
downloadqpid-python-31f50b898ce632d5879bf5cd68c84fe2a5eaa87c.tar.gz
rerun generate script when it is modified
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@578826 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/plugins/src')
-rw-r--r--java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java38
1 files changed, 24 insertions, 14 deletions
diff --git a/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
index 50af9c257e..85dffeb4bf 100644
--- a/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
+++ b/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());
}
}