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 /*!
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 for their examples.
66 * IDEs may use the `Filter` properties of an example
67 * to decide whether the example should be presented to the user.
68 *
69 * The filter is evaluated by performing an 'AND' operation
70 * on its individual elements. In other words all the defined
71 * elements must evaluate to `true` for the filter to evaluate
72 * to `true`.
73 *
74 * Example {@link #TemplateInfo providers} typically define an
75 * array of filters. The filter array is evaluated using the 'OR' operation.
76 *
77 * The filter allows the user to define the NOT property by
78 * inserting a "~" character at the start of the string. For
79 * example if the deviceFamily field is set to "~MSP430" the example
80 * will be displayed for all device families except MSP430.
81 *
82 * @field(deviceFamily) String indicating the device family
83 * eg. "MSP430","C6000"
84 * @field(deviceVariant) String indicating device variant
85 * eg. "C674X", "CortexA8"
86 * @field(deviceId) String indicating the device part number
87 * eg. "TMS320C6747"
88 * @field(endianness) String indicating the device endianness
89 * eg. "little", "big"
90 * @field(toolChain) String indicating the tool chain
91 * eg. "TI", "GNU"
92 * @field(outputFormat) String indicating the object file format
93 * eg. "COFF", "ELF"
94 */
95 struct Filter {
96 String deviceFamily;
97 String deviceVariant;
98 String deviceId;
99 String endianness;
100 String toolChain;
101 String outputFormat;
102 };
103
104 /*!
105 * ======== TemplateInfo ========
106 * TemplateInfo structure
107 *
108 * @field(title) String containing the title of the template
109 * @field(fileList) Array of {@link #FileDesc} defining the
110 * properties of the files contributed by this example.
111 * @field(description) String containing description of example
112 * @field(target) String containing RTSC target
113 * @field(platform) String containing RTSC platform
114 * @field(buildProfile) String containing RTSC build profile
115 * @field(linkerCommandFile) Linker command file for the example. If
116 * this is set to the empty string then no
117 * linker command file is added by the IDE
118 * to the example. If this is not defined
119 * then the wizard picks the default
120 * linker command file for the selected device.
121 * @field(requiredProducts) Products required to build this
122 * example. Products are identified by
123 * their globally unique
124 * {@link xdc.tools.product.IProduct#id}
125 * eg. 'com.ti.bios'. Dependency on a
126 * minimum version of a product maybe
127 * defined in the following manner
128 * : <product-id>:<min-version>
129 * @field(groups) Array of strings referring example groups
130 * that a particular example may
131 * belong. Example providers may want to
132 * provide examples that are part of an
133 * existing example group eg."Empty Projects"
134 * that are defined elsewhere. The
135 * groups are identified by an unique id.
136 * @field(configOnly) Flag indicating to the IDE
137 * whether example contributes only
138 * to a RTSC configuration project.
139 * @field(isHybrid) Flag indicating to the IDE
140 * whether example contains RTSC
141 * configuration and target
142 * content files in one project.
143 * If this field is set to `true`
144 * then the IDE consuming this example will
145 * create one project with all the
146 * files. Otherwise multiple projects will
147 * be created - one containing the
148 * target content and the other containing
149 * the RTSC configuration files. This flag
150 * is applies only when `configOnly`
151 * flag is set to `false`.
152 * @field(filterArr) Array of {@link #Filter}. Used to specify
153 * the constraints for a particular
154 * example. The filter array is evaluated using
155 * an OR operation on the individual array
156 * elements. Note that individual elements
157 * within a {@link #Filter filter} is evaluated with the
158 * 'AND' operation.
159 *
160 */
161 struct TemplateInfo {
162 String title; /*! Title of example */
163 FileDesc fileList[]; /*! List of files along with properties
164 * for example
165 */
166 String description; /*! Description of example */
167 String target; /*! RTSC target */
168 String platform; /*! RTSC platform */
169 String buildProfile; /*! RTSC build profile */
170 String linkerCommandFile; /*! Linker command file for the example */
171 String requiredProducts[]; /*! List of products required to build
172 * this example
173 */
174 String groups[]; /*! Array of group ids */
175 Bool legacyTcf;
176 Bool configOnly; /*! Indicates whether only a RTSC
177 * configuration project should
178 * be created for this example.
179 */
180 Bool isHybrid; /*! Indicates whether application and
181 * configuration content exists in
182 * one project
183 */
184 Filter filterArr[]; /*! Array of filters for example */
185 };
186
187
188 /*!
189 * ======== TemplateGroup ========
190 * TemplateGroup structure
191 *
192 * This structure maybe used to define a hierarchy of examples
193 * for the product. Examples maybe logically organized into groups
194 * with an unique `id` and may specify membership of other groups
195 * by referring to their ids in the `groups` array. In this manner
196 * the example producer can define a tree topology of examples for
197 * their product. Once the template groups are defined the
198 * individual examples may specify their membership of a template
199 * group in the `groups` array of {@link #TemplateInfo}. The example
200 * provider may specify all the defined groups for their product in
201 * {@link #templateGroupArr}.
202 *
203 * @field(id) Unique id for the template group
204 * @field(name) Name of the group
205 * @field(description) Description of the group
206 * @field(groups) Array of group ids used to specify
207 * membership of other groups.
208 *
209 */
210
211 struct TemplateGroup {
212 String id;
213 String name;
214 String description;
215 String groups[];
216 };
217
218
219 /*!
220 * ======== templateArr ========
221 * Examples contained in the product
222 *
223 */
224 config TemplateInfo templateArr[];
225
226
227 /*!
228 * ======== templateGroupArr ========
229 * Array fo template group ids
230 *
231 * This maybe optionally specified by example providers who want to
232 * organize their examples in groups.
233 */
234
235 config TemplateGroup templateGroupArr[] = [];
236
237 }
238 /*
239 * @(#) xdc.tools.product; 1, 0, 0,40; 10-15-2010 11:41:34; /db/ztree/library/trees/xdctools/xdctools-d45x/src/
240 */
241