Package org.apache.ivy.ant
Class IvyBuildList
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.ivy.ant.IvyTask
-
- org.apache.ivy.ant.IvyBuildList
-
- All Implemented Interfaces:
java.lang.Cloneable
public class IvyBuildList extends IvyTask
Creates an ant filelist of files (usually build.xml) ordered according to the dependencies declared in ivy files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIvyBuildList.BuildListModulestatic classIvyBuildList.OnMissingDescriptor
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<org.apache.tools.ant.types.FileSet>buildFileSetsprivate java.lang.Stringdelimiterstatic java.lang.StringDESCRIPTOR_REQUIREDprivate booleanexcludeLeafprivate booleanexcludeRootprivate booleanhaltOnErrorprivate java.lang.StringivyFilePathprivate java.lang.Stringleafprivate java.util.List<IvyBuildList.BuildListModule>leafsprivate booleanonlydirectdepprivate java.lang.StringonMissingDescriptorprivate java.lang.Stringreferenceprivate java.lang.StringrestartFromprivate booleanreverseprivate java.lang.Stringrootprivate java.util.List<IvyBuildList.BuildListModule>roots-
Fields inherited from class org.apache.ivy.ant.IvyTask
ANT_PROJECT_CONTEXT_KEY
-
-
Constructor Summary
Constructors Constructor Description IvyBuildList()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidaddBuildFile(org.apache.tools.ant.types.Path path, java.io.File buildFile)voidaddFileset(org.apache.tools.ant.types.FileSet buildFiles)private java.util.Set<MapMatcher>convert(java.util.List<IvyBuildList.BuildListModule> modulesList, java.lang.String modulesString, IvySettings settings)IvyBuildList.BuildListModulecreateLeaf()IvyBuildList.BuildListModulecreateRoot()voiddoExecute()The real logic of task execution after project has been set in the context.private java.lang.StringextractModuleNames(java.util.Set<MapMatcher> matchers)private java.util.Collection<ModuleDescriptor>filterModulesFromLeaf(java.util.Collection<ModuleDescriptor> mds, java.util.List<ModuleDescriptor> leafmds)Returns a collection of ModuleDescriptors that are contained in the input collection of ModuleDescriptors which depends on the leaf moduleprivate java.util.Collection<ModuleDescriptor>filterModulesFromRoot(java.util.Collection<ModuleDescriptor> mds, java.util.List<ModuleDescriptor> rootmds)Returns a collection of ModuleDescriptors that are contained in the input collection of ModuleDescriptors and upon which the root module dependsprivate java.util.List<ModuleDescriptor>findModuleDescriptors(java.util.Collection<ModuleDescriptor> mds, java.util.Set<MapMatcher> matchers, java.lang.String kind)java.lang.StringgetDelimiter()private java.io.FilegetIvyFileFor(java.io.File buildFile)java.lang.StringgetIvyfilepath()java.lang.StringgetLeaf()booleangetOnlydirectdep()java.lang.StringgetOnMissingDescriptor()java.lang.StringgetReference()java.lang.StringgetRestartFrom()java.lang.StringgetRoot()booleanisExcludeLeaf()booleanisExcludeRoot()booleanisHaltonerror()booleanisReverse()booleanisSkipbuildwithoutivy()Deprecated.usegetOnMissingDescriptor()instead.private voidonMissingDescriptor(java.io.File buildFile, java.io.File ivyFile, java.util.List<java.io.File> noDescriptor)private voidprocessFilterNodeFromLeaf(ModuleDescriptor node, java.util.Set<ModuleDescriptor> toKeep, java.util.Map<ModuleId,ModuleDescriptor> moduleIdMap)Search in the moduleIdMap modules depending on node, add them to the toKeep set and process them recursively.private voidprocessFilterNodeFromRoot(ModuleDescriptor node, java.util.Set<ModuleDescriptor> toKeep, java.util.Map<ModuleId,ModuleDescriptor> moduleIdMap)Adds the current node to the toKeep collection and then processes the each of the direct dependencies of this node that appear in the moduleIdMap (indicating that the dependency is part of this BuildList)voidsetDelimiter(java.lang.String delimiter)voidsetExcludeLeaf(boolean excludeLeaf)voidsetExcludeRoot(boolean root)voidsetHaltonerror(boolean haltOnError)voidsetIvyfilepath(java.lang.String ivyFilePath)voidsetLeaf(java.lang.String leaf)voidsetOnlydirectdep(boolean onlydirectdep)voidsetOnMissingDescriptor(java.lang.String onMissingDescriptor)voidsetReference(java.lang.String reference)voidsetRestartFrom(java.lang.String restartFrom)voidsetReverse(boolean reverse)voidsetRoot(java.lang.String root)voidsetSkipbuildwithoutivy(boolean skipBuildFilesWithoutIvy)Deprecated.usesetOnMissingDescriptor(String)instead.-
Methods inherited from class org.apache.ivy.ant.IvyTask
cacheAttributeNotSupported, doValidate, execute, finalizeTask, getIvyInstance, getProperty, getProperty, getProperty, getProperty, getPubDate, getResolvedConfigurations, getResolvedDescriptor, getResolvedDescriptor, getResolvedDescriptor, getResolvedDescriptor, getResolvedReport, getSettings, getSettingsRef, isValidate, mergeConfs, prepareTask, setResolved, setResolved, setSettingsRef, setValidate, splitConfs, toString
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Field Detail
-
DESCRIPTOR_REQUIRED
public static final java.lang.String DESCRIPTOR_REQUIRED
- See Also:
- Constant Field Values
-
buildFileSets
private java.util.List<org.apache.tools.ant.types.FileSet> buildFileSets
-
reference
private java.lang.String reference
-
haltOnError
private boolean haltOnError
-
onMissingDescriptor
private java.lang.String onMissingDescriptor
-
reverse
private boolean reverse
-
ivyFilePath
private java.lang.String ivyFilePath
-
root
private java.lang.String root
-
roots
private java.util.List<IvyBuildList.BuildListModule> roots
-
excludeRoot
private boolean excludeRoot
-
leaf
private java.lang.String leaf
-
leafs
private java.util.List<IvyBuildList.BuildListModule> leafs
-
delimiter
private java.lang.String delimiter
-
excludeLeaf
private boolean excludeLeaf
-
onlydirectdep
private boolean onlydirectdep
-
restartFrom
private java.lang.String restartFrom
-
-
Method Detail
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet buildFiles)
-
getReference
public java.lang.String getReference()
-
setReference
public void setReference(java.lang.String reference)
-
getRoot
public java.lang.String getRoot()
-
setRoot
public void setRoot(java.lang.String root)
-
createRoot
public IvyBuildList.BuildListModule createRoot()
-
isExcludeRoot
public boolean isExcludeRoot()
-
setExcludeRoot
public void setExcludeRoot(boolean root)
-
getLeaf
public java.lang.String getLeaf()
-
setLeaf
public void setLeaf(java.lang.String leaf)
-
createLeaf
public IvyBuildList.BuildListModule createLeaf()
-
isExcludeLeaf
public boolean isExcludeLeaf()
-
setExcludeLeaf
public void setExcludeLeaf(boolean excludeLeaf)
-
getDelimiter
public java.lang.String getDelimiter()
-
setDelimiter
public void setDelimiter(java.lang.String delimiter)
-
getOnlydirectdep
public boolean getOnlydirectdep()
-
setOnlydirectdep
public void setOnlydirectdep(boolean onlydirectdep)
-
doExecute
public void doExecute() throws org.apache.tools.ant.BuildExceptionDescription copied from class:IvyTaskThe real logic of task execution after project has been set in the context. MUST be implemented by subclasses
-
convert
private java.util.Set<MapMatcher> convert(java.util.List<IvyBuildList.BuildListModule> modulesList, java.lang.String modulesString, IvySettings settings)
-
onMissingDescriptor
private void onMissingDescriptor(java.io.File buildFile, java.io.File ivyFile, java.util.List<java.io.File> noDescriptor)
-
findModuleDescriptors
private java.util.List<ModuleDescriptor> findModuleDescriptors(java.util.Collection<ModuleDescriptor> mds, java.util.Set<MapMatcher> matchers, java.lang.String kind)
-
extractModuleNames
private java.lang.String extractModuleNames(java.util.Set<MapMatcher> matchers)
-
filterModulesFromRoot
private java.util.Collection<ModuleDescriptor> filterModulesFromRoot(java.util.Collection<ModuleDescriptor> mds, java.util.List<ModuleDescriptor> rootmds)
Returns a collection of ModuleDescriptors that are contained in the input collection of ModuleDescriptors and upon which the root module depends- Parameters:
mds- input collection of ModuleDescriptorsrootmds- root module- Returns:
- filtered list of modules
-
processFilterNodeFromRoot
private void processFilterNodeFromRoot(ModuleDescriptor node, java.util.Set<ModuleDescriptor> toKeep, java.util.Map<ModuleId,ModuleDescriptor> moduleIdMap)
Adds the current node to the toKeep collection and then processes the each of the direct dependencies of this node that appear in the moduleIdMap (indicating that the dependency is part of this BuildList)- Parameters:
node- the node to be processedtoKeep- the set of ModuleDescriptors that should be keptmoduleIdMap- reference mapping of moduleId to ModuleDescriptor that are part of the BuildList
-
filterModulesFromLeaf
private java.util.Collection<ModuleDescriptor> filterModulesFromLeaf(java.util.Collection<ModuleDescriptor> mds, java.util.List<ModuleDescriptor> leafmds)
Returns a collection of ModuleDescriptors that are contained in the input collection of ModuleDescriptors which depends on the leaf module- Parameters:
mds- input collection of ModuleDescriptorsleafmds- leaf module- Returns:
- filtered list of modules
-
processFilterNodeFromLeaf
private void processFilterNodeFromLeaf(ModuleDescriptor node, java.util.Set<ModuleDescriptor> toKeep, java.util.Map<ModuleId,ModuleDescriptor> moduleIdMap)
Search in the moduleIdMap modules depending on node, add them to the toKeep set and process them recursively.- Parameters:
node- the node to be processedtoKeep- the set of ModuleDescriptors that should be keptmoduleIdMap- reference mapping of moduleId to ModuleDescriptor that are part of the BuildList
-
addBuildFile
private void addBuildFile(org.apache.tools.ant.types.Path path, java.io.File buildFile)
-
getIvyFileFor
private java.io.File getIvyFileFor(java.io.File buildFile)
-
isHaltonerror
public boolean isHaltonerror()
-
setHaltonerror
public void setHaltonerror(boolean haltOnError)
-
getIvyfilepath
public java.lang.String getIvyfilepath()
-
setIvyfilepath
public void setIvyfilepath(java.lang.String ivyFilePath)
-
getOnMissingDescriptor
public java.lang.String getOnMissingDescriptor()
-
setOnMissingDescriptor
public void setOnMissingDescriptor(java.lang.String onMissingDescriptor)
-
isSkipbuildwithoutivy
@Deprecated public boolean isSkipbuildwithoutivy()
Deprecated.usegetOnMissingDescriptor()instead.- Returns:
- boolean
-
setSkipbuildwithoutivy
@Deprecated public void setSkipbuildwithoutivy(boolean skipBuildFilesWithoutIvy)
Deprecated.usesetOnMissingDescriptor(String)instead.- Parameters:
skipBuildFilesWithoutIvy- boolean
-
isReverse
public boolean isReverse()
-
setReverse
public void setReverse(boolean reverse)
-
getRestartFrom
public java.lang.String getRestartFrom()
-
setRestartFrom
public void setRestartFrom(java.lang.String restartFrom)
-
-