/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ @Deprecated public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
/** * Returns the root directories of all checked-out modules. * <p> * Some SCMs support checking out multiple modules into the same workspace. * In these cases, the returned array will have a length greater than one. * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws==null) return null; return getParent().getScm().getModuleRoots(ws, this); }
if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class)) return getModuleRoots(workspace);
public FilePath[] superGetModuleRoots(FilePath workspace, AbstractBuild build) { return super.getModuleRoots(workspace, build); }
public FilePath[] superGetModuleRoots(FilePath workspace) { return super.getModuleRoots(workspace); }
@Override public FilePath[] getModuleRoots(FilePath workspace, AbstractBuild build) { ArrayList<FilePath> paths = new ArrayList<FilePath>(); for(SCM scm : scms) { FilePath[] p = scm.getModuleRoots(workspace, build); for(FilePath p2 : p) paths.add(p2); } return paths.toArray(new FilePath[paths.size()]); }
/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ @Deprecated public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
/** * @deprecated as of 1.382. Use/derive from * {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class, getClass(), "getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it { return getModuleRoots(workspace, null); } // otherwise the default implementation return new FilePath[]{getModuleRoot(workspace),}; }
/** * @deprecated as of 1.382. * Use/derive from {@link #getModuleRoots(FilePath, AbstractBuild)} instead. */ public FilePath[] getModuleRoots(FilePath workspace) { if (Util.isOverridden(SCM.class,getClass(),"getModuleRoots", FilePath.class, AbstractBuild.class)) // if the subtype already derives newer getModuleRoots(FilePath,AbstractBuild), delegate to it return getModuleRoots(workspace,null); // otherwise the default implementation return new FilePath[] { getModuleRoot(workspace), }; }
private static String keyFor(@NonNull SCM scm, @NonNull FilePath ws, @Nullable AbstractBuild<?,?> build) { // JENKINS-12298 StringBuilder b = new StringBuilder(scm.getType()); for (FilePath root : scm.getModuleRoots(ws, build)) { b.append(root.getRemote().substring(ws.getRemote().length())); } return b.toString(); }
public static FilePath getModuleRoot(Run<?, ?> run, FilePath workspace) { FilePath moduleRoot = null; if (run instanceof AbstractBuild) { AbstractBuild<?, ?> build = (AbstractBuild<?, ?>) run; moduleRoot = build.getModuleRoot(); } else { // otherwise get the first module of the first SCM Object parent = run.getParent(); if (parent instanceof SCMTriggerItem) { SCMTriggerItem scmTrigger = (SCMTriggerItem) parent; Collection<? extends SCM> scms = scmTrigger.getSCMs(); if (!scms.isEmpty()) { SCM scm = scms.iterator().next(); FilePath[] moduleRoots = scm.getModuleRoots(workspace, null); moduleRoot = moduleRoots != null && moduleRoots.length > 0 ? moduleRoots[0] : null; } } if (moduleRoot == null) { moduleRoot = workspace; } } return moduleRoot; } }
/** * Returns the root directories of all checked-out modules. * <p> * Some SCMs support checking out multiple modules into the same workspace. * In these cases, the returned array will have a length greater than one. * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws==null) return null; return getParent().getScm().getModuleRoots(ws,this); }
@Override public FilePath[] getModuleRoots(FilePath workspace, AbstractBuild build) { initPython(); if (pexec.isImplemented(11)) { return (FilePath[]) pexec.execPython("get_module_roots", workspace, build); } else { return super.getModuleRoots(workspace, build); } }
/** * Returns the root directories of all checked-out modules. * <p> * Some SCMs support checking out multiple modules into the same workspace. * In these cases, the returned array will have a length greater than one. * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws==null) return null; return getParent().getScm().getModuleRoots(ws,this); }
/** * Returns the root directories of all checked-out modules. * <p> * Some SCMs support checking out multiple modules into the same workspace. * In these cases, the returned array will have a length greater than one. * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws==null) return null; return getParent().getScm().getModuleRoots(ws,this); }
/** * Returns the root directories of all checked-out modules. * <p> * Some SCMs support checking out multiple modules into the same workspace. * In these cases, the returned array will have a length greater than one. * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws==null) return null; return getParent().getScm().getModuleRoots(ws, this); }
@Override public FilePath[] getModuleRoots(FilePath workspace) { initPython(); if (pexec.isImplemented(12)) { return (FilePath[]) pexec.execPython("get_module_roots", workspace); } else { return super.getModuleRoots(workspace); } }
/** * Returns the root directories of all checked-out modules. <p> Some SCMs * support checking out multiple modules into the same workspace. In these * cases, the returned array will have a length greater than one. * * @return The roots of all modules checked out from the SCM. */ public FilePath[] getModuleRoots() { FilePath ws = getWorkspace(); if (ws == null) { return null; } return getParent().getScm().getModuleRoots(ws, this); }