/** * Returns the workspace-dir path relative to buildfile-dir. * * @return the relative path for the workspace-dir */ protected String getWorkspaceRelativeDir() { String result; if (fBuildfileDir.startsWith(fWorkspaceDir + File.separator)) { int lastSlash= fWorkspaceDir.length(); result= "${dir.buildfile}" + File.separator + ".."; //$NON-NLS-1$ //$NON-NLS-2$ lastSlash= fBuildfileDir.indexOf(File.separator, lastSlash + 1); while (lastSlash != -1) { result+= File.separator + ".."; //$NON-NLS-1$ lastSlash= fBuildfileDir.indexOf(File.separator, lastSlash + 1); } } else { result= new PathSubstituter() .addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE) .substitute(fWorkspaceDir); } result= result.replace(File.separatorChar, '/'); return result; }
/** * Returns the workspace-dir path relative to buildfile-dir. * * @return the relative path for the workspace-dir */ protected String getWorkspaceRelativeDir() { String result; if (fBuildfileDir.startsWith(fWorkspaceDir + File.separator)) { int lastSlash= fWorkspaceDir.length(); result= "${dir.buildfile}" + File.separator + ".."; //$NON-NLS-1$ //$NON-NLS-2$ lastSlash= fBuildfileDir.indexOf(File.separator, lastSlash + 1); while (lastSlash != -1) { result+= File.separator + ".."; //$NON-NLS-1$ lastSlash= fBuildfileDir.indexOf(File.separator, lastSlash + 1); } } else { result= new PathSubstituter() .addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE) .substitute(fWorkspaceDir); } result= result.replace(File.separatorChar, '/'); return result; }
fAbsJarfile= jarLocation; fAntScriptLocation= antScriptLocation; pathSubstituter= new PathSubstituter(); try { fBuildfileDir= antScriptLocation.toFile().getParentFile().getCanonicalPath();
fAbsJarfile= jarLocation; fAntScriptLocation= antScriptLocation; pathSubstituter= new PathSubstituter(); try { fBuildfileDir= antScriptLocation.toFile().getParentFile().getCanonicalPath();
/** * Returns jarfile-dir path relative to buildfile-dir or workspace-dir. * * @return the relative path for the jarfile-dir */ protected String getJarfileRelativeDir() { String result= new PathSubstituter() .addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE) .addSubstitution(fWorkspaceDir, ANT_PROPERTY_DIR_WORKSPACE) .substitute(fJarfileDir); result= result.replace(File.separatorChar, '/'); return result; }
/** * Returns jarfile-dir path relative to buildfile-dir or workspace-dir. * * @return the relative path for the jarfile-dir */ protected String getJarfileRelativeDir() { String result= new PathSubstituter() .addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE) .addSubstitution(fWorkspaceDir, ANT_PROPERTY_DIR_WORKSPACE) .substitute(fJarfileDir); result= result.replace(File.separatorChar, '/'); return result; }