|
[Ant-contrib-developers] CVS: ant-contrib/src/net/sf/antcontrib/walls CompileWithWalls.java,1.6,1.7
From: Dean Hiller <deanhiller@us...> - 2003-11-23 21:56
|
Update of /cvsroot/ant-contrib/ant-contrib/src/net/sf/antcontrib/walls
In directory sc8-pr-cvs1:/tmp/cvs-serv28829/src/net/sf/antcontrib/walls
Modified Files:
CompileWithWalls.java
Log Message:
fix classpath of javac being ignored, such that jars are imported again correctly.
Index: CompileWithWalls.java
===================================================================
RCS file: /cvsroot/ant-contrib/ant-contrib/src/net/sf/antcontrib/walls/CompileWithWalls.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** CompileWithWalls.java 23 Nov 2003 15:06:37 -0000 1.6
--- CompileWithWalls.java 23 Nov 2003 21:56:09 -0000 1.7
***************
*** 165,168 ****
--- 165,169 ----
File destDir = javac.getDestdir();
Path src = javac.getSrcdir();
+
if(src == null)
throw new BuildException("Javac inside compilewithwalls must have a srcdir specified");
***************
*** 178,181 ****
--- 179,193 ----
getLocation());
File srcDir = getProject().resolveFile(list[0]);
+
+ String[] classpaths = javac.getClasspath().list();
+ File temp = null;
+ for(int i = 0; i < classpaths.length; i++) {
+ temp = new File(classpaths[i]);
+ if(temp.isDirectory()) {
+ if(srcDir.compareTo(temp) == 0)
+ throw new BuildException("The classpath cannot contain the src directory, but it does. srcdir="+srcDir);
+ }
+ }
+
if (!srcDir.exists()) {
throw new BuildException(
***************
*** 216,221 ****
copyFiles(srcDir, buildSpace, javaIncludes);
- Path classPath = toCompile.getClasspath(tempBuildDir, getProject());
Path srcDir2 = toCompile.getSrcPath(tempBuildDir, getProject());
//unfortunately, we cannot clear the SrcDir in Javac, so we have to clone
--- 228,234 ----
copyFiles(srcDir, buildSpace, javaIncludes);
Path srcDir2 = toCompile.getSrcPath(tempBuildDir, getProject());
+ Path classPath = toCompile.getClasspath(tempBuildDir, getProject());
+ classPath.addExisting(javac.getClasspath());
//unfortunately, we cannot clear the SrcDir in Javac, so we have to clone
***************
*** 225,232 ****
//date.
Javac buildSpaceJavac = new Javac();
! log("Compiling package " + toCompile.getPackage()
! +"\nsourceDir="+srcDir2
! +"\nclassPath="+classPath
! +"\ndestDir="+buildSpace);
buildSpaceJavac.setSrcdir(srcDir2);
buildSpaceJavac.setDestdir(buildSpace);
--- 238,245 ----
//date.
Javac buildSpaceJavac = new Javac();
! log(toCompile.getPackage()+": Compiling");
! log(toCompile.getPackage()+": sourceDir="+srcDir2, Project.MSG_VERBOSE);
! log(toCompile.getPackage()+": classPath="+classPath, Project.MSG_VERBOSE);
! log(toCompile.getPackage()+": destDir="+buildSpace, Project.MSG_VERBOSE);
buildSpaceJavac.setSrcdir(srcDir2);
buildSpaceJavac.setDestdir(buildSpace);
|
| Thread | Author | Date |
|---|---|---|
| [Ant-contrib-developers] CVS: ant-contrib/src/net/sf/antcontrib/walls CompileWithWalls.java,1.6,1.7 | Dean Hiller <deanhiller@us...> |