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         *  ======== FileDesc ========
    26         *  Structure defining properties of a file included in an example
    27         *
    28         *  @field(path)                    Path to file relative to the package
    29         *                                  containing the implementation of 
    30         *                                  `IProductTemplate`
    31         *  @field(excludeFromBuild)        Flag indicating whether file
    32         *                                  should be excluded from build inside
    33         *                                  an IDE project 
    34         *  @field(openOnCreation)          Flag indicating whether the file
    35         *                                  should be opened when a project
    36         *                                  containing the example file is created
    37         *                                  by the IDE. 
    38         *  @field(copyIntoConfiguration)   Flag indicating whether the file
    39         *                                  should be copied into RTSC 
    40         *                                  configuration. This flag 
    41         *                                  applies only when the `isHybrid`
    42         *                                  flag of the
    43         *                                  {@link #TemplateInfo template} is set
    44         *                                  to `false`.
    45         */ 
    46        struct FileDesc {
    47            String path;                    /*! path to file */
    48            Bool   excludeFromBuild;        /*! exclude from build */
    49            Bool   openOnCreation;          /*! open on project creation */
    50            Bool   copyIntoConfiguration;   /*! copy into RTSC configuration */
    51        };
    52    
    53        /*!
    54         *  ======== Filter ========
    55         *  Structure defining filter properties for an example
    56         *
    57         *  This structure allows products to define constraints for their
    58         *  examples. IDEs use the `Filter` properties of an example
    59         *  to decide whether the example should be presented to the user.
    60         *  
    61         *  The filter is evaluated by performing an 'AND' operation
    62         *  on its individual elements. In other words, all the defined
    63         *  elements must evaluate to `true` for the filter to evaluate
    64         *  to `true`.
    65         *
    66         *  Each example typically defines an array of more than one filter;
    67         *  see {@link #TemplateInfo TemaplteInfo.filterArr}. This filter array
    68         *  is evaluated using the 'OR' operation.  In other words, the example
    69         *  should be presented to the user when any one of the filters evaluate
    70         *  to `true`.
    71         *
    72         *  Each filter property below allows the user to define the NOT property
    73         *  by inserting a "~" character at the start of the string. For
    74         *  example, if the deviceFamily field is set to "~MSP430", the example
    75         *  will be displayed for all device families except "MSP430".
    76         *
    77         *  @field(deviceFamily)   String indicating the device family 
    78         *                         eg. "MSP430","C6000"
    79         *  @field(deviceVariant)  String indicating device variant
    80         *                         eg. "C674X", "CortexA8"
    81         *  @field(deviceId)       String indicating the device part number
    82         *                         eg. "TMS320C6747"
    83         *  @field(endianness)     String indicating the device endianness
    84         *                         eg. "little", "big"
    85         *  @field(toolChain)      String indicating the tool chain
    86         *                         eg. "TI", "GNU"
    87         *  @field(outputFormat)   String indicating the object file format
    88         *                         eg. "COFF", "ELF"
    89         */ 
    90        struct Filter {
    91            String deviceFamily; 
    92            String deviceVariant;
    93            String deviceId;    
    94            String endianness;
    95            String toolChain;
    96            String outputFormat;
    97        }; 
    98    
    99        /*!
   100         *  ======== TemplateInfo ========
   101         *  TemplateInfo structure 
   102         *
   103         *  @field(title)             String containing the title of the template
   104         *  @field(fileList)          Array of {@link #FileDesc} defining the
   105         *                            properties of the files contributed by this
   106         *                            example.
   107         *  @field(description)       String containing  description of example
   108         *  @field(target)            String containing RTSC target
   109         *  @field(platform)          String containing RTSC platform
   110         *  @field(buildProfile)      String containing RTSC build profile
   111         *  @field(linkerCommandFile) Linker command file for the example. If
   112         *                            this is set to the empty string then no
   113         *                            linker command file is added by the IDE
   114         *                            to the example. If this is not defined 
   115         *                            then the wizard picks the default
   116         *                            linker command file for the selected device. 
   117         *  @field(compilerBuildOptions) Special compiler options required to
   118         *                               build template. For example the template
   119         *                               may need special -I and -D options
   120         *                               to build and these maybe specified
   121         *                               here.
   122         *  @field(linkerBuildOptions)   Special linker options to build template
   123         *  @field(requiredProducts)  Products required to build this
   124         *                            example. Products are  identified by
   125         *                            their globally unique 
   126         *                            {@link xdc.tools.product.IProduct#id} 
   127         *                            eg. 'com.ti.bios'. Dependency on a 
   128         *                            minimum version of a product maybe
   129         *                            defined in the following manner
   130         *                            : <product-id>:<min-version>
   131         *  @field(groups)            Array of strings referring example groups
   132         *                            that a particular example may
   133         *                            belong. Products may
   134         *                            provide examples that are part of an
   135         *                            existing example group eg."Empty Projects" 
   136         *                            that are defined elsewhere. The
   137         *                            groups are identified by an unique id.
   138         *  @field(configOnly)        Flag indicating to the IDE
   139         *                            whether example contributes only
   140         *                            to a RTSC configuration project.
   141         *  @field(configuroOptions)  This string contains options that are passed
   142         *                            to `xdc.tools.configuro`.  You must be
   143         *                            careful to quote embedded special characters
   144         *                            in this string in such a way that they can
   145         *                            be directly embedded in an XML file.  For
   146         *                            example, to pass '-foo "bar"' to `configuro`
   147         *                            you must use the string
   148         *                            '-foo &quot;bar&quot;'.
   149         *                            
   150         *  @field(isHybrid)          Flag indicating to the IDE 
   151         *                            whether example contains RTSC 
   152         *                            configuration  and target 
   153         *                            content files in one project.
   154         *                            If this field is set to `true` 
   155         *                            then the IDE consuming this example will 
   156         *                            create one project with all the
   157         *                            files. Otherwise multiple projects will 
   158         *                            be created - one containing the
   159         *                            target content and the other containing 
   160         *                            the RTSC configuration files. This flag
   161         *                            is applies only when `configOnly`
   162         *                            flag is set to `false`.
   163         *  @field(filterArr)         Array of {@link #Filter}. Used to specify
   164         *                            the constraints for a particular
   165         *                            example. The filter array is evaluated using
   166         *                            an OR operation on the individual array
   167         *                            elements. Note that individual elements 
   168         *                            within a {@link #Filter filter} is evaluated
   169         *                            with the 'AND' operation. 
   170         *                          
   171         */ 
   172        struct TemplateInfo {
   173            String   title;              /*! Title of this example */
   174            FileDesc fileList[];         /*! List of files along with properties 
   175                                          *  for this example
   176                                          */
   177            String   description;        /*! Description of this example */
   178            String   target;             /*! RTSC target */
   179            String   platform;           /*! RTSC platform */
   180            String   buildProfile;       /*! RTSC build profile */
   181            String   linkerCommandFile;  /*! Linker command file for this example */
   182            String   compilerBuildOptions; /*! Special compiler options for this example */
   183            String   linkerBuildOptions;    /*! Special linker options for this example */
   184            String   requiredProducts[]; /*! List of products required to build
   185                                          *  this example
   186                                          */
   187            String   groups[];           /*! Array of group ids */ 
   188            Bool     legacyTcf;          
   189            String   configuroOptions;   /*! configuro options */
   190            Bool     configOnly;         /*! Indicates whether only a RTSC
   191                                          *  configuration project should
   192                                          *  be created for this example.
   193                                          */
   194            Bool     isHybrid;           /*! Indicates whether application and
   195                                          * configuration content exists in
   196                                          * one project
   197                                          */ 
   198            Filter   filterArr[];        /*! Array of filters for this example */
   199        };
   200    
   201    
   202        /*!
   203         *  ======== TemplateGroup ========
   204         *  TemplateGroup structure
   205         *
   206         *  This structure maybe used to define a hierarchy of examples
   207         *  for the product. Examples maybe logically organized into groups 
   208         *  with an unique `id` and may specify membership of other groups  
   209         *  by referring to their ids in the `groups` array. In this manner 
   210         *  the example producer can define a tree topology of examples for 
   211         *  their product.  Once the template groups are defined the  
   212         *  individual examples may specify their membership of a template 
   213         *  group in the `groups` array of {@link #TemplateInfo}. The example
   214         *  provider may specify all the defined groups for their product in 
   215         *  {@link #templateGroupArr}.
   216         *
   217         *  @field(id) Unique id for the template group
   218         *  @field(name) Name of the group
   219         *  @field(description) Description of the group
   220         *  @field(groups) Array of group ids used to specify
   221         *                 membership of other groups.
   222         * 
   223         */ 
   224    
   225        struct TemplateGroup {
   226            String id;
   227            String name;
   228            String description;
   229            String groups[];
   230        }; 
   231        
   232        /*!
   233         *  ======== templateArr ========
   234         *  Examples contained in the product
   235         *
   236         */ 
   237        config TemplateInfo templateArr[];
   238    
   239        /*!
   240         *  ======== templateGroupArr ========
   241         *  Array fo template group ids
   242         *
   243         *  This maybe optionally specified by Products that
   244         *  organize their examples into groups. 
   245         */
   246        config TemplateGroup templateGroupArr[] = [];
   247    }
   248    /*
   249     *  @(#) xdc.tools.product; 1, 0, 0,65; 11-4-2011 09:12:41; /db/ztree/library/trees/xdctools/xdctools-f07x/src/
   250     */
   251