Package eu.bandm.tools.applicationStart
Class StartApplicationProject_makeBased
java.lang.Object
eu.bandm.tools.applicationStart.StartApplicationProject_makeBased
@PropertyDependency({"line.separator","user.dir"})
public class StartApplicationProject_makeBased
extends Object
Initial fill of the source file tree for a new application project
based on metatools and gnu make.
The PWD must be the top directory of that project, and must be completely
empty.
Source tree and top-level additional directories will be created.
Usage:
a/b/grmpf$ java -classpath metatools.jar eu.bandm.tools.applicationStart.StartApplicationProject_makeBased e.f.grmpf
will build
a/b/grmpf/etc/Makefile.include a/b/grmpf/etc/cinfig.mk.template a/b/grmpf/etc/... (some more) a/b/grmpf/doc/makeapidoc/Makefile a/b/grmpf/src/Makefile a/b/grmpf/src/e/Makefile a/b/grmpf/src/e/f/Makefile a/b/grmpf/src/e/f/grmpf/Makefile (and some more)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumSelect kind of folder skeleton. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEvidentprotected final MessageReceiver<SimpleMessage<String>> Target of all messages: counts them and prints them formatted to terminal.protected final MessageCounterEvident(package private) final StringOS specific line separatorprotected final OptionsEvidentstatic final StringInserted into most of the generated/copied Makefiles etc. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidcopyFile(String fileNameSrc, File targetDirectory, @Opt String fileNameTarget, @Opt String firstLine, String... substs) Copy a file into the newly created hierarchy:static voidMain service point.(package private) voidmakeHierarchy(String[] levels, String name_topDir, File file_topDir, String topName, StartApplicationProject_makeBased.Mode mode) Create a hierarchy of directories and Makefiles.(package private) FilemakeSubSource(String filePrefix, @Opt String packagePrefix, File context, String name, @Opt String sub, StartApplicationProject_makeBased.Mode mode) Create the directory and the Makefile for one level of the initial source tree.(package private) voidmakeTextFile(String fileNameTarget, File targetDirectory, String text) Write the given text to a new file in the given directory.(package private) voidnonStatic_main(String[] args) Initial fill of the source file tree for a new application project based on metatools and gnu make.
-
Field Details
-
filename_prjRoot
Evident- See Also:
-
options
Evident -
msg_c
Evident -
msg
Target of all messages: counts them and prints them formatted to terminal. -
warranty_warning_text
Inserted into most of the generated/copied Makefiles etc.- See Also:
-
NL
OS specific line separator
-
-
Constructor Details
-
StartApplicationProject_makeBased
public StartApplicationProject_makeBased()
-
-
Method Details
-
main
Main service point. -
nonStatic_main
Initial fill of the source file tree for a new application project based on metatools and gnu make. The PWD must be the top directory of that project, and must be completely empty. Source tree and top-level additional directories will be created.- Parameters:
args- only option is some prefix of the projects hierachical url. For these prefixes src dirs and Makefiles will be generated.
-
makeHierarchy
void makeHierarchy(String[] levels, String name_topDir, File file_topDir, String topName, StartApplicationProject_makeBased.Mode mode) throws FileNotFoundException Create a hierarchy of directories and Makefiles.- Parameters:
levels- the prefices of the projects hierarchical name. For each component one directory level will be created.name_topDir- the nema of PWD, assumed to be the name of the projectfile_topDir- PWD file, in which the hierarchy shall starttopName- the name of the top of the created hierarchy, like "src" or "test".mode- whether to create src or test or example tree- Throws:
FileNotFoundException
-
makeSubSource
File makeSubSource(String filePrefix, @Opt @Opt String packagePrefix, File context, String name, @Opt @Opt String sub, StartApplicationProject_makeBased.Mode mode) throws FileNotFoundException Create the directory and the Makefile for one level of the initial source tree.- Parameters:
filePrefix- the sequence of file names, from $(PRJ) down to containingDir, symbolically.packagePrefix- the sequence of package names, from the topmost under $(PRJ)/src down to the containing directory "context".context- containing directory in which this directory is made.name- of the directory and package to make.sub- name of the only sub-package, may be null.mode- whether the purpose is src/examples/test.- Throws:
FileNotFoundException
-
copyFile
void copyFile(String fileNameSrc, File targetDirectory, @Opt @Opt String fileNameTarget, @Opt @Opt String firstLine, String... substs) throws IOException Copy a file into the newly created hierarchy:- Parameters:
fileNameSrc- name of the file as a resource relative to this classtargetDirectory- where to create the copyfileNameTarget- when the copy shall get a different namefirstLine- addtional first ("warning") line inserted into the copysubsts- pairs of KEY/VALUE to replace "${KEY}" by "VALUE".- Throws:
IOException
-
makeTextFile
Write the given text to a new file in the given directory.- Throws:
IOException
-