private boolean isFreeStyleProjectAndHasCustomWorkspace(@SuppressWarnings("unchecked") AbstractProject project) { if (project instanceof FreeStyleProject) { FreeStyleProject fsProject = (FreeStyleProject) project; return StringUtils.isNotEmpty(fsProject.getCustomWorkspace()); } else { return false; } }
/** * Gets the customWorkspace of the owner project. * * Support for FreeStyleProject only. * @return customWorkspace */ @CheckForNull public String getCustomWorkspace() { AbstractProject<?, ?> p = getOwner(); if (p instanceof FreeStyleProject) return ((FreeStyleProject) p).getCustomWorkspace(); return null; }
if(freeStyleProject.getCustomWorkspace() != null && freeStyleProject.getCustomWorkspace().length() > 0) { projectWorkspaceOnMaster = new FilePath(new File(freeStyleProject.getCustomWorkspace()));
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. { return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); } return super.decideWorkspace(n, wsl); } }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); return super.decideWorkspace(n,wsl); } }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); return super.decideWorkspace(n,wsl); } }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException { String customWorkspace = getProject().getCustomWorkspace(); if (customWorkspace != null) // we allow custom workspaces to be concurrently used between jobs. return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace))); return super.decideWorkspace(n,wsl); } }
FilePath workspace; if (isFreeStyleProjectAndHasCustomWorkspace(project)) { workspace = new FilePath(launcher.getChannel(), ((FreeStyleProject) project).getCustomWorkspace()); } else { if (build.getBuiltOn() == hudson) {