Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 91dc116939ff7e0029df7c28221e1866643c4e52 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
/*******************************************************************************
 * Copyright (c) 2005, 2006 Intel Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Intel Corporation - Initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core;

import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.content.IContentType;

/**
 * This interface represents an inputType instance in the managed build system.
 * It describes one category of input files to a Tool.  A tool can have 
 * multiple inputType children.
 * 
 * @since 3.0
 */
public interface IInputType extends IBuildObject {
	public static final String INPUT_TYPE_ELEMENT_NAME = "inputType";	//$NON-NLS-1$
	public static final String SOURCE_CONTENT_TYPE = "sourceContentType";	//$NON-NLS-1$
	public static final String SOURCES = "sources";	//$NON-NLS-1$
	public static final String DEPENDENCY_CONTENT_TYPE = "dependencyContentType";	//$NON-NLS-1$
	public static final String DEPENDENCY_EXTENSIONS = "dependencyExtensions";	//$NON-NLS-1$
	public static final String OPTION = "option";	//$NON-NLS-1$
	public static final String ASSIGN_TO_OPTION = "assignToOption";	//$NON-NLS-1$
	public static final String MULTIPLE_OF_TYPE = "multipleOfType";	//$NON-NLS-1$
	public static final String PRIMARY_INPUT = "primaryInput";	//$NON-NLS-1$
	public static final String BUILD_VARIABLE = "buildVariable";	//$NON-NLS-1$
	
	/**
	 * Creates an inputOrder child for this InputType.
	 * 
	 * @param path The path associated with the InputOrder element
	 * @return IInputOrder of the new element
	 */
	public IInputOrder createInputOrder(String path);

	/**
	 * Removes the InputOrder element with the path specified in the argument.
	 * 
	 * @param path The path associated with the InputOrder element
	 */
	public void removeInputOrder(String path);

	/**
	 * Removes the InputOrder element specified in the argument.
	 * 
	 * @param path The InputOrder element
	 */
	public void removeInputOrder(IInputOrder element);

	/**
	 * Returns all of the InputOrder children of this InputType
	 * 
	 * @return IInputOrder[]
	 */
	public IInputOrder[] getInputOrders();

	/**
	 * Returns the InputOrder element with the path specified in the argument.
	 * 
	 * @param path The path associated with the InputOrder element
	 * @return IInputOrder
	 */
	public IInputOrder getInputOrder(String path);
	
	/**
	 * Creates an additionalInput child for this InputType.
	 * 
	 * @param path The path associated with the AdditionalInput element
	 * @return IAdditionalInput of the new element
	 */
	public IAdditionalInput createAdditionalInput(String path);

	/**
	 * Removes the AdditionalInput element with the path specified in the argument.
	 * 
	 * @param path The path associated with the AdditionalInput element
	 */
	public void removeAdditionalInput(String path);

	/**
	 * Removes the AdditionalInput element specified in the argument.
	 * 
	 * @param element The AdditionalInput element
	 */
	public void removeAdditionalInput(IAdditionalInput element);

	/**
	 * Returns all of the AdditionalInput children of this InputType
	 * 
	 * @return IAdditionalInput[]
	 */
	public IAdditionalInput[] getAdditionalInputs();

	/**
	 * Returns the AdditionalInput element with the path specified in the argument.
	 * 
	 * @param path The path associated with the AdditionalInput element
	 * @return IAdditionalInput
	 */
	public IAdditionalInput getAdditionalInput(String path);

	/**
	 * Returns all of the additional input resources of this InputType.
	 * Note: This does not include additional dependencies.
	 * 
	 * @return IPath[]
	 */
	public IPath[] getAdditionalResources();

	/**
	 * Returns all of the additional dependency resources of this InputType.
	 * Note: This does not include additional inputs.
	 * 
	 * @return IPath[]
	 */
	public IPath[] getAdditionalDependencies();

	/**
	 * Returns the tool parent of this InputType.
	 * 
	 * @return ITool
	 */
	public ITool getParent();

	/**
	 * Returns the <code>IInputType</code> that is the superclass of this
	 * InputType, or <code>null</code> if the attribute was not specified.
	 * 
	 * @return IInputType
	 */
	public IInputType getSuperClass();
	
	/**
	 * Returns the Eclipse <code>IContentType</code> that describes this
	 * input type.  If both the sources attribute and the sourceContentType 
	 * attribute are specified, the sourceContentType will be used if it 
	 * is registered in Eclipse. 
	 * 
	 * @return IContentType
	 */
	public IContentType getSourceContentType();
	
	/**
	 * Sets the Eclipse <code>IContentType</code> that describes this
	 * input type.
	 * 
	 * @param contentType  The Eclipse content type
	 */
	public void setSourceContentType(IContentType contentType);
	
	/**
	 * Returns the list of valid source extensions from the
	 * sourceExtensions attribute. Note that this value is not used
	 * if source content type is specified and registered with Eclipse.
	 * Also, the user will not be able to modify the set of file 
	 * extensions as they can when sourceContentType is specified.
	 * 
	 * @return String[]
	 */
	public String[] getSourceExtensionsAttribute();
	
	/**
	 * Sets the list of valid source extensions for this input type.
	 * NOTE: The value of this attribute will NOT be used if a 
	 *       source content type is specified and is registered with
	 *       Eclipse.
	 * 
	 * @param extensions  The comma-separated list of valid file extensions
	 *                    - not including the separator period.
	 */
	public void setSourceExtensionsAttribute(String extensions);
	
	/**
	 * Returns the list of valid source extensions for this input type.
	 * Note that the list will come from the sourceContentType if it 
	 * is specified and registered with Eclipse.  Otherwise the  
	 * sourceExtensions attribute will be used.
	 * 
     * @param tool  the tool that contains the input-type
	 * @return String[]
	 */
	public String[] getSourceExtensions(ITool tool);
	
	/**
	 * Answers <code>true</code> if the input type considers the file extension to be 
	 * one associated with a source file.
	 * 
     * @param tool  the tool that contains the input-type
	 * @param ext  file extension of the source
	 * @return boolean
	 */
	public boolean isSourceExtension(ITool tool, String ext);

	/**
	 * Returns the Eclipse <code>IContentType</code> that describes the
	 * dependency files of this input type.  If both the dependencyExtensions
	 * attribute and the dependencyContentType attribute are specified,
	 * the dependencyContentType will be used if it is defined in Eclipse. 
	 * 
	 * @return IContentType
	 */
	public IContentType getDependencyContentType();

	/**
	 * Sets the Eclipse <code>IContentType</code> that describes the
	 * dependency files of this input type. 
	 * 
	 * @return type
	 */
	public void setDependencyContentType(IContentType type);
	
	/**
	 * Returns the list of valid dependency extensions from the
	 * dependencyExtensions attribute. Note that this value is not used
	 * if dependency content type is specified and registered with Eclipse.
	 * Also, the user will not be able to modify the set of file 
	 * extensions as they can when dependencyContentType is specified.
	 * 
	 * @return String[]
	 */
	public String[] getDependencyExtensionsAttribute();
	
	/**
	 * Sets the list of valid dependency extensions for this input type.
	 * NOTE: The value of this attribute will NOT be used if a 
	 *       dependency content type is specified and is registered with
	 *       Eclipse.
	 * 
	 * @param extensions  The comma-separated list of valid dependency extensions
	 *                    - not including the separator period.
	 */
	public void setDependencyExtensionsAttribute(String extensions);
	
	/**
	 * Returns the list of valid dependency extensions for this input type.
	 * Note that the list will come from the dependencyContentType if it 
	 * is specified and registered with Eclipse.  Otherwise the  
	 * dependencyExtensions attribute will be used.
	 * 
     * @param tool  the tool that contains the input-type
	 * @return String[]
	 */
	public String[] getDependencyExtensions(ITool tool);
	
	/**
	 * Answers <code>true</code> if the input type considers the file extension to be 
	 * one associated with a dependency file.
	 * 
     * @param tool  the tool that contains the input-type
	 * @param ext  file extension of the source
	 * @return boolean
	 */
	public boolean isDependencyExtension(ITool tool, String ext);

	/**
	 * Returns the id of the option that is associated with this input
	 * type on the command line.  If specified, the name(s) of the input
	 * files for this input type are taken from the value specified 
	 * for the option.
	 * 
	 * @return String
	 */
	public String getOptionId();

	/**
	 * Sets the id of the option that is associated with this input type on 
	 * the command line.  If specified, the name(s) of the input files for 
	 * this input type are taken from the value specified for the option.
	 * 
	 * @param optionId  
	 */
	public void setOptionId(String optionId);

	/**
	 * Returns the id of the option whose value is to be assigned to the 
	 * file(s) calculated for this input type.  The default is not to 
	 * assign the input file(s) to a command line option but to assign the 
	 * files to the ${Inputs} part of the command line.  Note that the
	 * option value is only updated during build file generation and therefore
	 * could be out of sync with the project until build file generation 
	 * occurs.
	 * 
	 * @return String
	 */
	public String getAssignToOptionId();

	/**
	 * Sets the id of the option whose value is to be assigned to the 
	 * file(s) calculated for this input type.  The default is not to 
	 * assign the input file(s) to a command line option but to assign the 
	 * files to the ${Inputs} part of the command line.  Note that the
	 * option value is only updated during build file generation and therefore
	 * could be out of sync with the project until build file generation 
	 * occurs.
	 * 
	 * @param optionId  
	 */
	public void setAssignToOptionId(String optionId);
		
	/**
	 * Returns <code>true</code> if this inputType can contain multiple input
	 * resources, else <code>false</code>.  The inputs can be project resources, 
	 * or the outputs of other tools in the tool-chain.
	 * 
	 * @return boolean 
	 */
	public boolean getMultipleOfType();
	
	/**
	 * Sets whether this inputType can contain multiple input resources
	 * 
	 * @param multiple   
	 */
	public void setMultipleOfType(boolean multiple);
	
	/**
	 * Returns <code>true</code> if this inputType is considered the primary input
	 * of the tool, else <code>false</code>.
	 * 
	 * @return boolean 
	 */
	public boolean getPrimaryInput();
	
	/**
	 * Sets whether this inputType is considered the primary input of the tool
	 * 
	 * @param primary   
	 */
	public void setPrimaryInput(boolean primary);

	/**
	 * Returns a class instance that implements an interface to generate 
	 * source-level dependencies for this input type. 
	 * This method may return <code>null</code> in which case, the receiver 
	 * should assume that the input type does not require dependency information 
	 * when the project is built.
	 *
	 * @return IManagedDependencyGeneratorType
	 */
	public IManagedDependencyGeneratorType getDependencyGenerator();

	/**
	 * Returns the name of the build variable associated this this input type's resources
	 * The build variable used in the build file to represent the list of input files when 
	 * multipleOfType is True.  The same variable name can be used by an outputType to 
	 * identify a set of output files that contribute to this tool’s input 
	 * (i.e., those using the same buildVariable name).  The default name is chosen by MBS.
	 * 
	 * @return String
	 */
	public String getBuildVariable();

	/**
	 * Sets the name of the build variable associated this this input type's resources
	 * 
	 * @return variableName
	 */
	public void setBuildVariable(String variableName);

	/**
	 * Returns <code>true</code> if this element has changes that need to 
	 * be saved in the project file, else <code>false</code>.
	 * 
	 * @return boolean 
	 */
	public boolean isDirty();
	
	/**
	 * Returns <code>true</code> if this InputType was loaded from a manifest file,
	 * and <code>false</code> if it was loaded from a project (.cdtbuild) file.
	 * 
	 * @return boolean 
	 */
	public boolean isExtensionElement();
	
	/**
	 * Sets the element's "dirty" (have I been modified?) flag.
	 * 
	 * @param isDirty
	 */
	public void setDirty(boolean isDirty);
	
}

Back to the top