private boolean isDescendantOf(String path, MavenModule mod) { return FilenameUtils.separatorsToUnix(path).startsWith(normalizePath(mod.getRelativePath())); } };
/** * Computes the list of {@link MavenModule}s that are 'under' this POM filesystem-wise. The list doens't include * this module itself. * * <p> * Note that this doesn't necessary has anything to do with the module inheritance structure or parent/child * relationship of the POM. */ public List<MavenModule> getSubsidiaries() { List<MavenModule> r = new ArrayList<MavenModule>(); for (MavenModule mm : getParent().getModules()) if(mm!=this && mm.getRelativePath().startsWith(getRelativePath())) r.add(mm); return r; }
/** * Computes the list of {@link MavenModule}s that are 'under' this POM filesystem-wise. The list doens't include * this module itself. * * <p> * Note that this doesn't necessary has anything to do with the module inheritance structure or parent/child * relationship of the POM. */ public List<MavenModule> getSubsidiaries() { List<MavenModule> r = new ArrayList<MavenModule>(); for (MavenModule mm : getParent().getModules()) if(mm!=this && mm.getRelativePath().startsWith(getRelativePath())) r.add(mm); return r; }
private boolean belongsToSubsidiary(List<MavenModule> subsidiaries, String path) { for (MavenModule sub : subsidiaries) if (FilenameUtils.separatorsToUnix(path).startsWith(FilenameUtils.normalize(sub.getRelativePath()))) return true; return false; }
/** * for debug purpose */ public String toString() { return super.toString()+'['+getFullName()+']'+"[relativePath:"+getRelativePath()+']'; }
/** * for debug purpose */ public String toString() { return super.toString()+'['+getFullName()+']'+"[relativePath:"+getRelativePath()+']'; }
/** * Does this change happen somewhere in the given module or its descendants? */ private boolean isDescendantOf(ChangeLogSet.Entry e, MavenModule mod) { for (String path : e.getAffectedPaths()) { if (FilenameUtils.separatorsToUnix(path).startsWith(FilenameUtils.normalize(mod.getRelativePath()))) return true; } return false; } };
/** * Retrieve the relative path to the pom of the module */ private String getRelativePomPath(MavenModule mavenModule, MavenModuleSetBuild mavenBuild) { String relativePath = mavenModule.getRelativePath(); if (StringUtils.isBlank(relativePath)) { return POM_NAME; } // If this is the root module, return the root pom path. if (mavenModule.getModuleName().toString(). equals(mavenBuild.getProject().getRootModule().getModuleName().toString())) { return mavenBuild.getProject().getRootPOM(null); } // to remove the project folder name if exists // keeps only the name of the module String modulePath = relativePath.substring(relativePath.indexOf("/") + 1); for (String moduleName : mavenModules) { if (moduleName.contains(modulePath)) { return createPomPath(relativePath, moduleName); } } // In case this module is not in the parent pom return relativePath + "/" + POM_NAME; }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws InterruptedException, IOException { return wsl.allocate(getModuleSetBuild().getModuleRoot().child(getProject().getRelativePath())); }
@Override protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws InterruptedException, IOException { return wsl.allocate(getModuleSetBuild().getModuleRoot().child(getProject().getRelativePath())); }
mb.setWorkspace(getModuleRoot().child(m.getRelativePath())); proxies.put(moduleName, mb.new ProxyImpl2(MavenModuleSetBuild.this,slistener));
mb.setWorkspace(getModuleRoot().child(m.getRelativePath())); proxies.put(m.getModuleName(), mb.new ProxyImpl2(MavenModuleSetBuild.this,slistener));