1    /* 
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * */
    12    package xdc.tools.product;
    13    
    14    /*!
    15     *  ======== IProductTemplate ========
    16     *  Interface to provide examples for a product
    17     *  
    18     *  This interface allows products to contribute examples to
    19     *  development environments like IDE's. This is an experimental 
    20     *  interface and is subject to change.
    21     */
    22    metaonly interface IProductTemplate
    23    {
    24    
    25        /*!
    26         *  ======== FileDesc ========
    27         *  Structure defining properties of a file included in an example
    28         *
    29         *  @field(path)                    Path to file relative to the package
    30         *                                  containing the implementation of 
    31         *                                  `IProductTemplate`
    32         *  @field(excludeFromBuild)        Flag indicating whether file
    33         *                                  should be excluded from build inside
    34         *                                  an IDE project 
    35         *  @field(openOnCreation)          Flag indicating whether the file
    36         *                                  should be opened when a project
    37         *                                  containing the example file is created
    38         *                                  by the IDE. 
    39         *  @field(copyIntoConfiguration)   Flag indicating whether the file
    40         *                                  should be copied into RTSC 
    41         *                                  configuration. This flag 
    42         *                                  applies only when the `isHybrid`
    43         *                                  flag of the {@link #TemplateInfo template} is set to
    44         *                                  `false`.
    45         *
    46         */ 
    47        struct FileDesc {
    48            String path;             /*! Path to file */
    49            Bool   excludeFromBuild; /*! Indicates whether file should be
    50                                         excluded from build 
    51                                      */
    52            Bool   openOnCreation;   /*! Indicates whether file should be
    53                                         opened on project creation
    54                                      */
    55            Bool   copyIntoConfiguration; /*! Indicates whether file should be
    56                                           *   copied into RTSC configuration 
    57                                           */
    58        };
    59    
    60        /*!
    61         *  ======== Filter ========
    62         *  Structure defining filter properties for an example
    63         *
    64         *  This structure allows example providers to define
    65         *  constraints (like device family) for their 
    66         *  examples. IDEs may use the `Filter` properties of an example
    67         *  to decide whether the example should be presented to the user.
    68         *  The filter allows the user to define the NOT property by
    69         *  inserting a "~" character at the start of the string. For
    70         *  example if the deviceFamily field is set to "~MSP430" the example
    71         *  will be displayed for all device families except MSP430.
    72         *
    73         *  @field(deviceFamily)   String indicating the device family 
    74         *                         eg. "MSP430","C6000"
    75         *  @field(deviceVariant)  String indicating device variant
    76         *                         eg. "C674X", "CortexA8"
    77         *  @field(deviceId)       String indicating the device part number
    78         *                         eg. "TMS320C6747"
    79         *  @field(endianness)     String indicating the device endianness
    80         *                         eg. "little", "big"
    81         *  @field(toolChain)      String indicating the tool chain
    82         *                         eg. "TI", "GNU"
    83         *  @field(outputFormat)   String indicating the object file format
    84         *                         eg. "COFF", "ELF"
    85         */ 
    86        struct Filter {
    87            String deviceFamily; 
    88            String deviceVariant;
    89            String deviceId;    
    90            String endianness;
    91            String toolChain;
    92            String outputFormat;
    93        }; 
    94    
    95        /*!
    96         *  ======== TemplateInfo ========
    97         *  TemplateInfo structure 
    98         *
    99         *  @field(title)             String containing the title of the template
   100         *  @field(fileList)          Array of {@link #FileDesc} defining the
   101         *                            properties of the files contributed by this example.
   102         *  @field(description)       String containing  description of example
   103         *  @field(target)            String containing RTSC target
   104         *  @field(platform)          String containing RTSC platform
   105         *  @field(buildProfile)      String containing RTSC build profile
   106         *  @field(linkerCommandFile) Linker command file for the example. If
   107         *                            this is set to the empty string then no
   108         *                            linker command file is added by the IDE
   109         *                            to the example. If this is not defined 
   110         *                            then the wizard picks the default
   111         *                            linker command file for the selected device. 
   112         *  @field(requiredProducts)  Products required to build this
   113         *                            example. Products are  identified by
   114         *                            their globally unique 
   115         *                            {@link xdc.tools.product.IProduct#id} 
   116         *                            eg. 'com.ti.bios'. Dependency on a 
   117         *                            minimum version of a product maybe
   118         *                            defined in the following manner
   119         *                            : <product-id>:<min-version>
   120         *  @field(groups)            Array of strings referring example groups
   121         *                            that a particular example may
   122         *                            belong. Example providers may want to
   123         *                            provide examples that are part of an
   124         *                            existing example group eg."Empty Projects" 
   125         *                            that are defined elsewhere. The
   126         *                            groups are identified by an unique id.
   127         *  @field(configOnly)        Flag indicating to the IDE
   128         *                            whether example contributes only
   129         *                            to a RTSC configuration project.
   130         *  @field(isHybrid)          Flag indicating to the IDE 
   131         *                            whether example contains RTSC 
   132         *                            configuration  and target 
   133         *                            content files in one project.
   134         *                            If this field is set to `true` 
   135         *                            then the IDE consuming this example will 
   136         *                            create one project with all the
   137         *                            files. Otherwise multiple projects will 
   138         *                            be created - one containing the
   139         *                            target content and the other containing 
   140         *                            the RTSC configuration files. This flag
   141         *                            is applies only when `configOnly`
   142         *                            flag is set to `false`.
   143         *  @field(filterArr)         Array of {@link #Filter}. Used to specify
   144         *                            the constraints for a particular example. 
   145         *                          
   146         */ 
   147        struct TemplateInfo {
   148            String   title;              /*! Title of example */
   149            FileDesc fileList[];         /*! List of files along with properties 
   150                                          * for example
   151                                          */
   152            String   description;        /*! Description of example */
   153            String   target;             /*! RTSC target */
   154            String   platform;           /*! RTSC platform */
   155            String   buildProfile;       /*! RTSC build profile */
   156            String   linkerCommandFile;  /*! Linker command file for the example */
   157            String   requiredProducts[]; /*! List of products required to build
   158                                          *  this example
   159                                          */
   160            String   groups[];           /*! Array of group ids */ 
   161            Bool     legacyTcf;          
   162            Bool     configOnly;         /*! Indicates whether only a RTSC
   163                                          *  configuration project should
   164                                          *  be created for this example.
   165                                          */
   166            Bool     isHybrid;           /*! Indicates whether application and
   167                                          * configuration content exists in
   168                                          * one project
   169                                          */ 
   170            Filter   filterArr[];        /*! Array of filters for example */
   171        };
   172    
   173    
   174        /*!
   175         *  ======== TemplateGroup ========
   176         *  TemplateGroup structure
   177         *
   178         *  This structure maybe used to define a hierarchy of examples
   179         *  for the product. Examples maybe logically organized into groups 
   180         *  with an unique `id` and may specify membership of other groups  
   181         *  by referring to their ids in the `groups` array. In this manner 
   182         *  the example producer can define a tree topology of examples for 
   183         *  their product.  Once the template groups are defined the  
   184         *  individual examples may specify their membership of a template 
   185         *  group in the `groups` array of {@link #TemplateInfo}. The example
   186         *  provider may specify all the defined groups for their product in 
   187         *  {@link #templateGroupArr}.
   188         *
   189         *  @field(id) Unique id for the template group
   190         *  @field(name) Name of the group
   191         *  @field(description) Description of the group
   192         *  @field(groups) Array of group ids used to specify
   193         *                 membership of other groups.
   194         * 
   195         */ 
   196    
   197       struct TemplateGroup {
   198            String id;
   199            String name;
   200            String description;
   201            String groups[];
   202       }; 
   203    
   204        
   205        /*!
   206         *  ======== templateArr ========
   207         *  Examples contained in the product
   208         *
   209         */ 
   210        config TemplateInfo templateArr[];
   211    
   212    
   213        /*!
   214         *  ======== templateGroupArr ========
   215         *  Array fo template group ids
   216         *
   217         *  This maybe optionally specified by example providers who want to
   218         *  organize their examples in groups. 
   219         */
   220    
   221        config TemplateGroup templateGroupArr[] = [];
   222    
   223    }
   224    /*
   225     *  @(#) xdc.tools.product; 1, 0, 0,38; 8-17-2010 16:39:21; /db/ztree/library/trees/xdctools/xdctools-d43x/src/
   226     */
   227