2005/5/10

     
 

ACDK Make Tasks

artefaktur

acdkmake provides build in Tasks for most common used build functions.



Content of this chapter:

   Task Types
     Base Task Types
       Task
       AbstractTask
       ProjectTask
     File related classes
       DirExists
       FileCopyTask
       FileDeleteTask
       FileDependTask
       LookupFileTask
     C++ related classes
       CompileTask
       CppSourceDependTask
     Generic Execution Task
       ScriptExecuteTask
       ShellExecuteTask
     ACDK specific Tasks
       AcdkBinaryTask
       AcdkExeTask
       AcdkLibTask
       AcdkMetainfLibTask
       AcdkTestExeTask
       AcdkProjectTask
     Java specific Tasks
       JavaCompileTask



 Task Types

To tell amake to to a job a Task has to be created.
For different jobs different Tasks can be created:

  •  Namespaces.

     Base Task Types


     Task

     acdk::make::Task is the base interface for all acdkmake tasks.

     AbstractTask

     acdk::make::AbstractTask is the abstract class implementation on which most builin amake Tasks are based on.

     ProjectTask

     acdk::make::ProjectTask is a wrapper to other Tasks. Normally it simple executes its sub tasks.


     File related classes


     DirExists

     acdk::make::DirExistsTask ensures that a directory exists.

     FileCopyTask

     acdk::make::FileCopyTask copy/install a collection of Files.

     FileDeleteTask

     acdk::make::FileDeleteTask removes a collection of Files.

     FileDependTask

     acdk::make::FileDependTask checks if source file(s) is/are newer than target file.

     LookupFileTask

     acdk::make::LookupFileTask try to locate a given type of file.

     C++ related classes


     CompileTask

  •  acdk::make::CompileTask compiles an C++ source.

     CppSourceDependTask

  •  acdk::make::CppSourceDependTask checks for include dependencies of a C++ source.
    If a source file includes a header and this header has a younger modification time as the target object file, the source has to be recompiled.

    CppSourceDependTask does not use an external C preprocessor but uses an own build in parser.
    This internal parser does not regard defines, but evaluates all include files. This has the effect, that also #included header are evaluated which are deactivated by #define.

    In normal mode CppSourceDependTask follows all header, included by #include "Header.h" and #include recursivelly.
    With the constructor arguments checkRecursive the recursive parsing (also parse the included headers for includes can be switched off.
    With the constructor argument onlyDirectIncludes only includes with the form #include "Header.h" are parsed (which are normally project own header files), whereas #include are ignored.

    With the acdkmc comandline option -dd only direct includes will be parsed. The acdk command line -dn the CompileTask will not check for source dependencies.

    Different to external C++ parsers the CppSourceDependTask caches all parsed dependencies for a header file, so parsing all headers should consume much time.
    The CompileTask caches the pre-parsed dependency try over all sources of the project.


     Generic Execution Task



     ScriptExecuteTask

     acdk::make::ScriptExecuteTask executes a given CfgScript file.

     ShellExecuteTask

     acdk::make::ShellExecuteTask executes a given executable.


     ACDK specific Tasks

    The tasks starting with Acdk are specific tasks which collect the standard tasks to compile and install ACDK projects.

     AcdkBinaryTask

     acdk::make::AcdkBinaryTask creates an ACDK binary. This task is the base class for AcdkLibTask and AcdkExeTask.

    An AcdkBinary tasks asumes that the sources are organized following way:
    ./acdk_prj           -> Project directory
    ./acdk_prj/build.csf -> amake file.
    ./acdk_prj/src/namespace1/namespace2/Source.cpp -> sources are in src sub directory
    ./acdk_prj/tobj/*     -> object files will stored here
    ./acdk_prj/cfg        -> Project configuration files
    ./bin                 -> acdk binary directory
    ./include             -> install target of sources (./include/namespac1/namespace2/Source.cpp)
    ./cfg                 -> install target of cfg from ./acdk_prj/cfg
    

    An AcdkBinaryTasks devides from two sources:
    Ordinary sources (files and directories) and Module directories.
    For modules the  man acdkmc meta compiler will parse the header and generates metainf files.
    In the subdirectory metainf_modulename cpp files will be generated containing extended metainfo.

    If for example AcdkBinaryTask is named my_package AcdkBinaryTask defines the preprocessor value USE_MY_PACKAGE.

     AcdkExeTask


     acdk::make::AcdkExeTask creates an ACDK executable.

     AcdkLibTask

     acdk::make::AcdkLibTask creates an ACDK libarary (static or shared).

     AcdkMetainfLibTask

     acdk::make::AcdkMetainfLibTask creates a library containing the extended metainfo created by  man acdkmc for a given AcdkLibTask.


     AcdkTestExeTask

     acdk::make::AcdkTestExeTask creates an ACDK test executable.
    Different to the AcdkBinaryTask the directory layout is:
    Source: 
    ./acdk_prj/tests/namespace1/namespace2/namespace1_namespace2_Source_Test.cpp
    
    Installed Source: 
    ./include/tests/namespace1/namespace2/namespace1_namespace2_Source_Test.cpp
    

     AcdkProjectTask

     acdk::make::AcdkProjectTask is derived from ProjectTask. AcdkProjectTask installes the cfg files (from ./cfg) into $ACDKHOME/cfg.


     Java specific Tasks


     JavaCompileTask

     acdk::make::JavaCompileTask compiles a java file.