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 metaonlyinterface 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 TemplateInfo.filterArr}. This filter array
68 * is evaluated using the 'OR' operation. In other words, the example
69 * is 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 may be 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 may be
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 "bar"'.
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 * @field(options) Comma separated list of options used to
172 * specify various configurable items for this
173 * template. For example, the projectspec
174 * tools recognizes the following flags:
175 * "NPW" - display this example in the New
176 * Project Wizard, and
177 * "TREX" - display this example in the
178 * Resource Explorer
179 */
180 struct TemplateInfo {
181 String title; /*! Title of this example */
182 FileDesc fileList[]; /*! List of files along with properties
183 * for this example
184 */
185 String description; /*! Description of this example */
186 String target; /*! RTSC target */
187 String platform; /*! RTSC platform */
188 String buildProfile; /*! RTSC build profile */
189 String linkerCommandFile; /*! Linker command file for this example */
190 String compilerBuildOptions; /*! Special compiler options for this example */
191 String linkerBuildOptions; /*! Special linker options for this example */
192 String requiredProducts[]; /*! List of products required to build
193 * this example
194 */
195 String groups[]; /*! Array of group ids for groups
196 * containing this example */
197 Bool legacyTcf; /* obsolete option */
198 String configuroOptions; /*! configuro options */
199 Bool configOnly; /*! Indicates whether only a RTSC
200 * configuration project should
201 * be created for this example.
202 */
203 Bool isHybrid; /*! Indicates whether application and
204 * configuration content exists in
205 * one project
206 */
207 Filter filterArr[]; /*! Array of filters for this example */
208 String options; /*! Comma separated attributes for the example */
209 };
210
211 /*!
212 * ======== TemplateGroup ========
213 * TemplateGroup structure
214 *
215 * This structure may be used to define a hierarchy of examples
216 * for the product. Examples may be logically organized into groups
217 * with an unique `id` and may specify membership of other groups
218 * by referring to their ids in the `groups` array. In this manner
219 * the example producer can define a tree topology of examples for
220 * their product. Once the template groups are defined, the
221 * individual examples may specify their membership within a template
222 * group in the `groups` array of {@link #TemplateInfo}. The example
223 * provider may specify all the defined groups for their product in
224 * {@link #templateGroupArr}.
225 *
226 * @field(id) Unique id for the template group
227 * @field(name) Name of the group
228 * @field(description) Description of the group
229 * @field(groups) Array of group ids used to specify
230 * membership of other groups.
231 *
232 */
233 struct TemplateGroup {
234 String id;
235 String name;
236 String description;
237 String groups[];
238 };
239
240 /*!
241 * ======== templateArr ========
242 * Examples contained in the product
243 */
244 config TemplateInfo templateArr[];
245
246 /*!
247 * ======== templateGroupArr ========
248 * Array of template group ids
249 *
250 * This array may be optionally specified by Products that
251 * organize their examples into groups.
252 */
253 config TemplateGroup templateGroupArr[] = [];
254 }
255 /*
256 * @(#) xdc.tools.product; 1, 0, 0,73; 8-27-2012 11:53:06; /db/ztree/library/trees/xdctools/xdctools-f15x/src/
257 */
258