Class StartApplicationProject_makeBased

java.lang.Object
eu.bandm.tools.applicationStart.StartApplicationProject_makeBased

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)
  
  • Field Details

  • Constructor Details

    • StartApplicationProject_makeBased

      public StartApplicationProject_makeBased()
  • Method Details

    • main

      public static void main(String[] args)
      Main service point.
    • nonStatic_main

      void nonStatic_main(String[] args)
      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 project
      file_topDir - PWD file, in which the hierarchy shall start
      topName - 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 class
      targetDirectory - where to create the copy
      fileNameTarget - when the copy shall get a different name
      firstLine - addtional first ("warning") line inserted into the copy
      substs - pairs of KEY/VALUE to replace "${KEY}" by "VALUE".
      Throws:
      IOException
    • makeTextFile

      void makeTextFile(String fileNameTarget, File targetDirectory, String text) throws IOException
      Write the given text to a new file in the given directory.
      Throws:
      IOException