diff options
author | Sven Gothel <[email protected]> | 2010-03-25 13:07:58 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-03-25 13:07:58 +0100 |
commit | 3a32650d4229f9b4ad1f527d9e30c24ddb69bb3f (patch) | |
tree | b60ea7924b346924b754be03e5467fc62a7dbe1e /test/junit/com/sun/gluegen/BuildUtil.java | |
parent | e6288285daf2e2fc16980cd74190e46aad5464be (diff) |
http://www.jogamp.org/bugzilla/show_bug.cgi?id=390
The current junit tests use a fixed 'build' sub-path,
not the customizing 'rootrel.build' path.
More properties needs to be passed through (ant -> junit -> ant)
to comply with the current build system:
* rootrel.build
* os.arch
* gluegen.user.compiler.file
Fixed ..
However .. since even more properties may influence the build,
a more native solution with just plain 'ant' might be more desireable ..
Diffstat (limited to 'test/junit/com/sun/gluegen/BuildUtil.java')
-rw-r--r-- | test/junit/com/sun/gluegen/BuildUtil.java | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/test/junit/com/sun/gluegen/BuildUtil.java b/test/junit/com/sun/gluegen/BuildUtil.java index de4f8e2..4477d7b 100644 --- a/test/junit/com/sun/gluegen/BuildUtil.java +++ b/test/junit/com/sun/gluegen/BuildUtil.java @@ -17,7 +17,8 @@ public final class BuildUtil { public static final String gluegenRoot; public static final String path; - public static final String output; + public static final String testOutput; + public static final String rootrel_build; static { @@ -25,6 +26,13 @@ public final class BuildUtil { out.println("OS: " + System.getProperty("os.name")); out.println("VM: " + System.getProperty("java.vm.name")); + String rootrel_build_tmp = System.getProperty("rootrel.build"); + if(null==rootrel_build_tmp || rootrel_build_tmp.length()==0) { + rootrel_build_tmp = "build" ; + } + rootrel_build = rootrel_build_tmp; + out.println("rootrel.build: " + rootrel_build); + // setup paths try { File executionRoot = new File(BuildUtil.class.getProtectionDomain().getCodeSource().getLocation().toURI()); @@ -36,10 +44,10 @@ public final class BuildUtil { } path = gluegenRoot + "/test/junit/com/sun/gluegen"; - output = gluegenRoot + "/build/test"; + testOutput = gluegenRoot + "/" + rootrel_build + "/test"; out.println("path: "+path); - out.println("output: "+output); + out.println("testOutput: "+testOutput); out.println(" - - - - - - - - - - - - "); cleanGeneratedFiles(); @@ -47,6 +55,9 @@ public final class BuildUtil { //setup ant build file project = new Project(); project.setBaseDir(new File(gluegenRoot)); + project.setProperty("rootrel.build", rootrel_build); + passSystemProperty(project, "gluegen.user.compiler.file"); + passSystemProperty(project, "os.arch"); DefaultLogger logger = new DefaultLogger(); logger.setErrorPrintStream(out); @@ -64,9 +75,17 @@ public final class BuildUtil { ProjectHelper.configureProject(project, buildFile); } + public static Project passSystemProperty(Project p, String name) { + String tmp = System.getProperty(name); + if(null!=tmp && tmp.length()>0) { + p.setProperty(name, tmp); + } + return p; + } + public static void cleanGeneratedFiles() { out.println("cleaning generated files"); - deleteDirectory(new File(output+"/gensrc")); + deleteDirectory(new File(testOutput+"/gensrc")); out.println("done"); } @@ -95,7 +114,7 @@ public final class BuildUtil { out.println("generate binding: " + bindingName); GlueGen.main( "-I"+path, - "-O"+output+"/gensrc", + "-O"+testOutput+"/gensrc", // "-Ecom.sun.gluegen.DebugEmitter", "-C"+path+"/"+bindingName+".cfg", path+"/"+bindingName+".h" ); |