org.apache.jetspeed.anttasks
Class ArchetypeDescriptor

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.jetspeed.anttasks.ArchetypeDescriptor

public class ArchetypeDescriptor
extends org.apache.tools.ant.Task

ArchetypeDescriptor This Ant task is used to generate a Maven2 Archetype Descriptor file.

Version:
$Id: $
Author:
Randy Watler

Field Summary
private  Boolean allowPartial
           
private  String artifactId
           
private  File baseDir
           
private  File destFile
           
private  String header
           
private  org.apache.tools.ant.types.Reference resourcesRefId
           
private  org.apache.tools.ant.types.Reference siteResourcesRefId
           
private  org.apache.tools.ant.types.Reference sourcesRefId
           
private  org.apache.tools.ant.types.Reference testResourcesRefId
           
private  org.apache.tools.ant.types.Reference testSourcesRefId
           
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
ArchetypeDescriptor()
           
 
Method Summary
 void addText(String header)
          Set archetype descriptor header text
private  List archetypeFiles(org.apache.tools.ant.types.Reference refId, String name)
          Utility to read fileset refid attributes.
private  String canonicalPath(File file)
          Utility to get canonical file path
 void execute()
          Executes task to generate desciptor file.
 void setAllowpartial(Boolean allowPartial)
          Set archetype partial rules to support execution in existing projects.
 void setArtifactid(String artifactId)
          Set archetype artifact id.
 void setBasedir(File baseDir)
          Set archetype base directory for all sources/resources.
 void setDestfile(File destFile)
          Set archetype descriptor destination file.
 void setResourcesrefid(org.apache.tools.ant.types.Reference resourcesRefId)
          Set archetype resources fileset refid.
 void setSiteresourcesrefid(org.apache.tools.ant.types.Reference siteResourcesRefId)
          Set archetype site resources fileset refid.
 void setSourcesrefid(org.apache.tools.ant.types.Reference sourcesRefId)
          Set archetype sources refid.
 void setTestresourcesrefid(org.apache.tools.ant.types.Reference testResourcesRefId)
          Set archetype test resources fileset refid.
 void setTestsourcesrefid(org.apache.tools.ant.types.Reference testSourcesRefId)
          Set archetype test sources fileset refid.
private  void writeFiles(PrintWriter writer, String collectionElementName, String elementName, List files)
          Utility to write archetype descriptor file lists.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

header

private String header

artifactId

private String artifactId

allowPartial

private Boolean allowPartial

baseDir

private File baseDir

destFile

private File destFile

sourcesRefId

private org.apache.tools.ant.types.Reference sourcesRefId

resourcesRefId

private org.apache.tools.ant.types.Reference resourcesRefId

testSourcesRefId

private org.apache.tools.ant.types.Reference testSourcesRefId

testResourcesRefId

private org.apache.tools.ant.types.Reference testResourcesRefId

siteResourcesRefId

private org.apache.tools.ant.types.Reference siteResourcesRefId
Constructor Detail

ArchetypeDescriptor

public ArchetypeDescriptor()
Method Detail

addText

public void addText(String header)
Set archetype descriptor header text

Parameters:
header - archetype header text

setArtifactid

public void setArtifactid(String artifactId)
Set archetype artifact id.

Parameters:
artifactId - archetype artifact id

setAllowpartial

public void setAllowpartial(Boolean allowPartial)
Set archetype partial rules to support execution in existing projects.

Parameters:
allowPartial - archetype allow partial setting

setBasedir

public void setBasedir(File baseDir)
Set archetype base directory for all sources/resources.

Parameters:
baseDir - archtype source/resource base directory

setDestfile

public void setDestfile(File destFile)
Set archetype descriptor destination file.

Parameters:
destFile - archetype descriptor file to generate

setSourcesrefid

public void setSourcesrefid(org.apache.tools.ant.types.Reference sourcesRefId)
Set archetype sources refid.

Parameters:
sourcesRefId - archetype sources

setResourcesrefid

public void setResourcesrefid(org.apache.tools.ant.types.Reference resourcesRefId)
Set archetype resources fileset refid.

Parameters:
resourcesRefId - archetype resources

setTestsourcesrefid

public void setTestsourcesrefid(org.apache.tools.ant.types.Reference testSourcesRefId)
Set archetype test sources fileset refid.

Parameters:
testSourcesRefId - archetype test sources

setTestresourcesrefid

public void setTestresourcesrefid(org.apache.tools.ant.types.Reference testResourcesRefId)
Set archetype test resources fileset refid.

Parameters:
testResourcesRefId - archetype test resources

setSiteresourcesrefid

public void setSiteresourcesrefid(org.apache.tools.ant.types.Reference siteResourcesRefId)
Set archetype site resources fileset refid.

Parameters:
siteResourcesRefId - archetype site resources

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes task to generate desciptor file.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

archetypeFiles

private List archetypeFiles(org.apache.tools.ant.types.Reference refId,
                            String name)
                     throws org.apache.tools.ant.BuildException
Utility to read fileset refid attributes.

Parameters:
refId - attribute refid
name - attribute name
Returns:
list of String file paths
Throws:
org.apache.tools.ant.BuildException

canonicalPath

private String canonicalPath(File file)
Utility to get canonical file path

Parameters:
file - file to convert to canonical path
Returns:
canonical path

writeFiles

private void writeFiles(PrintWriter writer,
                        String collectionElementName,
                        String elementName,
                        List files)
                 throws IOException
Utility to write archetype descriptor file lists.

Parameters:
writer - descriptor writer
collectionElementName - collection element name
elementName - file element name
files - list of String file paths
Throws:
IOException


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.