/** * 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; }
try { fBuildfileDir= antScriptLocation.toFile().getParentFile().getCanonicalPath(); pathSubstituter.addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE); } catch (Exception e) { JavaPlugin.log(e); pathSubstituter.addSubstitution(fJarfileDir, ANT_PROPERTY_DIR_JARFILE); } catch (Exception e) { JavaPlugin.log(e); pathSubstituter.addSubstitution(fWorkspaceDir, ANT_PROPERTY_DIR_WORKSPACE); } catch (Exception e) { JavaPlugin.log(e);
try { fBuildfileDir= antScriptLocation.toFile().getParentFile().getCanonicalPath(); pathSubstituter.addSubstitution(fBuildfileDir, ANT_PROPERTY_DIR_BUILDFILE); } catch (Exception e) { JavaPlugin.log(e); pathSubstituter.addSubstitution(fJarfileDir, ANT_PROPERTY_DIR_JARFILE); } catch (Exception e) { JavaPlugin.log(e); pathSubstituter.addSubstitution(fWorkspaceDir, ANT_PROPERTY_DIR_WORKSPACE); } catch (Exception e) { JavaPlugin.log(e);
/** * 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; }