ModelAnt Structure of Directories

These are the file and directories conventions each ModelAnt product and component (module) must obey:

Structure of Directories

All development of MDA Tolls’ products and components is organized in directories:

<root>/
       dist/ 
       doc/ 
       docs/
       lib/
       out/
       <product>/
                 lib/
                 <component>
                 <metamodel name>
                 <metamodel name>-<component>
                 build.xml
                 version.properties
       version/
       work/ 
       xmi/        
       env.xml
       base.build.xml

where:

  • <root> is the directory where all products of MDA Tools are collected
  • <product> directory holds a single product like ModelAnt.
  • <component> directory holds the source files of a component of the owner product. These components are common, independent of any meta-model. Examples: core, repository, template.
  • <metamodel name> directory holds the meta-model definition files and specific macro definitions. It forms a separate “meta-model component” simplifying the usage of the meta-model. Examples: uml13, uml14.
  • <metamodel name>-<component> directory holds the source files of a component of the owner product. These components are specific for that meta-model. Examples: uml13-wrap, uml13-reverse.
  • <product>/lib directory holds the product-specific library files.
  • <product>/build.xmlfile implements the targets needed to build all components as a single product. These are:
    • build.all target which calls the build targets of the build.xml files of each component to include in the product
    • doc.java target which lists the Java packages of the product’s components, to be included in product documentation as javaDoc. It effectively generates that documentation.
    • doc.ant target generates the ant.doc documentation of Ant tasks, types, macros and scripts the product’s components publish.

    This file includes the base.build.xml file, so building the product’s distribution is done by calling dist.all target. For more details see script’s help target (the default one).

  • version.properties file states the current product’s version and states the major changes the each version introduces
  • dist directory is where the distributions of the products are generated. It represents the distribution(s) in an expanded, ready for use form.
  • doc directory and documentation
  • docs directory holds a copy of the javaDoc and ant.doc documentation generated during the last distribution build
  • lib directory holds the library .jar files that are common for all products
  • out directory holds any output / artifacts the ModelAnt scripts generate
  • version directory collects the zipped distribution files, i.e. for each product version these are three separate files holding the binary  product distribution, the source code of the product distribution and the documentation of the distribution in the form of javaDoc and ant.doc tools output.
  • work directory holds any working files like repository files, intermediate compilation results, any intermediate models, etc.
  • xmi directory holds any input models in the form of XMI 1.1/1.2 files
  • <root>/env.xml script establishes a common standard environment for any ModelAnt scripts. Any script should import it directly or indirectly.
  • <root>/base.build.xml script establishes common standard environment and targets for building products and components. Any build script should import it and override quite a few targets to provide the component’s specifics.

Component Directories

<meta-model> component directory holds

  • any specific files of the meta-model
  • meta.xml file, which defines
    • any meta-model specific macros
    • <metamodel name>.load.metamodel macro loads the meta-model in the repository. No other macros or scripts should refer the metamodel files
    • <metamodel name>.instantiate macro instantiates the meta-model and allows loading models in it

<component> and <metamodel name>-<component> component directories hold

  classes
  lib/
  src/
      java/
      jsp/
      xml/
      .....
  test/
      java/
      jsp/
      xml/ 
      ..... 
  build.xml
  build.properties
  development.properties
  • classes directory holds the compilation results of the local files
  • lib directory holds the component-specific library .jar files
  • src directory holds the source files in separate sub-directories for each file type
  • src/xml/......./antlib.xml file is the AntLib definition of the Ant tasks, types and macros this component publishes for ModelAnt use
  • src/xml/......./private.antlib.xml file is the AntLib definition of the Ant tasks, types and macros this component uses locally, but does not publish in the ModelAnt use
  • test directory holds the source files of the component tests. Similar to the source files, they are in separate sub-directories for each file type
  • build.xml file builds the current component. It imports the base.build.xml file, so building the component’s distribution is done by calling dist target. Just compiling it is dine in build target (the default one)
  • build.properties file holds any specific properties the build.xml or any other script needs both in development and in production.
  • development.properties file holds any specific properties (that can even override those in build.properties) the build.xml or any other script needs during the development and testing, but not in production.

 

One thought on “ModelAnt Structure of Directories

  1. Mohammad says:

    This is such a great resource that you are proivding and you give it away for free. I enjoy seeing websites that understand the value of proivding a prime resource for free. I truly loved reading your post. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.