summaryrefslogtreecommitdiffstats
path: root/src/java/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-06-10 21:56:01 +0200
committerSven Gothel <[email protected]>2011-06-10 21:56:01 +0200
commit5d2f5413ded6de3acf87c5799b98a6482041ba1a (patch)
tree90dd071d1c9a2bfa7e6f1e2c0ff0a3a6f8d788c5 /src/java/com
parent1d614e360b2018c7f4b70ebf2c9322cae5cc9c7f (diff)
Gluegen AntTask: 'literalInclude' may contain multiple directories, separated by comma (enhancement)
Diffstat (limited to 'src/java/com')
-rw-r--r--src/java/com/jogamp/gluegen/ant/GlueGenTask.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/java/com/jogamp/gluegen/ant/GlueGenTask.java b/src/java/com/jogamp/gluegen/ant/GlueGenTask.java
index df1d587..fc3a0ca 100644
--- a/src/java/com/jogamp/gluegen/ant/GlueGenTask.java
+++ b/src/java/com/jogamp/gluegen/ant/GlueGenTask.java
@@ -42,6 +42,7 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.StringTokenizer;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
@@ -68,7 +69,7 @@ import org.apache.tools.ant.util.JavaEnvUtils;
includes="[optional directory pattern of include files to include]"
excludes="[optional directory pattern of include files to exclude]"
includeRefid="[optional FileSet or DirSet for include files]"
- literalInclude="[optional hack to get around FileSet / DirSet issues with different drives]"
+ literalInclude="[optional comma separated list of literal include directories, avoiding limitations of FileSet / DirSet issues]"
emitter="[emitter class name]"
config="[configuration file]"
dumpCPP="[optional boolean]"
@@ -145,12 +146,13 @@ public class GlueGenTask extends Task
private List setOfIncludeSets = new LinkedList();
/**
- * <p>A single literal directory to include. This is to get around the
+ * <p>Comma separated list of literal directories to include. This is to get around the
* fact that neither {@link org.apache.tools.ant.types.FileSet} nor
* {@link org.apache.tools.ant.types.DirSet} can handle multiple drives in
- * a sane manner. If <code>null</code> then it has not been specified.</p>
+ * a sane manner or deal with relative path outside of the base-dir.
+ * If <code>null</code> then it has not been specified.</p>
*/
- private String literalInclude;
+ private String literalIncludes;
// =========================================================================
/**
@@ -234,14 +236,14 @@ public class GlueGenTask extends Task
}
/**
- * <p>Set a single literal include directory. See the <code>literalInclude</code>
+ * <p>Set a literal include directories, separated with a comma. See the <code>literalInclude</code>
* javadoc for more information.</p>
*
- * @param directory the directory to include
+ * @param commaSeparatedIncludes the comma separated directories to include
*/
- public void setLiteralInclude(String directory)
+ public void setLiteralInclude(String commaSeparatedIncludes)
{
- this.literalInclude = directory;
+ this.literalIncludes = commaSeparatedIncludes.trim();
}
/**
@@ -515,8 +517,15 @@ public class GlueGenTask extends Task
// if literalInclude is valid then add it to the list of included
// directories
- if(isValid(literalInclude))
- includedDirectories.add(literalInclude);
+ if( isValid( literalIncludes ) ) {
+ final String[] includes = literalIncludes.split(",");
+ for(int i=0; i<includes.length; i++) {
+ final String include = includes[i].trim();
+ if( include.length()>0 ) {
+ includedDirectories.add(include);
+ }
+ }
+ }
// add the included directories to the command
for(Iterator includes=includedDirectories.iterator(); includes.hasNext(); )