protoj.lang
Class ArchiveFeature

java.lang.Object
  extended by protoj.lang.ArchiveFeature

public final class ArchiveFeature
extends java.lang.Object

Provides support for the creation of source, javadoc, classes jar files and project tar file. This class is really just an aggregate of implementation objects so see the SourceArchive, JavadocArchive, ClassesArchive and ProjectArchive classes for more information.

Author:
Ashley Williams

Constructor Summary
ArchiveFeature(StandardProject parent)
          Enables creation of source, javadoc and classes jar files.
 
Method Summary
 void addClasses(java.lang.String name)
          Convenience method that schedules the creation of a single jar file with the given name.
 void addJavadoc(java.lang.String name, java.lang.String memory)
          Convenience method that schedules the creation of a single javadoc archive file with the given name and memory.
 void addSources(java.lang.String name)
          Convenience method that schedules the creation of a single sources archive file with the given name and memory.
 ClassesArchive getClassesArchive()
          Use this instance to configure the creation of java archives from the classes directory.
 JavadocArchive getJavadocArchive()
          Use this instance to configure the creation of java archives from the javadoc directory.
 ProjectLayout getLayout()
          The parent layout for convenient access.
 StandardProject getProject()
          The parent project for this feature.
 ProjectArchive getProjectArchive()
          Use this instance to configure the creation of a compressed tar file for the entire application.
 SourceArchive getSourceArchive()
          Use this instance to configure the creation of java archives from the source directory.
 void initProjectArchive(java.lang.String name, java.lang.String prefix)
          Convenient wrapper when just the default tar is required with no customization and applying tar name suffixes as necessary.
 void initProjectArchive(java.lang.String name, java.lang.String prefix, java.lang.String userName, java.lang.String group, ArgRunnable<ProjectArchive> config)
          This method must be called if support for creating a compressed tar file of the project is required.
 boolean isClassesJar(java.lang.String name)
          Returns whether or not the given jar name represents a valid classes jar file.
 boolean isJavadocJar(java.lang.String name)
          Returns whether or not the given jar name represents a valid javadoc jar file.
 boolean isSourcesJar(java.lang.String name)
          Returns whether or not the given jar name represents a valid sources jar file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveFeature

public ArchiveFeature(StandardProject parent)
Enables creation of source, javadoc and classes jar files.

Parameters:
parent -
Method Detail

initProjectArchive

public void initProjectArchive(java.lang.String name,
                               java.lang.String prefix,
                               java.lang.String userName,
                               java.lang.String group,
                               ArgRunnable<ProjectArchive> config)
This method must be called if support for creating a compressed tar file of the project is required. If no additional customization is required, simply provide a null config argument. See ProjectArchive for an example of a config argument.

Parameters:
name - the name of the tar file without any extension
prefix - used as the name of the root directory when the tarfile is extracted
userName - the user name for the tar entry, can be null
group - the group for the tar entry, can be null
config - extra configuration, can be null

initProjectArchive

public void initProjectArchive(java.lang.String name,
                               java.lang.String prefix)
Convenient wrapper when just the default tar is required with no customization and applying tar name suffixes as necessary. See initProjectArchive(String, String, String, String, ArgRunnable).

Parameters:
name -
prefix -

addClasses

public void addClasses(java.lang.String name)
Convenience method that schedules the creation of a single jar file with the given name. See ClassesArchive.addArchive(String, String, String, String, ArgRunnable) .

Parameters:
name -

addJavadoc

public void addJavadoc(java.lang.String name,
                       java.lang.String memory)
Convenience method that schedules the creation of a single javadoc archive file with the given name and memory. See JavadocArchive.addArchive(String, String, String, String, String, ArgRunnable) . .

Parameters:
name -

addSources

public void addSources(java.lang.String name)
Convenience method that schedules the creation of a single sources archive file with the given name and memory. See JavadocArchive.addArchive(String, String, String, String, String, ArgRunnable) . .

Parameters:
name -

isClassesJar

public boolean isClassesJar(java.lang.String name)
Returns whether or not the given jar name represents a valid classes jar file. This is a jar file that doesn't contain the strings ProjectLayout.getSourcePostfix(), ProjectLayout.getJavadocPostfix() or ProjectLayout.getSrcPostfix().

Parameters:
name -
Returns:

isJavadocJar

public boolean isJavadocJar(java.lang.String name)
Returns whether or not the given jar name represents a valid javadoc jar file. This is a jar file that contain the string ProjectLayout.getJavadocPostfix().

Parameters:
name -
Returns:

isSourcesJar

public boolean isSourcesJar(java.lang.String name)
Returns whether or not the given jar name represents a valid sources jar file. This is a jar file that contains either of the strings ProjectLayout.getSourcePostfix() or ProjectLayout.getSrcPostfix().

Parameters:
name -
Returns:

getClassesArchive

public ClassesArchive getClassesArchive()
Use this instance to configure the creation of java archives from the classes directory. See ClassesArchive.

Returns:

getSourceArchive

public SourceArchive getSourceArchive()
Use this instance to configure the creation of java archives from the source directory. See SourceArchive.

Returns:

getJavadocArchive

public JavadocArchive getJavadocArchive()
Use this instance to configure the creation of java archives from the javadoc directory. See JavadocArchive.

Returns:

getProjectArchive

public ProjectArchive getProjectArchive()
Use this instance to configure the creation of a compressed tar file for the entire application. See ProjectArchive.

Returns:

getProject

public StandardProject getProject()
The parent project for this feature.

Returns:

getLayout

public ProjectLayout getLayout()
The parent layout for convenient access.

Returns: