Index: nbbuild/antsrc/org/netbeans/nbbuild/GetModuleName.java =================================================================== RCS file: /cvs/nbbuild/antsrc/org/netbeans/nbbuild/GetModuleName.java,v retrieving revision 1.4 diff -u -r1.4 GetModuleName.java --- nbbuild/antsrc/org/netbeans/nbbuild/GetModuleName.java 9 Mar 2004 13:07:17 -0000 1.4 +++ nbbuild/antsrc/org/netbeans/nbbuild/GetModuleName.java 10 Mar 2004 09:20:46 -0000 @@ -40,12 +40,23 @@ if (root == null) throw new BuildException("You must set the root dir", this.getLocation()); try { - String basedir = this.getProject().getBaseDir().getCanonicalPath(); + File dir = this.getProject ().getBaseDir (); String rootdir = root.getCanonicalPath(); - log("Basedir: " + basedir + " rootdir: " + rootdir); - if (!basedir.startsWith(rootdir)) throw new BuildException( "This module in on different path than the root dir",this.getLocation()); - String modulename = basedir.substring(rootdir.length() + 1).replace(File.separatorChar,'/'); - this.getProject().setProperty( name, modulename); + StringBuffer modulename = new StringBuffer (); + while (dir != null) { + if (dir.getCanonicalPath ().equals (rootdir)) { + break; + } + if (modulename.length () > 0) { + modulename.insert (0, '/'); + } + modulename.insert (0, dir.getName ()); + dir = dir.getParentFile (); + } + + //log("Basedir: " + basedir + " rootdir: " + rootdir); + if (dir == null) throw new BuildException( "This module in on different path than the root dir",this.getLocation()); + this.getProject().setProperty( name, modulename.toString ()); } catch (IOException ex) { throw new BuildException("Root dir or module's base dir wasn't recognized", ex, this.getLocation());