org.carrot2.ant.deps
Class ComponentDependency

java.lang.Object
  extended by org.carrot2.ant.deps.ComponentDependency
All Implemented Interfaces:
Serializable

public class ComponentDependency
extends Object
implements Serializable

A class that represents a component and the information about its dependencies (other components it requires to build or run).

Author:
Dawid Weiss
See Also:
Serialized Form

Constructor Summary
ComponentDependency(Project project, File file)
           
 
Method Summary
 void bringUpToDate(Project project, String currentProfile, BringToDateTask task)
          Brings the component up-to-date, based on 'provides' and build elements.
 void collectMetas(List metas, String currentProfile, String type)
          Collects the meta headers of the given type for this component (dependencies not included).
 FileReference[] getAllProvidedFileReferences(Map components, String currentProfile, boolean buildPath, boolean nocopy)
           
 File[] getAllProvidedFiles(Map components, String currentProfile, boolean buildPath)
          Returns paths to all provided files (including objects in depending components).
 ComponentInProfile[] getAllRequiredComponentDependencies(Map componentsMap, String profile)
          Collect all ComponentDependency objects required by this component.
 ComponentInProfile[] getAllRequiredComponentDependencies(Map componentsMap, String profile, boolean nocopy)
          Collect all ComponentDependency objects required by this component.
protected  List getDependencyElements()
           
 String getDescription()
           
 File getFile()
          Returns the File pointer
 String getName()
          Returns the name of the component.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentDependency

public ComponentDependency(Project project,
                           File file)
                    throws IOException
Throws:
IOException
Method Detail

getName

public String getName()
Returns the name of the component.


getFile

public File getFile()
Returns the File pointer


getAllRequiredComponentDependencies

public ComponentInProfile[] getAllRequiredComponentDependencies(Map componentsMap,
                                                                String profile)
                                                         throws BuildException
Collect all ComponentDependency objects required by this component.

Parameters:
componentsMap - Name-to-ComponentDependency objects map used to resolve named dependencies.
Returns:
An array of ComponentDependency objects, sorted topologically from left to right (rightmost objects without dependencies).
Throws:
BuildException

getAllRequiredComponentDependencies

public ComponentInProfile[] getAllRequiredComponentDependencies(Map componentsMap,
                                                                String profile,
                                                                boolean nocopy)
                                                         throws BuildException
Collect all ComponentDependency objects required by this component.

Parameters:
componentsMap - Name-to-ComponentDependency objects map used to resolve named dependencies.
Returns:
An array of ComponentDependency objects, sorted topologically from left to right (rightmost objects without dependencies).
Throws:
BuildException

getDependencyElements

protected List getDependencyElements()

toString

public String toString()
Overrides:
toString in class Object

bringUpToDate

public void bringUpToDate(Project project,
                          String currentProfile,
                          BringToDateTask task)
                   throws BuildException
Brings the component up-to-date, based on 'provides' and build elements.

Throws:
BuildException

getAllProvidedFiles

public File[] getAllProvidedFiles(Map components,
                                  String currentProfile,
                                  boolean buildPath)
Returns paths to all provided files (including objects in depending components). Duplicates are removed.


getDescription

public String getDescription()

collectMetas

public void collectMetas(List metas,
                         String currentProfile,
                         String type)
Collects the meta headers of the given type for this component (dependencies not included).


getAllProvidedFileReferences

public FileReference[] getAllProvidedFileReferences(Map components,
                                                    String currentProfile,
                                                    boolean buildPath,
                                                    boolean nocopy)


Copyright (c) Dawid Weiss, Stanislaw Osinski