summaryrefslogtreecommitdiff
path: root/qpid/java
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
commit79c053bee466285de59351981b9d178179ba36b1 (patch)
tree6a6d968d36735f539ecb4977faf75d4bf1f655d8 /qpid/java
parent172343d1aa61b96bd5fd6aec2504086e0b4d39d2 (diff)
downloadqpid-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')
-rw-r--r--qpid/java/common/pom.xml5
-rw-r--r--qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java38
2 files changed, 28 insertions, 15 deletions
diff --git a/qpid/java/common/pom.xml b/qpid/java/common/pom.xml
index 25f8550304..0d6e64b0e1 100644
--- a/qpid/java/common/pom.xml
+++ b/qpid/java/common/pom.xml
@@ -90,7 +90,10 @@
<param>org.apache.qpidity.transport</param>
<param>${specs.dir}/amqp.0-10-preview.xml</param>
</params>
- <source>${specs.dir}/amqp.0-10-preview.xml</source>
+ <sources>
+ <source>${specs.dir}/amqp.0-10-preview.xml</source>
+ <source>${basedir}/generate</source>
+ </sources>
<timestamp>${generated.path}/generated.timestamp</timestamp>
</configuration>
<goals>
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());
}
}