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 | 31f50b898ce632d5879bf5cd68c84fe2a5eaa87c (patch) | |
tree | 615afb9dff9bb860939009d0322695bc70df5e2f | |
parent | 9a9e2a2e84ccb329500960f680b22daf971e6fa4 (diff) | |
download | qpid-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
-rw-r--r-- | java/common/pom.xml | 5 | ||||
-rw-r--r-- | java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java | 38 |
2 files changed, 28 insertions, 15 deletions
diff --git a/java/common/pom.xml b/java/common/pom.xml index 25f8550304..0d6e64b0e1 100644 --- a/java/common/pom.xml +++ b/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/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()); } } |