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 class
IvyBuildList.BuildListModule
static class
IvyBuildList.OnMissingDescriptor
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<org.apache.tools.ant.types.FileSet>
buildFileSets
private java.lang.String
delimiter
static java.lang.String
DESCRIPTOR_REQUIRED
private boolean
excludeLeaf
private boolean
excludeRoot
private boolean
haltOnError
private java.lang.String
ivyFilePath
private java.lang.String
leaf
private java.util.List<IvyBuildList.BuildListModule>
leafs
private boolean
onlydirectdep
private java.lang.String
onMissingDescriptor
private java.lang.String
reference
private java.lang.String
restartFrom
private boolean
reverse
private java.lang.String
root
private 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 void
addBuildFile(org.apache.tools.ant.types.Path path, java.io.File buildFile)
void
addFileset(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.BuildListModule
createLeaf()
IvyBuildList.BuildListModule
createRoot()
void
doExecute()
The real logic of task execution after project has been set in the context.private java.lang.String
extractModuleNames(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.String
getDelimiter()
private java.io.File
getIvyFileFor(java.io.File buildFile)
java.lang.String
getIvyfilepath()
java.lang.String
getLeaf()
boolean
getOnlydirectdep()
java.lang.String
getOnMissingDescriptor()
java.lang.String
getReference()
java.lang.String
getRestartFrom()
java.lang.String
getRoot()
boolean
isExcludeLeaf()
boolean
isExcludeRoot()
boolean
isHaltonerror()
boolean
isReverse()
boolean
isSkipbuildwithoutivy()
Deprecated.usegetOnMissingDescriptor()
instead.private void
onMissingDescriptor(java.io.File buildFile, java.io.File ivyFile, java.util.List<java.io.File> noDescriptor)
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.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)void
setDelimiter(java.lang.String delimiter)
void
setExcludeLeaf(boolean excludeLeaf)
void
setExcludeRoot(boolean root)
void
setHaltonerror(boolean haltOnError)
void
setIvyfilepath(java.lang.String ivyFilePath)
void
setLeaf(java.lang.String leaf)
void
setOnlydirectdep(boolean onlydirectdep)
void
setOnMissingDescriptor(java.lang.String onMissingDescriptor)
void
setReference(java.lang.String reference)
void
setRestartFrom(java.lang.String restartFrom)
void
setReverse(boolean reverse)
void
setRoot(java.lang.String root)
void
setSkipbuildwithoutivy(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.BuildException
Description copied from class:IvyTask
The 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)
-
-