|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.acmsl.antmake.AntMake
Manages the creation of required GNU Autotools files from a sets of Java source files.
Field Summary | |
static java.lang.String[] |
EMPTY_STRING_ARRAY
Cached empty String array. |
Constructor Summary | |
protected |
AntMake()
Protected constructor to avoid accidental instantiation. |
Method Summary | |
protected void |
addFolder(java.util.Map map,
java.lang.String folder)
Adds given folder to given map. |
protected void |
addFolder(java.util.Map map,
java.lang.String parent,
java.lang.String folder)
Adds given folder to given map. |
protected void |
addPackage(AntMakeUtils antMakeUtils,
java.util.Map map,
java.lang.String[] folders)
Adds given package (and its parents) to given map. |
protected void |
addPackage(java.util.Map map,
java.lang.String[] folders)
Adds given package (and its parents) to given map. |
protected void |
addSource(java.util.Map map,
java.io.File source)
Adds a source file to given map. |
protected java.lang.Object |
buildFolderKey(java.lang.String folder)
Builds a key for given folder. |
protected java.lang.Object |
buildFolderListKey()
Builds a key for the folder list. |
void |
buildProject(java.lang.String projectName,
java.lang.String projectVersion,
java.io.File baseFolder,
org.apache.tools.ant.types.FileSet[] fileSets,
org.apache.tools.ant.types.Path classpath,
AntMakeTask task)
Creates the basic folder structure starting from given folder. |
protected java.lang.Object |
buildSourceKey(java.lang.String source)
Builds a key for given source file. |
protected java.lang.String[] |
copyDependencies(java.io.File baseFolder,
org.apache.tools.ant.types.Path classpath,
org.apache.tools.ant.Task task)
Copies the required dependencies from the classpath. |
protected java.lang.String[] |
copyDependencies(java.io.File baseFolder,
java.lang.String[] dependencies,
java.lang.String relativeFolder,
org.apache.tools.ant.Task task)
Copies the required dependencies from the classpath. |
void |
copyFile(org.acmsl.commons.utils.io.FileUtils fileUtils,
java.io.File file,
java.io.File folder,
org.apache.tools.ant.Task task)
Copies given file to the specified folder. |
protected void |
copyFile(java.lang.String fileName,
FolderStructureHelper folderStructureHelper,
java.io.File baseFolder,
AntMakeTask task,
java.lang.ClassLoader classLoader)
Copies a concrete file. |
protected void |
copyFiles(FolderStructureHelper folderStructureHelper,
java.io.File baseFolder,
AntMakeTask task,
java.lang.ClassLoader classLoader)
Copies the fixed files. |
void |
copyFixedFiles(java.io.File baseFolder,
AntMakeTask task)
Copies the fixed files: README, AUTHORS and COPYING. |
protected void |
createConfigureInFile(ConfigureInTemplateGenerator generator,
AntMakeUtils antMakeUtils,
java.lang.String projectName,
java.lang.String projectVersion,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the configure.in file. |
protected void |
createConfigureInFile(java.lang.String projectName,
java.lang.String projectVersion,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the configure.in file. |
protected void |
createMakefileAmFiles(MakefileAmTemplateGenerator generator,
AntMakeUtils antMakeUtils,
java.lang.String projectName,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the child Makefile.am files. |
protected void |
createMakefileAmFiles(java.lang.String projectName,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the child Makefile.am files. |
protected void |
createMakeRulesFile(MakeRulesTemplateGenerator generator,
java.lang.String projectName,
java.io.File baseFolder,
java.lang.String[] dependencies,
org.apache.tools.ant.Task task)
Creates the Make-rules file. |
protected void |
createMakeRulesFile(java.lang.String projectName,
java.io.File baseFolder,
java.lang.String[] dependencies,
org.apache.tools.ant.Task task)
Creates the Make-rules file. |
protected void |
createTopMakefileAmFile(java.lang.String projectName,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the top-level Makefile.am file. |
protected void |
createTopMakefileAmFile(TopMakefileAmTemplateGenerator generator,
AntMakeUtils antMakeUtils,
java.lang.String projectName,
java.io.File baseFolder,
java.io.File[] sourceFiles,
org.apache.tools.ant.Task task)
Creates the top-level Makefile.am file. |
protected void |
generateChangeLog(CvsUtils cvsUtils,
java.io.File rootFolder,
java.lang.String output,
org.apache.tools.ant.Task task)
Generates the changelog file. |
protected void |
generateChangeLog(java.io.File rootFolder,
java.lang.String output,
org.apache.tools.ant.Task task)
Generates the changelog file. |
java.util.Collection |
getFolderList(java.util.Map map)
Retrieves the folder list contained in given map. |
static AntMake |
getInstance()
Retrieves an AntMake instance. |
protected static java.lang.ref.WeakReference |
getReference()
Retrieves the weak reference. |
java.util.Collection |
getSources(java.util.Map map,
java.lang.String folder)
Retrieves the sources of given folder. |
java.util.Collection |
getSubfolders(java.util.Map map,
java.lang.String folder)
Retrieves the sources of given folder. |
protected static void |
setReference(AntMake instance)
Specifies a new weak reference. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String[] EMPTY_STRING_ARRAY
Constructor Detail |
protected AntMake()
Method Detail |
protected static void setReference(AntMake instance)
instance
- the instance to use.protected static java.lang.ref.WeakReference getReference()
public static AntMake getInstance()
public void buildProject(java.lang.String projectName, java.lang.String projectVersion, java.io.File baseFolder, org.apache.tools.ant.types.FileSet[] fileSets, org.apache.tools.ant.types.Path classpath, AntMakeTask task) throws AntMakeException
projectName
- the project name.projectVersion
- the project version.baseFolder
- the base folder.classpath
- the class path.task
- the AntMake task (only for logging purposes).
AntMakeException
- if the project cannot be built for
some reason.protected void copyFiles(FolderStructureHelper folderStructureHelper, java.io.File baseFolder, AntMakeTask task, java.lang.ClassLoader classLoader) throws AntMakeException
folderStructureHelper
- the helper.baseFolder
- the base folder.task
- the AntMake tas.classLoader
- the class loader used to get the
macro files from the class path.
AntMakeException
- if some files are not found.protected void copyFile(java.lang.String fileName, FolderStructureHelper folderStructureHelper, java.io.File baseFolder, AntMakeTask task, java.lang.ClassLoader classLoader) throws java.io.IOException
fileName
- the name of the file.folderStructureHelper
- the helper.baseFolder
- the base folder.task
- the AntMake tas.classLoader
- the class loader used to get the
macro files from the class path.
java.io.IOException
- if some files are not found.protected java.lang.String[] copyDependencies(java.io.File baseFolder, org.apache.tools.ant.types.Path classpath, org.apache.tools.ant.Task task) throws AntMakeException
baseFolder
- the base folder.classpath
- the classpath.task
- the task, for logging purposes.
AntMakeException
- if the dependencies could not be copied.protected java.lang.String[] copyDependencies(java.io.File baseFolder, java.lang.String[] dependencies, java.lang.String relativeFolder, org.apache.tools.ant.Task task) throws AntMakeException
baseFolder
- the base folder.dependencies
- the dependencies.relativeFolder
- the relative folder for storing the
dependencies starting from basefolder.task
- the task, for logging purposes.
AntMakeException
- if the dependencies could not be copied.protected void createMakeRulesFile(java.lang.String projectName, java.io.File baseFolder, java.lang.String[] dependencies, org.apache.tools.ant.Task task) throws AntMakeException
projectName
- the project name.baseFolder
- the base folder.dependencies
- the dependencies.task
- the task (for logging purposes).
throws AntMakeException if the Make-rules file cannot
be created.
AntMakeException
protected void createMakeRulesFile(MakeRulesTemplateGenerator generator, java.lang.String projectName, java.io.File baseFolder, java.lang.String[] dependencies, org.apache.tools.ant.Task task) throws AntMakeException
generator
- the template generator.projectName
- the project name.baseFolder
- the base folder.dependencies
- the dependencies.task
- the task (for logging purposes).
throws AntMakeException if the Make-rules file cannot
be created.
AntMakeException
protected void createConfigureInFile(java.lang.String projectName, java.lang.String projectVersion, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
projectName
- the project name.projectVersion
- the project version.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if the configure.in file cannot
be created.
AntMakeException
protected void createConfigureInFile(ConfigureInTemplateGenerator generator, AntMakeUtils antMakeUtils, java.lang.String projectName, java.lang.String projectVersion, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
generator
- the template generator.antMakeUtils
- the helper instance.projectName
- the project name.projectVersion
- the project version.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if the configure.in file cannot
be created.
AntMakeException
protected void createTopMakefileAmFile(java.lang.String projectName, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
projectName
- the project name.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if such Makefile.am file cannot
be created.
AntMakeException
protected void createTopMakefileAmFile(TopMakefileAmTemplateGenerator generator, AntMakeUtils antMakeUtils, java.lang.String projectName, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
generator
- the template generator.antMakeUtils
- the helper instance.projectName
- the project name.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if such Makefile.am file cannot
be created.
AntMakeException
protected void createMakefileAmFiles(java.lang.String projectName, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
projectName
- the project name.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if any of the Makefile.am files cannot
be created.
AntMakeException
protected void createMakefileAmFiles(MakefileAmTemplateGenerator generator, AntMakeUtils antMakeUtils, java.lang.String projectName, java.io.File baseFolder, java.io.File[] sourceFiles, org.apache.tools.ant.Task task) throws AntMakeException
generator
- the template generator.antMakeUtils
- the helper instance.projectName
- the project name.baseFolder
- the base folder.sourceFiles
- the source files.task
- the task (for logging purposes).
throws AntMakeException if such Makefile.am file cannot
be created.
AntMakeException
protected void addSource(java.util.Map map, java.io.File source)
map
- the container.source
- the source file.public java.util.Collection getSources(java.util.Map map, java.lang.String folder)
map
- the container.folder
- the folder.
protected void addPackage(java.util.Map map, java.lang.String[] folders)
map
- the container.folders
- the folders of the package.protected void addPackage(AntMakeUtils antMakeUtils, java.util.Map map, java.lang.String[] folders)
antMakeUtils
- the helper instance.map
- the container.folders
- the folders of the package.protected void addFolder(java.util.Map map, java.lang.String parent, java.lang.String folder)
map
- the container.parent
- the parent.folder
- the folder of the package.protected void addFolder(java.util.Map map, java.lang.String folder)
map
- the container.folder
- the folder of the package.public java.util.Collection getSubfolders(java.util.Map map, java.lang.String folder)
map
- the container.folder
- the folder.
public java.util.Collection getFolderList(java.util.Map map)
map
- the container.
protected java.lang.Object buildSourceKey(java.lang.String source)
source
- the source file.
protected java.lang.Object buildFolderKey(java.lang.String folder)
folder
- the folder.
protected java.lang.Object buildFolderListKey()
public void copyFixedFiles(java.io.File baseFolder, AntMakeTask task) throws AntMakeException
baseFolder
- the base folder.task
- the AntMake task instance.
AntMakeException
- if the files could not be copied.public void copyFile(org.acmsl.commons.utils.io.FileUtils fileUtils, java.io.File file, java.io.File folder, org.apache.tools.ant.Task task) throws AntMakeException
file
- the input file.folder
- the destination.task
- the task (for logging purposes).
AntMakeException
- if the file could not be copied.protected void generateChangeLog(java.io.File rootFolder, java.lang.String output, org.apache.tools.ant.Task task) throws AntMakeException
rootFolder
- the root folder.output
- the name of the output file.task
- the task.
AntMakeException
- if the file cannot be generated.protected void generateChangeLog(CvsUtils cvsUtils, java.io.File rootFolder, java.lang.String output, org.apache.tools.ant.Task task) throws AntMakeException
cvsUtils
- the CvsUtils instance.rootFolder
- the root folder.output
- the name of the output file.task
- the task.
AntMakeException
- if the file cannot be generated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |