summaryrefslogtreecommitdiff
path: root/qpid/java/tasks
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2010-04-26 14:33:24 +0000
committerMartin Ritchie <ritchiem@apache.org>2010-04-26 14:33:24 +0000
commit7b5de19ea6cdb4e4351c9b2116d84b26f4053462 (patch)
treeae82f7fa58e9a31b9f8cc10b99e0e9a25cd014c8 /qpid/java/tasks
parent8b62e0738891e73e4b09fb0b2be3080906738b7a (diff)
downloadqpid-python-7b5de19ea6cdb4e4351c9b2116d84b26f4053462.tar.gz
QPID-2530 : Updated build system to have a new findSubProjects macro in build.xml that will correctly locate and add all subprojects (those with a build.xml file) to the modules.plugin variable. This will correctly allow new plugins to be automatically picked up without any further build system changes.
To further simplify the build process and make better use of the module.depends option the build.deps file has been updated to contain only the libraries the module actually depends on. The dependant libraries due to a module.depends are now automatically pulled in by the build system. A further enhancement would be to do transitive dependencies, which would also allow dependencies to be built when in a sub module directory. e.g. client depends on common, but client.libs should not contain mina, common contains mina and so those libraries are pulled in via the fact that client's module.depends contains common. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@938059 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/tasks')
-rw-r--r--qpid/java/tasks/src/org/apache/qpid/tasks/Map.java31
-rw-r--r--qpid/java/tasks/src/org/apache/qpid/tasks/PropertyMapper.java30
2 files changed, 48 insertions, 13 deletions
diff --git a/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java b/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java
index e456b9e6ab..e66f34b319 100644
--- a/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java
+++ b/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java
@@ -21,16 +21,10 @@
package org.apache.qpid.tasks;
import org.apache.tools.ant.BuildException;
-
import org.apache.tools.ant.util.ChainedMapper;
import org.apache.tools.ant.util.FileNameMapper;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Map -- an ant task that allows arbitrary use of FileNameMappers
- **/
+/** Map -- an ant task that allows arbitrary use of FileNameMappers */
public class Map extends BaseTask {
@@ -75,14 +69,25 @@ public class Map extends BaseTask {
String[] parts = value.split(split);
StringBuffer buf = new StringBuffer();
- for (int i = 0; i < parts.length; i++) {
- if (parts[i].length() == 0) { continue; }
+ for (int i = 0; i < parts.length; i++)
+ {
+ if (parts[i].length() == 0)
+ {
+ continue;
+ }
String[] names = mapper.mapFileName(parts[i]);
- for (int j = 0; j < names.length; j++) {
- if (buf.length() > 0) {
- buf.append(join);
+
+ //Mappers can return null.
+ if (names != null)
+ {
+ for (int j = 0; j < names.length; j++)
+ {
+ if (buf.length() > 0)
+ {
+ buf.append(join);
+ }
+ buf.append(names[j]);
}
- buf.append(names[j]);
}
}
diff --git a/qpid/java/tasks/src/org/apache/qpid/tasks/PropertyMapper.java b/qpid/java/tasks/src/org/apache/qpid/tasks/PropertyMapper.java
new file mode 100644
index 0000000000..35f5af356c
--- /dev/null
+++ b/qpid/java/tasks/src/org/apache/qpid/tasks/PropertyMapper.java
@@ -0,0 +1,30 @@
+package org.apache.qpid.tasks;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.util.GlobPatternMapper;
+
+public class PropertyMapper extends GlobPatternMapper
+{
+
+ Project _project;
+
+ public PropertyMapper(Project project)
+ {
+ super();
+ _project = project;
+ }
+
+ public String[] mapFileName(String sourceFileName)
+ {
+ String[] fixed = super.mapFileName(sourceFileName);
+
+ if (fixed == null)
+ {
+ return null;
+ }
+
+ return new String[]{ _project.getProperty(fixed[0]) };
+ }
+
+
+} \ No newline at end of file