From 5d2f5413ded6de3acf87c5799b98a6482041ba1a Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Fri, 10 Jun 2011 21:56:01 +0200
Subject: Gluegen AntTask: 'literalInclude' may contain multiple directories,
separated by comma (enhancement)
---
src/java/com/jogamp/gluegen/ant/GlueGenTask.java | 29 ++++++++++++++++--------
1 file changed, 19 insertions(+), 10 deletions(-)
(limited to 'src/java')
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();
/**
- * A single literal directory to include. This is to get around the
+ *
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 null
then it has not been specified.
+ * a sane manner or deal with relative path outside of the base-dir.
+ * If null
then it has not been specified.
*/
- private String literalInclude;
+ private String literalIncludes;
// =========================================================================
/**
@@ -234,14 +236,14 @@ public class GlueGenTask extends Task
}
/**
- * Set a single literal include directory. See the literalInclude
+ *
Set a literal include directories, separated with a comma. See the literalInclude
* javadoc for more information.
*
- * @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; i0 ) {
+ includedDirectories.add(include);
+ }
+ }
+ }
// add the included directories to the command
for(Iterator includes=includedDirectories.iterator(); includes.hasNext(); )
--
cgit v1.2.3