mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Initial check-in for multiple input & output design
This commit is contained in:
parent
dd0c8223c8
commit
1c7f6f77c0
34 changed files with 8276 additions and 1443 deletions
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2004 Intel Corporation and others.
|
||||
* Copyright (c) 2004, 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -89,8 +89,8 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
String expectedSuperToolId1 = "cdt.managedbuild.tool.testgnu.c.compiler";
|
||||
String expectedSuperOutputFlag1 = "-o";
|
||||
String expectedSuperGetToolCommand1 = "gcc";
|
||||
String expectedSuperInputExt1 = "c";
|
||||
String expectedSuperToolInterfaceExt1 = "h";
|
||||
String[] expectedSuperInputExt1 = {"c"};
|
||||
String[] expectedSuperToolInterfaceExt1 = {"h"};
|
||||
String[] expectedSuperToolOutputExt1 = {"o"};
|
||||
String expectedOptionCategory1 = "testgnu.c.compiler.category.preprocessor";
|
||||
String[] OptionId1 = {"testgnu.c.compiler.exe.debug.option.optimization.level",
|
||||
|
@ -180,21 +180,11 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
assertEquals(tool.getId(), expectedToolId1[iconfig]);
|
||||
assertEquals(superTool.getId(), expectedSuperToolId1);
|
||||
assertEquals(tool.getNatureFilter(), expecectedCNature);
|
||||
List expectedSuperInputExt1List = new ArrayList();
|
||||
String[] expectedSuperInputExt1Tokens = expectedSuperInputExt1.split(","); //$NON-NLS-1$
|
||||
for (i = 0; i < expectedSuperInputExt1Tokens.length; ++i) {
|
||||
expectedSuperInputExt1List.add(expectedSuperInputExt1Tokens[i].trim());
|
||||
}
|
||||
assertEquals(superTool.getInputExtensions(), expectedSuperInputExt1List);
|
||||
assertTrue(Arrays.equals(superTool.getAllInputExtensions(), expectedSuperInputExt1));
|
||||
assertEquals(superTool.getOutputFlag(), expectedSuperOutputFlag1);
|
||||
assertEquals(superTool.getToolCommand(), expectedSuperGetToolCommand1);
|
||||
assertTrue(Arrays.equals(superTool.getOutputExtensions(), expectedSuperToolOutputExt1));
|
||||
List expectedSuperInterfaceExt1List = new ArrayList();
|
||||
String[] expectedSuperInterfaceExt1Tokens = expectedSuperToolInterfaceExt1.split(","); //$NON-NLS-1$
|
||||
for (i = 0; i < expectedSuperInterfaceExt1Tokens.length; ++i) {
|
||||
expectedSuperInterfaceExt1List.add(expectedSuperInterfaceExt1Tokens[i].trim());
|
||||
}
|
||||
assertEquals(superTool.getInterfaceExtensions(), expectedSuperInterfaceExt1List);
|
||||
assertTrue(Arrays.equals(superTool.getAllDependencyExtensions(), expectedSuperToolInterfaceExt1));
|
||||
assertTrue(Arrays.equals(superTool.getOutputsAttribute(), expectedSuperToolOutputExt1));
|
||||
|
||||
assertTrue(superTool.isAbstract());
|
||||
|
||||
|
@ -276,7 +266,7 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
String[] expectedToolOutput = {""};
|
||||
String expectedSuperOutputFlag1 = "-o";
|
||||
String expectedSuperGetToolCommand1 = "gcc";
|
||||
String expectedSuperInputExt1 = "o";
|
||||
String[] expectedSuperInputExt1 = {"o"};
|
||||
String[] expectedSuperToolOutputExt1 = {""};
|
||||
String expectedOptionCategory1 = "testgnu.c.link.category.general";
|
||||
String OptionId1A = "testgnu.c.link.option.libs";
|
||||
|
@ -371,16 +361,11 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
assertEquals(superTool.getId(), expectedSuperToolId1);
|
||||
assertEquals(tool.getNatureFilter(), expecectedCNature);
|
||||
assertEquals(tool.getOutputPrefix(), expectedToolOutputPrefix);
|
||||
assertTrue(Arrays.equals(superTool.getOutputExtensions(), expectedToolOutput));
|
||||
List expectedSuperInputExt1List = new ArrayList();
|
||||
String[] expectedSuperInputExt1Tokens = expectedSuperInputExt1.split(","); //$NON-NLS-1$
|
||||
for (i = 0; i < expectedSuperInputExt1Tokens.length; ++i) {
|
||||
expectedSuperInputExt1List.add(expectedSuperInputExt1Tokens[i].trim());
|
||||
}
|
||||
assertEquals(superTool.getInputExtensions(), expectedSuperInputExt1List);
|
||||
assertTrue(Arrays.equals(superTool.getOutputsAttribute(), expectedToolOutput));
|
||||
assertTrue(Arrays.equals(superTool.getAllInputExtensions(), expectedSuperInputExt1));
|
||||
assertEquals(superTool.getOutputFlag(), expectedSuperOutputFlag1);
|
||||
assertEquals(superTool.getToolCommand(), expectedSuperGetToolCommand1);
|
||||
assertTrue(Arrays.equals(superTool.getOutputExtensions(), expectedSuperToolOutputExt1));
|
||||
assertTrue(Arrays.equals(superTool.getOutputsAttribute(), expectedSuperToolOutputExt1));
|
||||
|
||||
// Fetch and check an option category
|
||||
//
|
||||
|
@ -476,8 +461,8 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
String expectedSuperToolId1 = "cdt.managedbuild.tool.testgnu.cpp.compiler";
|
||||
String expectedSuperOutputFlag1 = "-o";
|
||||
String expectedSuperGetToolCommand1 = "g++";
|
||||
String expectedSuperInputExt1 = "c,C,cc,cxx,cpp";
|
||||
String expectedSuperToolInterfaceExt1 = "h,H,hpp";
|
||||
String[] expectedSuperInputExt1 = {"c","C","cc","cxx","cpp"};
|
||||
String[] expectedSuperToolInterfaceExt1 = {"h","H","hpp"};
|
||||
String[] expectedSuperToolOutputExt1 = {"o"};
|
||||
String expectedOptionCategory1 = "testgnu.cpp.compiler.category.preprocessor";
|
||||
String[] OptionId1 = {"testgnu.cpp.compiler.lib.debug.option.optimization.level",
|
||||
|
@ -569,22 +554,11 @@ public class ManagedBuildCoreTests extends TestCase {
|
|||
assertEquals(tool.getId(), expectedToolId1[iconfig]);
|
||||
assertEquals(superTool.getId(), expectedSuperToolId1);
|
||||
assertEquals(tool.getNatureFilter(), expecectedCCNature);
|
||||
|
||||
List expectedSuperInputExt1List = new ArrayList();
|
||||
String[] expectedSuperInputExt1Tokens = expectedSuperInputExt1.split(","); //$NON-NLS-1$
|
||||
for (i = 0; i < expectedSuperInputExt1Tokens.length; ++i) {
|
||||
expectedSuperInputExt1List.add(expectedSuperInputExt1Tokens[i].trim());
|
||||
}
|
||||
assertEquals(superTool.getInputExtensions(), expectedSuperInputExt1List);
|
||||
assertTrue(Arrays.equals(superTool.getAllInputExtensions(), expectedSuperInputExt1));
|
||||
assertEquals(superTool.getOutputFlag(), expectedSuperOutputFlag1);
|
||||
assertEquals(superTool.getToolCommand(), expectedSuperGetToolCommand1);
|
||||
List expectedSuperInterfaceExt1List = new ArrayList();
|
||||
String[] expectedSuperInterfaceExt1Tokens = expectedSuperToolInterfaceExt1.split(","); //$NON-NLS-1$
|
||||
for (i = 0; i < expectedSuperInterfaceExt1Tokens.length; ++i) {
|
||||
expectedSuperInterfaceExt1List.add(expectedSuperInterfaceExt1Tokens[i].trim());
|
||||
}
|
||||
assertEquals(superTool.getInterfaceExtensions(), expectedSuperInterfaceExt1List);
|
||||
assertTrue(Arrays.equals(superTool.getOutputExtensions(), expectedSuperToolOutputExt1));
|
||||
assertTrue(Arrays.equals(superTool.getAllDependencyExtensions(), expectedSuperToolInterfaceExt1));
|
||||
assertTrue(Arrays.equals(superTool.getOutputsAttribute(), expectedSuperToolOutputExt1));
|
||||
|
||||
// Fetch and check an option category
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
|
|
@ -188,34 +188,34 @@
|
|||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="prebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the pre-build command, which runs prior to the standard MBS build.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="postbuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the post-build command, which runs after the standard MBS build.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="preannouncebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the string to be displayed when the pre-build command step is run.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="postannouncebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the string to be displayed when the post-build command step is run.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="prebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the pre-build command, which runs prior to the standard MBS build.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="postbuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the post-build command, which runs after the standard MBS build.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="preannouncebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the string to be displayed when the pre-build command step is run.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="postannouncebuildStep" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the string to be displayed when the post-build command step is run.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
|
@ -294,6 +294,20 @@
|
|||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="targetTool" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the id of the Tool that creates the final build artifact (the end target of the build).
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="secondaryOutputs" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A semi-colon separated list of IDs of other outputTypes, besides the primary outputType of the targetTool, that are also considered to be build artifacts.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="isToolChainSupported" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
@ -344,6 +358,8 @@
|
|||
<sequence>
|
||||
<element ref="option"/>
|
||||
<element ref="optionCategory"/>
|
||||
<element ref="inputType"/>
|
||||
<element ref="outputType"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
|
@ -383,22 +399,31 @@
|
|||
<attribute name="sources" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of file extensions that the tool will produce output for.
|
||||
Deprecated - use the InputType element.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute deprecated="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="headerExtensions" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of file extensions that are used for header files. Since many other files depend on the interfaces defined in header files, the build system needs to be able to determine that a header file has changed to properly rebuild its dependents.
|
||||
Deprecated - use the InputType element.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute deprecated="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputs" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The extension that the tool will produce from a given input.
|
||||
Deprecated - use the OutputType element.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute deprecated="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputFlag" type="string">
|
||||
|
@ -411,8 +436,11 @@
|
|||
<attribute name="outputPrefix" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be lib<target>.a, so 'lib' would be the prefix.
|
||||
Deprecated - use the OutputType element.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute deprecated="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="natureFilter">
|
||||
|
@ -442,7 +470,7 @@
|
|||
<attribute name="commandLinePattern" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the command "pattern" that indicates how the parts of the command line are used to create the entire command line. The pattern consists of the replaceable variables command, flags, outputFlag, output, and inputs. The default pattern is ${command} ${flags} ${outputflag}${output} ${inputs} White space and other characters are significant and are copied to the generated command.
|
||||
Specifies the command "pattern" that indicates how the parts of the command line are used to create the entire command line. The pattern consists of the replaceable variables command, flags, outputFlag, output, and inputs. The default pattern is ${command} ${flags} ${outputflag}${output} ${inputs}, except when customBuildStep is true, where the default is $(command). White space and other characters are significant and are copied to the generated command.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -459,10 +487,10 @@
|
|||
<attribute name="dependencyCalculator" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
This is an optional field that specifies the class that provides the source file dependency calculation for a given tool. You can replace the default calculator with a class that implements the <code>IManagedDependencyGenerator</code> interface.
|
||||
Deprecated - use the InputType element.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator"/>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator" deprecated="true"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
|
@ -473,6 +501,304 @@
|
|||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="advancedInputCategory" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether the Tool wants the MBS to display the Advanced Input category with the Tool's property categories. This allows the user to specify input order and additional inputs. The default is false.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="customBuildStep" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether this Tool represents a user-define custom build step. The default is false.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="announcement" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies a string that is written to the build output prior to each invocation of the tool. The default value is “Invoking tool-name (tool-id)…”
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="inputType">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Defines a type of input for the tool. Note that the calculated dependencies of an input type are not described by a separate input type, but are described by attributes of this element.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence>
|
||||
<element ref="inputOrder"/>
|
||||
<element ref="additionalInput"/>
|
||||
</sequence>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A unique identifier for the input-type that will be used by the build model.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The name of the input type that is displayed to the user in the UI.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="superClass" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an input-type that this input-type is derived from.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="sourceContentType" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an Eclipse content type that describes this type of input. Either this attribute or the sources attribute must be specified by this element or a superclass. If both are specified, and the content type specified here is defined by Eclipse, the sources attribute is not used.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="sources" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of file extensions that identify files of this input type. Note that the user will not be able to modify the set of file extensions as they can when sourceContentType is specified.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="dependencyContentType" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an Eclipse content type that describes the calculated dependencies for this type of input. If dependencyExtensions is also specified, and the content type specified here is defined by Eclipse, the dependencyExtensions attribute is not used.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="dependencyExtensions" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of file extensions that are used for calculated dependencies of this input-type. Note that the user will not be able to modify the set of file extensions as they can when dependencyContentType is specified.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="option" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an Option element that is used on the command line to identify inputs of this type. The default when not specified is to assign the inputs to the ${Inputs} part of the command line.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="multipleOfType" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether all inputs of this type are used in one invocation of the tool. The inputs can be project resources, and the outputs of other Tools in the Tool-chain. The default is false.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="primaryInput" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether this is considered the primary input of the tool. The default is false.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="dependencyCalculator" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies the class that provides the source file dependency calculation for this input-type. You can replace the default calculator with a class that implements the <code>IManagedDependencyGenerator</code> interface.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="buildVariable" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A variable used in the build file to represent the input files when multipleOfType is True. The same variable name can be used in an outputType element to identify a set of output files that contribute to this tool's input. The default name is chosen by MBS.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="inputOrder">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Describes optional, ordering, information regarding the inputs of an inputType.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<attribute name="path" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Defines the relative or absolute path of the resource to which this element applies. The resource must be a member of the project, or the output from another tool in the tool-chain.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="order" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of integer values that specify the input order of this resource. In most cases, a single value is used. A list is used if the same input resource appears multiple times in the input list. The order number begins at 1. All unordered input resources fill the first gap in the specified order values.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="excluded" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
If True, this input resource is not used as an input to the tool.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="additionalInput">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Describes optional information regarding additional inputs and/or dependencies.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<attribute name="paths" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Defines a semi-colon delimited list of relative or absolute paths of the resource to which this element applies. The resources must be a member of the project, the output from another tool in the tool-chain, or an external file. The file name of the path can use GNU Make pattern rule syntax in order to generate the name from the filename of the input file.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="kind">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Defines the type of additional input, whether the resource is added to the dependency list, the inputs on the command line, or both.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<simpleType>
|
||||
<restriction base="string">
|
||||
<enumeration value="additionalinput">
|
||||
</enumeration>
|
||||
<enumeration value="additionalinputdependency">
|
||||
</enumeration>
|
||||
<enumeration value="additionaldependency">
|
||||
</enumeration>
|
||||
</restriction>
|
||||
</simpleType>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="outputType">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Defines a type of output for the tool.
|
||||
</documentation>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<attribute name="id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A unique identifier for the output-type that will be used by the build model.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The name of the output type that is displayed to the user in the UI.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="superClass" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an output-type that this output-type is derived from.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputContentType" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an Eclipse content type that describes this type of output. Either this attribute or the outputs attribute must be specified by this element or a superclass. If both are specified, and the content type specified here is defined by Eclipse, the outputs attribute is not used.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputs" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A comma-separated list of file extensions that identify files of this output type. Note that the user will not be able to modify the set of file extensions as they can when outputContentType is specified.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="option" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of an Option element that is used on the command line to identify outputs of this type. The default is to use the Tool outputFlag attribute if primaryOutput is True. If primaryOutput is False, the default is to not add the output(s) to the command line. If specified, the nameProvider, namePattern and outputNames are ignored.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="multipleOfType" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether multiple outputs of this type are created by one invocation of the tool. The default is False. If True, the nameProvider attribute or outputNames attribute must be specified.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="primaryInputType" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The id of the input-type that this output-type is created from. It is used in determining the build "rules" for the output-type, and for the default name of the output file.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="primaryOutput" type="boolean">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies whether this is the primary output of the tool. The default is False.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputPrefix" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Some tools produce files with a special prefix that must be specified. For example, a librarian on POSIX systems expects the output to be libtarget.a, so 'lib' would be the prefix.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="outputNames" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A semi-colon delimited list of the complete set of output file names generated for this outputType. If specified, the namePattern is ignored.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="namePattern" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
Specifies a pattern, using the Gnu Make pattern rule syntax, for deriving the output resource name from the input resource name. The default is to use the input resource base name with the first output extension.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="nameProvider" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
The name of the class that implements the <code>IManagedOutputNameProvider</code> interface. If specified, the outputNames and namePattern are ignored. This attribute must be specified when multipleOfType is True.
|
||||
</documentation>
|
||||
<appInfo>
|
||||
<meta.attribute kind="java" basedOn="org.eclipse.cdt.managedbuilder.core.IManagedOutputNameProvider"/>
|
||||
</appInfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="buildVariable" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
A variable used in the build file to represent the output file(s). The same variable name can be used in an inputType element to identify a set of output files that contribute to a tool's input. The default name is chosen by MBS.
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
|
@ -580,8 +906,8 @@
|
|||
<attribute name="valueType" use="default" value="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
General options can be one of the following types; 'string' for catch-all entries for options that cannot be easily defined any other way, 'string list' for entries that consist of a list of values such as defined symbols or paths, 'boolean' for options that have two values, and 'enumerated' for options that are one-of a list of values.
|
||||
|
||||
General options can be one of the following types; 'string' for catch-all entries for options that cannot be easily defined any other way, 'string list' for entries that consist of a list of values such as defined symbols or paths, 'boolean' for options that have two values, and 'enumerated' for options that are one-of a list of values.
|
||||
|
||||
Additional special types exist to flag options of special relevance to the build model; 'include', 'libs', 'userObjs' and 'definedSymbols'. You can pre-populate with optionValues, and they will display in the UI the same way the 'stringList' options do. The build model will look specifically for these value types when clients query for include paths and preprocessor defines. The makefile generator will treat the libs and userObjs entries differently than other stringLists.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
@ -905,14 +1231,14 @@ Additional special types exist to flag options of special relevance to the build
|
|||
<element name="managedBuildRevision">
|
||||
<annotation>
|
||||
<documentation>
|
||||
<p>
|
||||
Version identifier for the managed build extension point. It is a string representation, consisting of three (3) tokens separated by a decimal point. The 3 tokens are positive integer numbers. For example, the following are valid version identifiers:
|
||||
<ul>
|
||||
<li><code>0.0.0</code></li>
|
||||
<li><code>1.0.1234</code></li>
|
||||
<li><code>1.9</code> (interpreted as <code>1.9.0</code>)</li>
|
||||
<li><code>3</code> (interpreted as <code>3.0.0</code>)</li>
|
||||
</ul>
|
||||
<p>
|
||||
Version identifier for the managed build extension point. It is a string representation, consisting of three (3) tokens separated by a decimal point. The 3 tokens are positive integer numbers. For example, the following are valid version identifiers:
|
||||
<ul>
|
||||
<li><code>0.0.0</code></li>
|
||||
<li><code>1.0.1234</code></li>
|
||||
<li><code>1.9</code> (interpreted as <code>1.9.0</code>)</li>
|
||||
<li><code>3</code> (interpreted as <code>3.0.0</code>)</li>
|
||||
</ul>
|
||||
</p>
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
@ -941,14 +1267,14 @@ Version identifier for the managed build extension point. It is a string represe
|
|||
<meta.section type="examples"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
The following is an example of the extension point usage:
|
||||
<p>
|
||||
<pre>
|
||||
<extension
|
||||
id="buildExample"
|
||||
name="Definitions for Build Example"
|
||||
point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
|
||||
etc...
|
||||
The following is an example of the extension point usage:
|
||||
<p>
|
||||
<pre>
|
||||
<extension
|
||||
id="buildExample"
|
||||
name="Definitions for Build Example"
|
||||
point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
|
||||
etc...
|
||||
</pre>
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
@ -976,7 +1302,7 @@ Version identifier for the managed build extension point. It is a string represe
|
|||
<meta.section type="copyright"/>
|
||||
</appInfo>
|
||||
<documentation>
|
||||
Copyright (c) 2003, 2004 IBM Corporation and others.
|
||||
Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
All rights reserved. This program and the accompanying materials are made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available on the <a href="http://www.eclipse.org/legal/cpl-v10.html"> Eclipse</a> website.
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
/**
|
||||
* This interface represents an additionalInput instance in the managed build system.
|
||||
* This element is only present if the user or a tool integrator needs to define
|
||||
* additional inputs or dependencies to a tool. An inputType element can have
|
||||
* multiple additionalInput children.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface IAdditionalInput {
|
||||
|
||||
// Schema attribute names for additionalInput elements
|
||||
public static final String ADDITIONAL_INPUT_ELEMENT_NAME = "additionalInput"; //$NON-NLS-1$
|
||||
public static final String PATHS = "paths"; //$NON-NLS-1$
|
||||
public static final String KIND = "kind"; //$NON-NLS-1$
|
||||
public static final String ADDITIONAL_DEPENDENCY = "additionaldependency"; //$NON-NLS-1$
|
||||
public static final int KIND_ADDITIONAL_DEPENDENCY = 1;
|
||||
public static final String ADDITIONAL_INPUT = "additionalinput"; //$NON-NLS-1$
|
||||
public static final int KIND_ADDITIONAL_INPUT = 2;
|
||||
public static final String ADDITIONAL_INPUT_DEPENDENCY = "additionalinputdependency"; //$NON-NLS-1$
|
||||
public static final int KIND_ADDITIONAL_INPUT_DEPENDENCY = 3;
|
||||
|
||||
/**
|
||||
* Returns the InputType parent of this AdditionalInput.
|
||||
*
|
||||
* @return IInputType
|
||||
*/
|
||||
public IInputType getParent();
|
||||
|
||||
/**
|
||||
* Returns a semi-colon separated list of the relative or absolute paths of the resources
|
||||
* to which this element applies.
|
||||
* The resources must be a member of the project, the output from another tool in the
|
||||
* tool-chain, or an external file. The file name of the path can use GNU Make pattern
|
||||
* rule syntax (in order to generate the name from the input file name).
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPaths();
|
||||
|
||||
/**
|
||||
* Sets semi-colon separated list of the relative or absolute paths of the resources to
|
||||
* which this element applies.
|
||||
*
|
||||
* @param paths
|
||||
*/
|
||||
public void setPaths(String paths);
|
||||
|
||||
/**
|
||||
* Returns the kind of additional input. The valid values are:
|
||||
* • KIND_ADDITIONAL_DEPENDENCY – added as a tool dependency, but not to the command line.
|
||||
* • KIND_ADDITIONAL_INPUT – added as an additional input to the command line, but not as a dependency.
|
||||
* • KIND_ADDITIONAL_INPUT_DEPENDENCY – added as both.
|
||||
* The default is KIND_ADDITIONAL_INPUT_DEPENDENCY
|
||||
*/
|
||||
public int getKind();
|
||||
|
||||
/**
|
||||
* Sets the kind of additional input.
|
||||
*/
|
||||
public void setKind(int kind);
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Sets the element's "dirty" (have I been modified?) flag.
|
||||
*
|
||||
* @param isDirty
|
||||
*/
|
||||
public void setDirty(boolean isDirty);
|
||||
|
||||
}
|
|
@ -224,6 +224,13 @@ public interface IConfiguration extends IBuildObject {
|
|||
*/
|
||||
public ITool[] getTools();
|
||||
|
||||
/**
|
||||
* Returns the tool in this configuration that creates the build artifact.
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getTargetTool();
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this configuration has overridden the default build
|
||||
* build command in this configuration, otherwise <code>false</code>.
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
/**
|
||||
* This interface represents an inputOrder instance in the managed build system.
|
||||
* This element is only present if the user or a tool integrator needs to define
|
||||
* the specific order of input files to a tool, or needs to exclude one or more
|
||||
* input files from being used by a tool. An inputType element can have
|
||||
* multiple inputOrder children.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface IInputOrder {
|
||||
public static final String INPUT_ORDER_ELEMENT_NAME = "inputOrder"; //$NON-NLS-1$
|
||||
public static final String PATH = "path"; //$NON-NLS-1$
|
||||
public static final String ORDER = "order"; //$NON-NLS-1$
|
||||
public static final String EXCLUDED = "excluded"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Returns the InputType parent of this InputOrder.
|
||||
*
|
||||
* @return IInputType
|
||||
*/
|
||||
public IInputType getParent();
|
||||
|
||||
/**
|
||||
* Returns the relative or absolute path of the resource to which this element applies.
|
||||
* The resource must be a member of the project, or the output from another tool in the
|
||||
* tool-chain.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getPath();
|
||||
|
||||
/**
|
||||
* Sets the relative or absolute path of the resource to which this element applies.
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
public void setPath(String path);
|
||||
|
||||
/**
|
||||
* Returns a comma-separated list of integer values that specify the order of this resource.
|
||||
* In most cases, only a single integer value will be specified. A list is supported
|
||||
* for the case where a single input file needs to be specified multiple times on the
|
||||
* command line. The order numbers begin at 1. Not all values need to be specified.
|
||||
* Unordered resources will fill the first “gap”. For example:
|
||||
* • To specify the first input file, use 1.
|
||||
* • To specify the last input file, without specifying an order for any other input file, use 2.
|
||||
* • To specify only the first two input files and last input file, use 1, 2 & 4.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getOrder();
|
||||
|
||||
/**
|
||||
* Sets the comma-separated list of integer values that specify the order of this resource.
|
||||
*
|
||||
* @param order
|
||||
*/
|
||||
public void setOrder(String order);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this resource is not used as an input for the tool.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getExcluded();
|
||||
|
||||
/**
|
||||
* Sets whether this resource is not used as an input for the tool.
|
||||
*
|
||||
* @param excluded
|
||||
*/
|
||||
public void setExcluded(boolean excluded);
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* Sets the element's "dirty" (have I been modified?) flag.
|
||||
*
|
||||
* @param isDirty
|
||||
*/
|
||||
public void setDirty(boolean isDirty);
|
||||
|
||||
}
|
|
@ -0,0 +1,373 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.content.IContentType;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
/**
|
||||
* 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 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.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getSourceExtensions();
|
||||
|
||||
/**
|
||||
* Answers <code>true</code> if the input type considers the file extension to be
|
||||
* one associated with a source file.
|
||||
*
|
||||
* @param ext file extension of the source
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isSourceExtension(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.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getDependencyExtensions();
|
||||
|
||||
/**
|
||||
* Answers <code>true</code> if the input type considers the file extension to be
|
||||
* one associated with a dependency file.
|
||||
*
|
||||
* @param ext file extension of the source
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isDependencyExtension(String ext);
|
||||
|
||||
/**
|
||||
* Returns the id of the option that is associated with this
|
||||
* input type on the command line. The default is to not use a command
|
||||
* line option and to assign this input to the ${Inputs} part of the command line.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getOptionId();
|
||||
|
||||
/**
|
||||
* Sets the id of the option that is associated with this
|
||||
* input type on the command line.
|
||||
*
|
||||
* @param optionId
|
||||
*/
|
||||
public void setOptionId(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 the plugin.xml element of the dependencyGenerator extension or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationElement
|
||||
*/
|
||||
public IConfigurationElement getDependencyGeneratorElement();
|
||||
|
||||
/**
|
||||
* Sets the DependencyGenerator plugin.xml element
|
||||
*
|
||||
* @param element
|
||||
*/
|
||||
public void setDependencyGeneratorElement(IConfigurationElement element);
|
||||
|
||||
/**
|
||||
* 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 IManagedDependencyGenerator
|
||||
*/
|
||||
public IManagedDependencyGenerator 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);
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003,2005 Rational Software Corporation and others.
|
||||
* Copyright (c) 2003, 2005 Rational Software Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v0.5
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -250,9 +250,9 @@ public interface IManagedBuildInfo {
|
|||
|
||||
/**
|
||||
* Returns a <code>String</code> containing the command-line invocation
|
||||
* for the tool associated with the extension.
|
||||
* for the tool associated with the output extension.
|
||||
*
|
||||
* @param extension the file extension of the build goal
|
||||
* @param extension the file extension of the output file
|
||||
* @return a String containing the command line invocation for the tool
|
||||
*/
|
||||
public String getToolForConfiguration(String extension);
|
||||
|
@ -266,6 +266,24 @@ public interface IManagedBuildInfo {
|
|||
*/
|
||||
public String getToolForSource(String sourceExtension);
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* input extension.
|
||||
*
|
||||
* @param extension the file extension of the input file
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getToolFromInputExtension(String extension);
|
||||
|
||||
/**
|
||||
* Returns a <code>ITool</code> for the tool associated with the
|
||||
* output extension.
|
||||
*
|
||||
* @param extension the file extension of the output file
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getToolFromOutputExtension(String extension);
|
||||
|
||||
/**
|
||||
* Answers a <code>String</code> array containing the contents of the
|
||||
* user objects option, if one is defined for the target.
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
public interface IManagedOutputNameProvider {
|
||||
/**
|
||||
*
|
||||
* @param tool
|
||||
* @param primaryInputNames
|
||||
* @return IPath[]
|
||||
*/
|
||||
public IPath[] getOutputNames( ITool tool, IPath[] primaryInputNames );
|
||||
}
|
|
@ -0,0 +1,288 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.core;
|
||||
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.content.IContentType;
|
||||
|
||||
/**
|
||||
* This interface represents an outputType instance in the managed build system.
|
||||
* It describes one category of output files created by a Tool. A tool can
|
||||
* have multiple outputType children.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface IOutputType extends IBuildObject {
|
||||
public static final String OUTPUT_TYPE_ELEMENT_NAME = "outputType"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_CONTENT_TYPE = "outputContentType"; //$NON-NLS-1$
|
||||
public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
|
||||
public static final String OPTION = "option"; //$NON-NLS-1$
|
||||
public static final String MULTIPLE_OF_TYPE = "multipleOfType"; //$NON-NLS-1$
|
||||
public static final String PRIMARY_INPUT_TYPE = "primaryInputType"; //$NON-NLS-1$
|
||||
public static final String PRIMARY_OUTPUT = "primaryOutput"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_NAMES = "outputNames"; //$NON-NLS-1$
|
||||
public static final String NAME_PATTERN = "namePattern"; //$NON-NLS-1$
|
||||
public static final String NAME_PROVIDER = "nameProvider"; //$NON-NLS-1$
|
||||
public static final String BUILD_VARIABLE = "buildVariable"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Returns the tool defining this OutputType.
|
||||
*
|
||||
* @return ITool
|
||||
*/
|
||||
public ITool getParent();
|
||||
|
||||
/**
|
||||
* Returns the <code>IOutputType</code> that is the superclass of this
|
||||
* OutputType, or <code>null</code> if the attribute was not specified.
|
||||
*
|
||||
* @return IInputType
|
||||
*/
|
||||
public IOutputType getSuperClass();
|
||||
|
||||
/**
|
||||
* Returns the Eclipse <code>IContentType</code> that describes this
|
||||
* output type. If both the outputs attribute and the outputContentType
|
||||
* attribute are specified, the outputContentType will be used if it
|
||||
* is defined in Eclipse.
|
||||
*
|
||||
* @return IContentType
|
||||
*/
|
||||
public IContentType getOutputContentType();
|
||||
|
||||
/**
|
||||
* Sets the Eclipse <code>IContentType</code> that describes this
|
||||
* output type.
|
||||
*
|
||||
* @param contentType The Eclipse content type
|
||||
*/
|
||||
public void setOutputContentType(IContentType contentType);
|
||||
|
||||
/**
|
||||
* Returns the list of valid output extensions from the
|
||||
* outputs attribute. Note that this value is not used
|
||||
* if output 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 outputContentType is specified.
|
||||
*
|
||||
* @return <code>String[]</code> of extensions
|
||||
*/
|
||||
public String[] getOutputExtensionsAttribute();
|
||||
|
||||
/**
|
||||
* Sets all of the output extensions that the receiver can build.
|
||||
* NOTE: The value of this attribute will NOT be used if a
|
||||
* output content type is specified and is registered with
|
||||
* Eclipse.
|
||||
*
|
||||
* @param String
|
||||
*/
|
||||
public void setOutputExtensionsAttribute(String extensions);
|
||||
|
||||
/**
|
||||
* Returns the list of the output extensions that the receiver can build.
|
||||
* Note that the list will come from the outputContentType if it
|
||||
* is specified and registered with Eclipse. Otherwise the
|
||||
* outputs attribute will be used.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getOutputExtensions();
|
||||
|
||||
/**
|
||||
* Answers <code>true</code> if the output type considers the file extension to be
|
||||
* one associated with an output file.
|
||||
*
|
||||
* @param ext file extension
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isOutputExtension(String ext);
|
||||
|
||||
/**
|
||||
* Returns the id of the option that is associated with this
|
||||
* output type on the command line. The default is to use the Tool
|
||||
* “outputFlag” attribute if primaryOutput is True. If option is not
|
||||
* specified, and primaryOutput is False, then the output file(s) of
|
||||
* this outputType are not added to the command line.
|
||||
* When specified, the namePattern, nameProvider and outputNames are ignored.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getOptionId();
|
||||
|
||||
/**
|
||||
* Sets the id of the option that is associated with this
|
||||
* output type on the command line.
|
||||
*
|
||||
* @param optionId
|
||||
*/
|
||||
public void setOptionId(String optionId);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this outputType creates multiple output
|
||||
* resources in one invocation of the tool, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getMultipleOfType();
|
||||
|
||||
/**
|
||||
* Sets whether this outputType can create multiple output resources in
|
||||
* one invocation of the tool.
|
||||
*
|
||||
* @param multiple
|
||||
*/
|
||||
public void setMultipleOfType(boolean multiple);
|
||||
|
||||
/**
|
||||
* Returns the input type that is used in determining the default
|
||||
* names of this output type.
|
||||
*
|
||||
* @return IInputType
|
||||
*/
|
||||
public IInputType getPrimaryInputType();
|
||||
|
||||
/**
|
||||
* Sets the input type that is used in determining the default
|
||||
* names of this output type.
|
||||
*
|
||||
* @param inputType
|
||||
*/
|
||||
public void setPrimaryInputType(IInputType contentType);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this is considered the primary output
|
||||
* of the tool, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getPrimaryOutput();
|
||||
|
||||
/**
|
||||
* Sets whether this is the primary output of the tool.
|
||||
*
|
||||
* @param primary
|
||||
*/
|
||||
public void setPrimaryOutput(boolean primary);
|
||||
|
||||
/**
|
||||
* Returns the prefix that the tool should prepend to the name of the build artifact.
|
||||
* For example, a librarian usually prepends 'lib' to the target.a
|
||||
* @return String
|
||||
*/
|
||||
public String getOutputPrefix();
|
||||
|
||||
/**
|
||||
* Sets the prefix that the tool should prepend to the name of the build artifact.
|
||||
* For example, a librarian usually prepends 'lib' to the target.a
|
||||
* @param String
|
||||
*/
|
||||
public void setOutputPrefix(String prefix);
|
||||
|
||||
/**
|
||||
* Returns the paths of the complete set of output files for this outputType
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getOutputNames();
|
||||
|
||||
/**
|
||||
* Sets the complete set of output files for this outputType
|
||||
*
|
||||
* @param names
|
||||
*/
|
||||
public void getOutputNames(String names);
|
||||
|
||||
/**
|
||||
* Returns the pattern, using the Gnu pattern rule syntax, for deriving the
|
||||
* output resource name from the input resource name. The default is to use
|
||||
* the input file base filename with the output extension.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getNamePattern();
|
||||
|
||||
/**
|
||||
* Sets the pattern, using the Gnu pattern rule syntax, for deriving the
|
||||
* output resource name from the input resource name.
|
||||
*
|
||||
* @return pattern
|
||||
*/
|
||||
public void setNamePattern(String pattern);
|
||||
|
||||
/**
|
||||
* Returns the plugin.xml element of the nameProvider extension or <code>null</code> if none.
|
||||
* nameProvider specified the name of a class that implements the IManagedOutputNameProvider
|
||||
* interface. When specified, the namePattern and outputNames are ignored.
|
||||
* When multipleOfType is true, this attribute, or the outputNames attribute,
|
||||
* is required in order for MBS to know the names of the output files.
|
||||
*
|
||||
* @return IConfigurationElement
|
||||
*/
|
||||
public IConfigurationElement getNameProviderElement();
|
||||
|
||||
/**
|
||||
* Sets the nameProvider plugin.xml element
|
||||
*
|
||||
* @param element
|
||||
*/
|
||||
public void setNameProviderElement(IConfigurationElement element);
|
||||
|
||||
/**
|
||||
* Returns the IManagedOutputNameProvider interface as specified by the nameProvider attribute.
|
||||
*
|
||||
* @return IManagedOutputNameProvider
|
||||
*/
|
||||
public IManagedOutputNameProvider getNameProvider();
|
||||
|
||||
/**
|
||||
* Returns the name of the build variable associated this this output type's resources
|
||||
* The variable is used in the build file to represent the list of output files.
|
||||
* The same variable name can be used by an inputType to identify a set of output
|
||||
* files that contribute to the 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 output 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 OutputType 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);
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2004 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -13,11 +13,12 @@ package org.eclipse.cdt.managedbuilder.core;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
||||
|
||||
/**
|
||||
* This class represents a utility of some sort that is used in the build process.
|
||||
* This interface represents a utility of some sort that is used in the build process.
|
||||
* A tool will generally process one or more resources to produce output resources.
|
||||
* Most tools have a set of options that can be used to modify the behavior of the tool.
|
||||
*/
|
||||
|
@ -33,9 +34,14 @@ public interface ITool extends IBuildObject {
|
|||
public static final String OPTION_CAT = "optionCategory"; //$NON-NLS-1$
|
||||
public static final String OPTION_REF = "optionReference"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_FLAG = "outputFlag"; //$NON-NLS-1$
|
||||
public static final String INPUT_TYPE = "inputType"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_TYPE = "outputType"; //$NON-NLS-1$
|
||||
public static final String OUTPUT_PREFIX = "outputPrefix"; //$NON-NLS-1$
|
||||
public static final String OUTPUTS = "outputs"; //$NON-NLS-1$
|
||||
public static final String SOURCES = "sources"; //$NON-NLS-1$
|
||||
public static final String ADVANCED_INPUT_CATEGORY = "advancedInputCategory"; //$NON-NLS-1$
|
||||
public static final String CUSTOM_BUILD_STEP = "customBuildStep"; //$NON-NLS-1$
|
||||
public static final String ANNOUNCEMENT = "announcement"; //$NON-NLS-1$
|
||||
public static final String TOOL_ELEMENT_NAME = "tool"; //$NON-NLS-1$
|
||||
public static final String WHITE_SPACE = " "; //$NON-NLS-1$
|
||||
|
||||
|
@ -104,6 +110,165 @@ public interface ITool extends IBuildObject {
|
|||
*/
|
||||
public IOption[] getOptions();
|
||||
|
||||
/**
|
||||
* Creates a child InputType for this tool.
|
||||
*
|
||||
* @param InputType The superClass, if any
|
||||
* @param String The id for the new InputType
|
||||
* @param String The name for the new InputType
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
* @return IInputType
|
||||
* @since 3.0
|
||||
*/
|
||||
public IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Removes an InputType from the tool's list.
|
||||
*
|
||||
* @param type
|
||||
* @since 3.0
|
||||
*/
|
||||
public void removeInputType(IInputType type);
|
||||
|
||||
/**
|
||||
* Returns the complete list of input types that are available for this tool.
|
||||
* The list is a merging of the input types specified for this tool with the
|
||||
* input types of its superclasses. The lowest input type instance in the hierarchy
|
||||
* takes precedence.
|
||||
*
|
||||
* @return IInputType[]
|
||||
* @since 3.0
|
||||
*/
|
||||
public IInputType[] getInputTypes();
|
||||
|
||||
/**
|
||||
* Returns the <code>IInputType</code> in the tool with the specified
|
||||
* ID. This is an efficient search in the receiver.
|
||||
*
|
||||
* <p>If the receiver does not have an InputType with that ID, the method
|
||||
* returns <code>null</code>. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the InputType to search for
|
||||
* @return <code>IInputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IInputType getInputTypeById(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>IInputType</code> in the tool that uses the
|
||||
* specified extension.
|
||||
*
|
||||
* <p>If the receiver does not have an InputType that uses the extension,
|
||||
* the method returns <code>null</code>. It is the responsibility of the
|
||||
* caller to verify the return value.
|
||||
*
|
||||
* @param inputExtension File extension
|
||||
* @return <code>IInputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IInputType getInputType(String inputExtension);
|
||||
|
||||
/**
|
||||
* Returns the primary <code>IInputType</code> in this tool
|
||||
*
|
||||
* <p>If the receiver has no InputTypes,
|
||||
* the method returns <code>null</code>. It is the responsibility of the
|
||||
* caller to verify the return value.
|
||||
*
|
||||
* @return <code>IInputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IInputType getPrimaryInputType();
|
||||
|
||||
/**
|
||||
* Returns all of the additional input resources of all InputType children.
|
||||
* Note: This does not include additional dependencies.
|
||||
*
|
||||
* @return IPath[]
|
||||
*/
|
||||
public IPath[] getAdditionalResources();
|
||||
|
||||
/**
|
||||
* Returns all of the additional dependency resources of all InputType children.
|
||||
* Note: This does not include additional inputs.
|
||||
*
|
||||
* @return IPath[]
|
||||
*/
|
||||
public IPath[] getAdditionalDependencies();
|
||||
|
||||
/**
|
||||
* Creates a child OutputType for this tool.
|
||||
*
|
||||
* @param OutputType The superClass, if any
|
||||
* @param String The id for the new OutputType
|
||||
* @param String The name for the new OutputType
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*
|
||||
* @return IOutputType
|
||||
* @since 3.0
|
||||
*/
|
||||
public IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement);
|
||||
|
||||
/**
|
||||
* Removes an OutputType from the tool's list.
|
||||
*
|
||||
* @param type
|
||||
* @since 3.0
|
||||
*/
|
||||
public void removeOutputType(IOutputType type);
|
||||
|
||||
/**
|
||||
* Returns the complete list of output types that are available for this tool.
|
||||
* The list is a merging of the output types specified for this tool with the
|
||||
* output types of its superclasses. The lowest output type instance in the hierarchy
|
||||
* takes precedence.
|
||||
*
|
||||
* @return IOutputType[]
|
||||
* @since 3.0
|
||||
*/
|
||||
public IOutputType[] getOutputTypes();
|
||||
/**
|
||||
* Get the <code>IOutputType</code> in the receiver with the specified
|
||||
* ID. This is an efficient search in the receiver.
|
||||
*
|
||||
* <p>If the receiver does not have an OutputType with that ID, the method
|
||||
* returns <code>null</code>. It is the responsibility of the caller to
|
||||
* verify the return value.
|
||||
*
|
||||
* @param id unique identifier of the OutputType to search for
|
||||
* @return <code>IOutputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IOutputType getOutputTypeById(String id);
|
||||
|
||||
/**
|
||||
* Returns the <code>IOutputType</code> in the tool that creates the
|
||||
* specified extension.
|
||||
*
|
||||
* <p>If the receiver does not have an OutputType that creates the extension,
|
||||
* the method returns <code>null</code>. It is the responsibility of the
|
||||
* caller to verify the return value.
|
||||
*
|
||||
* @param outputExtension File extension
|
||||
* @return <code>IOutputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IOutputType getOutputType(String outputExtension);
|
||||
|
||||
/**
|
||||
* Returns the primary <code>IOutputType</code> in this tool
|
||||
*
|
||||
* <p>If the receiver has no OutputTypes,
|
||||
* the method returns <code>null</code>. It is the responsibility of the
|
||||
* caller to verify the return value.
|
||||
*
|
||||
* @return <code>IOutputType</code>
|
||||
* @since 3.0
|
||||
*/
|
||||
public IOutputType getPrimaryOutputType();
|
||||
|
||||
/**
|
||||
* Returns the <code>ITool</code> that is the superclass of this
|
||||
* tool, or <code>null</code> if the attribute was not specified.
|
||||
|
@ -162,14 +327,48 @@ public interface ITool extends IBuildObject {
|
|||
* The list may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return List
|
||||
* @deprecated - use getPrimaryInputExtensions or getAllInputExtensions
|
||||
*/
|
||||
public List getInputExtensions();
|
||||
|
||||
/**
|
||||
* Returns the array of valid primary source extensions this tool knows how to build.
|
||||
* The array may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getPrimaryInputExtensions();
|
||||
|
||||
/**
|
||||
* Returns the array of all valid source extensions this tool knows how to build.
|
||||
* The array may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getAllInputExtensions();
|
||||
|
||||
/**
|
||||
* Returns the default input extension for the primary input of the tool
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getDefaultInputExtension();
|
||||
|
||||
/**
|
||||
* Returns the array of all valid dependency extensions for this tool's inputs.
|
||||
* The array may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getAllDependencyExtensions();
|
||||
|
||||
/**
|
||||
* Returns the list of valid header extensions for this tool.
|
||||
* Returns the value of the headerExtensions attribute
|
||||
* The list may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return List
|
||||
* @deprecated - use getDependency* methods
|
||||
*/
|
||||
public List getInterfaceExtensions();
|
||||
|
||||
|
@ -192,12 +391,30 @@ public interface ITool extends IBuildObject {
|
|||
*/
|
||||
public int getNatureFilter();
|
||||
|
||||
/**
|
||||
* Returns the array of all valid output extensions this tool can create.
|
||||
* The array may be empty but will never be <code>null</code>.
|
||||
*
|
||||
* @return String[]
|
||||
*/
|
||||
public String[] getAllOutputExtensions();
|
||||
|
||||
/**
|
||||
* Answers all of the output extensions that the receiver can build.
|
||||
* This routine returns the value if the outputs attribute.
|
||||
*
|
||||
* @return <code>String[]</code> of extensions
|
||||
* @deprecated - use getAllOutputExtensions
|
||||
*/
|
||||
public String[] getOutputExtensions();
|
||||
|
||||
/**
|
||||
* Answers all of the output extensions that the receiver can build,
|
||||
* from the value of the outputs attribute
|
||||
*
|
||||
* @return <code>String[]</code> of extensions
|
||||
*/
|
||||
public String[] getOutputExtensions();
|
||||
public String[] getOutputsAttribute();
|
||||
|
||||
/**
|
||||
* Answer the output extension the receiver will create from the input,
|
||||
|
@ -209,11 +426,13 @@ public interface ITool extends IBuildObject {
|
|||
public String getOutputExtension(String inputExtension);
|
||||
|
||||
/**
|
||||
* Sets all of the output extensions that the receiver can build.
|
||||
* Sets all of the output extensions that the receiver can build,
|
||||
* into the outputs attribute. Note that the outputs attribute is
|
||||
* ignored when one or more outputTypes are specified.
|
||||
*
|
||||
* @param String
|
||||
*/
|
||||
public void setOutputExtensions(String extensions);
|
||||
public void setOutputsAttribute(String extensions);
|
||||
|
||||
/**
|
||||
* Answers the argument that must be passed to a specific tool in order to
|
||||
|
@ -247,6 +466,51 @@ public interface ITool extends IBuildObject {
|
|||
*/
|
||||
public void setOutputPrefix(String prefix);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the Tool wants the MBS to display the Advanced
|
||||
* Input category that allows the user to specify additional input resources and
|
||||
* dependencies, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getAdvancedInputCategory();
|
||||
|
||||
/**
|
||||
* Sets whether the Tool wants the MBS to display the Advanced
|
||||
* Input category that allows the user to specify additional input resources and
|
||||
* dependencies.
|
||||
*
|
||||
* @param display
|
||||
*/
|
||||
public void setAdvancedInputCategory(boolean display);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the Tool represents a user-define custom build
|
||||
* step, else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getCustomBuildStep();
|
||||
|
||||
/**
|
||||
* Sets whether the Tool represents a user-define custom build step.
|
||||
*
|
||||
* @param customBuildStep
|
||||
*/
|
||||
public void setCustomBuildStep(boolean customBuildStep);
|
||||
|
||||
/**
|
||||
* Returns the announcement string for this tool
|
||||
* @return String
|
||||
*/
|
||||
public String getAnnouncement();
|
||||
|
||||
/**
|
||||
* Sets the announcement string for this tool
|
||||
* @param announcement
|
||||
*/
|
||||
public void setAnnouncement(String announcement);
|
||||
|
||||
/**
|
||||
* Answers the command-line invocation defined for the receiver.
|
||||
*
|
||||
|
@ -299,13 +563,23 @@ public interface ITool extends IBuildObject {
|
|||
* Returns the plugin.xml element of the dependencyGenerator extension or <code>null</code> if none.
|
||||
*
|
||||
* @return IConfigurationElement
|
||||
* @deprecated - use getDependencyGeneratorElementForExtension or IInputType method
|
||||
*/
|
||||
public IConfigurationElement getDependencyGeneratorElement();
|
||||
|
||||
/**
|
||||
* Returns the plugin.xml element of the dependencyGenerator extension or <code>null</code> if none.
|
||||
*
|
||||
* @param sourceExt source file extension
|
||||
* @return IConfigurationElement
|
||||
*/
|
||||
public IConfigurationElement getDependencyGeneratorElementForExtension(String sourceExt);
|
||||
|
||||
/**
|
||||
* Sets the DependencyGenerator plugin.xml element
|
||||
*
|
||||
* @param element
|
||||
* @deprecated - use IInputType method
|
||||
*/
|
||||
public void setDependencyGeneratorElement(IConfigurationElement element);
|
||||
|
||||
|
@ -317,9 +591,22 @@ public interface ITool extends IBuildObject {
|
|||
* when the project is built.
|
||||
*
|
||||
* @return IManagedDependencyGenerator
|
||||
* @deprecated - use getDependencyGeneratorForExtension or IInputType method
|
||||
*/
|
||||
public IManagedDependencyGenerator getDependencyGenerator();
|
||||
|
||||
/**
|
||||
* Returns a class instance that implements an interface to generate
|
||||
* source-level dependencies for the tool specified in the argument.
|
||||
* This method may return <code>null</code> in which case, the receiver
|
||||
* should assume that the tool does not require dependency information
|
||||
* when the project is built.
|
||||
*
|
||||
* @param sourceExt source file extension
|
||||
* @return IManagedDependencyGenerator
|
||||
*/
|
||||
public IManagedDependencyGenerator getDependencyGeneratorForExtension(String sourceExt);
|
||||
|
||||
/**
|
||||
* Returns an array of command line arguments that have been specified for
|
||||
* the tool.
|
||||
|
@ -329,7 +616,7 @@ public interface ITool extends IBuildObject {
|
|||
public String[] getCommandFlags() throws BuildException;
|
||||
|
||||
/**
|
||||
* Answers the additional command line arguments the user has specified for
|
||||
* Returns the command line arguments that have been specified for
|
||||
* the tool.
|
||||
*
|
||||
* @return String
|
||||
|
|
|
@ -12,7 +12,7 @@ package org.eclipse.cdt.managedbuilder.core;
|
|||
|
||||
|
||||
/**
|
||||
* This class represents a tool-integrator-defined, ordered set of tools
|
||||
* This interface represents a tool-integrator-defined, ordered set of tools
|
||||
* that transform the project’s input into the project’s outputs. A
|
||||
* tool-chain can be defined as part of a configuration, or as an
|
||||
* independent specification that is referenced in a separate configuration
|
||||
|
@ -32,6 +32,8 @@ public interface IToolChain extends IBuildObject {
|
|||
public static final String OS_LIST = "osList"; //$NON-NLS-1$
|
||||
public static final String ARCH_LIST = "archList"; //$NON-NLS-1$
|
||||
public static final String ERROR_PARSERS = "errorParsers"; //$NON-NLS-1$
|
||||
public static final String TARGET_TOOL = "targetTool"; //$NON-NLS-1$
|
||||
public static final String SECONDARY_OUTPUTS = "secondaryOutputs"; //$NON-NLS-1$
|
||||
public static final String IS_TOOL_CHAIN_SUPPORTED = "isToolChainSupported"; //$NON-NLS-1$
|
||||
// The attribute name for the scanner info collector
|
||||
public static final String SCANNER_CONFIG_PROFILE_ID = "scannerConfigDiscoveryProfileId"; //$NON-NLS-1$
|
||||
|
@ -225,6 +227,38 @@ public interface IToolChain extends IBuildObject {
|
|||
*/
|
||||
public void setScannerConfigDiscoveryProfileId(String profileId);
|
||||
|
||||
/**
|
||||
* Returns the id in this tool-chain that creates the build artifact.
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getTargetToolId();
|
||||
|
||||
/**
|
||||
* Sets the tool in this tool-chain that creates the build artifact.
|
||||
*
|
||||
* @param targetToolId
|
||||
*/
|
||||
public void setTargetTool(String targetToolId);
|
||||
|
||||
/**
|
||||
* Returns the OutputTypes in this tool-chain, besides the primary
|
||||
* output of the targetTool, that are also considered to be build
|
||||
* artifacts.
|
||||
*
|
||||
* @return IOutputType[]
|
||||
*/
|
||||
public IOutputType[] getSecondaryOutputs();
|
||||
|
||||
/**
|
||||
* Sets the semicolon separated list of OutputType identifiers in
|
||||
* this tool-chain, besides the primary output of the targetTool,
|
||||
* that are also considered to be build artifacts.
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
public void setSecondaryOutputs(String ids);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this tool-chain has changes that need to
|
||||
* be saved in the project file, else <code>false</code>.
|
||||
|
|
|
@ -54,6 +54,8 @@ import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
|
|||
import org.eclipse.cdt.managedbuilder.internal.core.Option;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.OptionCategory;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.InputType;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.OutputType;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ResourceConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Target;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.TargetPlatform;
|
||||
|
@ -132,6 +134,10 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
private static Map extensionOptionMap;
|
||||
// Option Categories defined in the manifest files
|
||||
private static Map extensionOptionCategoryMap;
|
||||
// Input types defined in the manifest files
|
||||
private static Map extensionInputTypeMap;
|
||||
// Output types defined in the manifest files
|
||||
private static Map extensionOutputTypeMap;
|
||||
// Targets defined in the manifest files (CDT V2.0 object model)
|
||||
private static Map extensionTargetMap;
|
||||
// "Selected configuraton" elements defined in the manifest files.
|
||||
|
@ -330,6 +336,30 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
return extensionOptionCategoryMap;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Safe accessor for the map of IDs to InputTypes
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected static Map getExtensionInputTypeMap() {
|
||||
if (extensionInputTypeMap == null) {
|
||||
extensionInputTypeMap = new HashMap();
|
||||
}
|
||||
return extensionInputTypeMap;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Safe accessor for the map of IDs to OutputTypes
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
protected static Map getExtensionOutputTypeMap() {
|
||||
if (extensionOutputTypeMap == null) {
|
||||
extensionOutputTypeMap = new HashMap();
|
||||
}
|
||||
return extensionOutputTypeMap;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Safe accessor for the map of IDs to Targets (CDT V2.0 object model)
|
||||
*
|
||||
|
@ -447,6 +477,28 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
return (IOption) getExtensionOptionMap().get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the InputType from the manifest with the ID specified in the argument
|
||||
* or <code>null</code>.
|
||||
*
|
||||
* @param id
|
||||
* @return IInputType
|
||||
*/
|
||||
public static IInputType getExtensionInputType(String id) {
|
||||
return (IInputType) getExtensionInputTypeMap().get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the OutputType from the manifest with the ID specified in the argument
|
||||
* or <code>null</code>.
|
||||
*
|
||||
* @param id
|
||||
* @return IOutputType
|
||||
*/
|
||||
public static IOutputType getExtensionOutputType(String id) {
|
||||
return (IOutputType) getExtensionOutputTypeMap().get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target from the manifest with the ID specified in the argument
|
||||
* or <code>null</code> - CDT V2.0 object model.
|
||||
|
@ -1048,6 +1100,40 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an InputType that is is specified in the manifest to the
|
||||
* build system. It is available to any element that
|
||||
* has a reference to it as part of its description.
|
||||
*
|
||||
* @param inputType
|
||||
*/
|
||||
public static void addExtensionInputType(InputType inputType) {
|
||||
Object previous = getExtensionInputTypeMap().put(inputType.getId(), inputType);
|
||||
if (previous != null) {
|
||||
// Report error
|
||||
ManagedBuildManager.OutputDuplicateIdError(
|
||||
"InputType", //$NON-NLS-1$
|
||||
inputType.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an OutputType that is is specified in the manifest to the
|
||||
* build system. It is available to any element that
|
||||
* has a reference to it as part of its description.
|
||||
*
|
||||
* @param outputType
|
||||
*/
|
||||
public static void addExtensionOutputType(OutputType outputType) {
|
||||
Object previous = getExtensionOutputTypeMap().put(outputType.getId(), outputType);
|
||||
if (previous != null) {
|
||||
// Report error
|
||||
ManagedBuildManager.OutputDuplicateIdError(
|
||||
"OutputType", //$NON-NLS-1$
|
||||
outputType.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Target that is is specified in the manifest to the
|
||||
* build system. It is available to any CDT 2.0 object model element that
|
||||
|
|
|
@ -0,0 +1,281 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class AdditionalInput implements IAdditionalInput {
|
||||
|
||||
private static final String EMPTY_STRING = new String();
|
||||
|
||||
// Superclass
|
||||
// Parent and children
|
||||
private IInputType parent;
|
||||
// Managed Build model attributes
|
||||
private String paths;
|
||||
private Integer kind;
|
||||
// Miscellaneous
|
||||
private boolean isExtensionAdditionalInput = false;
|
||||
private boolean isDirty = false;
|
||||
private boolean resolved = true;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
*/
|
||||
|
||||
/**
|
||||
* This constructor is called to create an AdditionalInput defined by an extension point in
|
||||
* a plugin manifest file, or returned by a dynamic element provider
|
||||
*
|
||||
* @param parent The IInputType parent of this AdditionalInput
|
||||
* @param element The AdditionalInput definition from the manifest file or a dynamic element
|
||||
* provider
|
||||
*/
|
||||
public AdditionalInput(IInputType parent, IManagedConfigElement element) {
|
||||
this.parent = parent;
|
||||
isExtensionAdditionalInput = true;
|
||||
|
||||
// setup for resolving
|
||||
resolved = false;
|
||||
|
||||
loadFromManifest(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is called to create an AdditionalInput whose attributes and children will be
|
||||
* added by separate calls.
|
||||
*
|
||||
* @param InputType The parent of the an AdditionalInput
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*/
|
||||
public AdditionalInput(InputType parent, boolean isExtensionElement) {
|
||||
this.parent = parent;
|
||||
isExtensionAdditionalInput = isExtensionElement;
|
||||
if (!isExtensionElement) {
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>AdditionalInput</code> based on the specification stored in the
|
||||
* project file (.cdtbuild).
|
||||
*
|
||||
* @param parent The <code>ITool</code> the AdditionalInput will be added to.
|
||||
* @param element The XML element that contains the AdditionalInput settings.
|
||||
*/
|
||||
public AdditionalInput(IInputType parent, Element element) {
|
||||
this.parent = parent;
|
||||
isExtensionAdditionalInput = false;
|
||||
|
||||
// Initialize from the XML attributes
|
||||
loadFromProject(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>AdditionalInput</code> based upon an existing AdditionalInput.
|
||||
*
|
||||
* @param parent The <code>IInputType</code> the AdditionalInput will be added to.
|
||||
* @param additionalInput The existing AdditionalInput to clone.
|
||||
*/
|
||||
public AdditionalInput(IInputType parent, AdditionalInput additionalInput) {
|
||||
this.parent = parent;
|
||||
isExtensionAdditionalInput = false;
|
||||
|
||||
// Copy the remaining attributes
|
||||
if (additionalInput.paths != null) {
|
||||
paths = new String(additionalInput.paths);
|
||||
}
|
||||
|
||||
if (additionalInput.kind != null) {
|
||||
kind = new Integer(additionalInput.kind.intValue());
|
||||
}
|
||||
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Loads the AdditionalInput information from the ManagedConfigElement specified in the
|
||||
* argument.
|
||||
*
|
||||
* @param element Contains the AdditionalInput information
|
||||
*/
|
||||
protected void loadFromManifest(IManagedConfigElement element) {
|
||||
|
||||
// path
|
||||
paths = element.getAttribute(IAdditionalInput.PATHS);
|
||||
|
||||
// kind
|
||||
String kindStr = element.getAttribute(IAdditionalInput.KIND);
|
||||
if (kindStr == null || kindStr.equals(ADDITIONAL_INPUT_DEPENDENCY)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_INPUT_DEPENDENCY);
|
||||
} else if (kindStr.equals(ADDITIONAL_INPUT)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_INPUT);
|
||||
} else if (kindStr.equals(ADDITIONAL_DEPENDENCY)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_DEPENDENCY);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Initialize the AdditionalInput information from the XML element
|
||||
* specified in the argument
|
||||
*
|
||||
* @param element An XML element containing the AdditionalInput information
|
||||
*/
|
||||
protected void loadFromProject(Element element) {
|
||||
|
||||
// path
|
||||
if (element.hasAttribute(IAdditionalInput.PATHS)) {
|
||||
paths = element.getAttribute(IAdditionalInput.PATHS);
|
||||
}
|
||||
|
||||
// kind
|
||||
if (element.hasAttribute(IAdditionalInput.KIND)) {
|
||||
String kindStr = element.getAttribute(IAdditionalInput.KIND);
|
||||
if (kindStr == null || kindStr.equals(ADDITIONAL_INPUT_DEPENDENCY)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_INPUT_DEPENDENCY);
|
||||
} else if (kindStr.equals(ADDITIONAL_INPUT)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_INPUT);
|
||||
} else if (kindStr.equals(ADDITIONAL_DEPENDENCY)) {
|
||||
kind = new Integer(KIND_ADDITIONAL_DEPENDENCY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist the AdditionalInput to the project file.
|
||||
*
|
||||
* @param doc
|
||||
* @param element
|
||||
*/
|
||||
public void serialize(Document doc, Element element) {
|
||||
|
||||
if (paths != null) {
|
||||
element.setAttribute(IAdditionalInput.PATHS, paths);
|
||||
}
|
||||
|
||||
if (kind != null) {
|
||||
String str;
|
||||
switch (getKind()) {
|
||||
case KIND_ADDITIONAL_INPUT:
|
||||
str = ADDITIONAL_INPUT;
|
||||
break;
|
||||
case KIND_ADDITIONAL_DEPENDENCY:
|
||||
str = ADDITIONAL_DEPENDENCY;
|
||||
break;
|
||||
case KIND_ADDITIONAL_INPUT_DEPENDENCY:
|
||||
str = ADDITIONAL_INPUT_DEPENDENCY;
|
||||
break;
|
||||
default:
|
||||
str = EMPTY_STRING;
|
||||
break;
|
||||
}
|
||||
element.setAttribute(IAdditionalInput.KIND, str);
|
||||
}
|
||||
|
||||
// I am clean now
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* P A R E N T A N D C H I L D H A N D L I N G
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getParent()
|
||||
*/
|
||||
public IInputType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* M O D E L A T T R I B U T E A C C E S S O R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getPaths()
|
||||
*/
|
||||
public String getPaths() {
|
||||
return paths;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#setPaths()
|
||||
*/
|
||||
public void setPaths(String newPaths) {
|
||||
if (paths == null && newPaths == null) return;
|
||||
if (paths == null || newPaths == null || !(paths.equals(newPaths))) {
|
||||
paths = newPaths;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#getKind()
|
||||
*/
|
||||
public int getKind() {
|
||||
return kind.intValue();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IAdditionalInput#setKind()
|
||||
*/
|
||||
public void setKind(int newKind) {
|
||||
if (kind == null || !(kind.intValue() == newKind)) {
|
||||
kind = new Integer(newKind);
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* O B J E C T S T A T E M A I N T E N A N C E
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#isExtensionElement()
|
||||
*/
|
||||
public boolean isExtensionElement() {
|
||||
return isExtensionAdditionalInput;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#isDirty()
|
||||
*/
|
||||
public boolean isDirty() {
|
||||
// This shouldn't be called for an extension AdditionalInput
|
||||
if (isExtensionAdditionalInput) return false;
|
||||
return isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IAdditionalInput#setDirty(boolean)
|
||||
*/
|
||||
public void setDirty(boolean isDirty) {
|
||||
this.isDirty = isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Resolve the element IDs to interface references
|
||||
*/
|
||||
public void resolveReferences() {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2004 Intel Corporation and others.
|
||||
* Copyright (c) 2004, 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -77,8 +77,8 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
*
|
||||
* @param ToolChain The parent of the builder, if any
|
||||
* @param Builder The superClass, if any
|
||||
* @param String The id for the new tool chain
|
||||
* @param String The name for the new tool chain
|
||||
* @param String The id for the new Builder
|
||||
* @param String The name for the new Builder
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*/
|
||||
public Builder(ToolChain parent, IBuilder superClass, String Id, String name, boolean isExtensionElement) {
|
||||
|
@ -157,10 +157,10 @@ public class Builder extends BuildObject implements IBuilder {
|
|||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Loads the project-type information from the ManagedConfigElement specified in the
|
||||
* Loads the builder information from the ManagedConfigElement specified in the
|
||||
* argument.
|
||||
*
|
||||
* @param element Contains the tool-chain information
|
||||
* @param element Contains the Builder information
|
||||
*/
|
||||
protected void loadFromManifest(IManagedConfigElement element) {
|
||||
ManagedBuildManager.putConfigElement(this, element);
|
||||
|
|
|
@ -596,6 +596,29 @@ public class Configuration extends BuildObject implements IConfiguration {
|
|||
return toolChain.getTool(id);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
||||
*/
|
||||
public ITool getTargetTool() {
|
||||
String targetToolId = toolChain.getTargetToolId();
|
||||
if (targetToolId == null) return null;
|
||||
|
||||
// Look for a tool with this ID, or a tool with a superclass with this id
|
||||
ITool[] tools = getFilteredTools();
|
||||
for (int i = 0; i < tools.length; i++) {
|
||||
ITool targetTool = tools[i];
|
||||
ITool tool = targetTool;
|
||||
do {
|
||||
if (targetToolId.equals(tool.getId())) {
|
||||
return targetTool;
|
||||
}
|
||||
tool = tool.getSuperClass();
|
||||
} while (tool != null);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
||||
*/
|
||||
|
|
|
@ -174,8 +174,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
|||
protected Vector generationProblems;
|
||||
protected IProject[] referencedProjects;
|
||||
protected List resourcesToBuild;
|
||||
protected List ruleList;
|
||||
|
||||
public static void outputTrace(String resourceName, String message) {
|
||||
if (VERBOSE) {
|
||||
System.out.println(TRACE_HEADER + resourceName + TRACE_FOOTER + message + NEWLINE);
|
||||
|
@ -373,7 +371,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
|||
checkCancel(monitor);
|
||||
String statusMsg = ManagedMakeMessages.getFormattedString("ManagedMakeBuilder.message.rebuild.makefiles", getProject().getName()); //$NON-NLS-1$
|
||||
monitor.subTask(statusMsg);
|
||||
generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration());
|
||||
//generator = ManagedBuildManager.getBuildfileGenerator(info.getDefaultConfiguration());
|
||||
generator.initialize(getProject(), info, monitor);
|
||||
MultiStatus result = generator.regenerateMakefiles();
|
||||
if (result.getCode() == IStatus.WARNING || result.getCode() == IStatus.INFO) {
|
||||
|
@ -415,7 +413,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
|||
throw e;
|
||||
}
|
||||
|
||||
// Say bye bye
|
||||
// Build finished message
|
||||
statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$
|
||||
monitor.subTask(statusMsg);
|
||||
}
|
||||
|
@ -463,19 +461,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
|||
return resourcesToBuild;
|
||||
}
|
||||
|
||||
/* (non-javadoc)
|
||||
* Answers the list of build rules that have been assembled. If there are none,
|
||||
* answers an empty list, never <code>null</code>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected List getRuleList() {
|
||||
if (ruleList == null) {
|
||||
ruleList = new ArrayList();
|
||||
}
|
||||
return ruleList;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.resources.ACBuilder#getWorkingDirectory()
|
||||
*/
|
||||
|
@ -538,7 +523,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
|||
throw e;
|
||||
}
|
||||
|
||||
// Say bye bye
|
||||
// Build finished message
|
||||
statusMsg = ManagedMakeMessages.getFormattedString(BUILD_FINISHED, getProject().getName()); //$NON-NLS-1$
|
||||
monitor.subTask(statusMsg);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,294 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputOrder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class InputOrder implements IInputOrder {
|
||||
|
||||
private static final String EMPTY_STRING = new String();
|
||||
|
||||
// Superclass
|
||||
// Parent and children
|
||||
private IInputType parent;
|
||||
// Managed Build model attributes
|
||||
private String path;
|
||||
private String order;
|
||||
private Boolean excluded;
|
||||
// Miscellaneous
|
||||
private boolean isExtensionInputOrder = false;
|
||||
private boolean isDirty = false;
|
||||
private boolean resolved = true;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
*/
|
||||
|
||||
/**
|
||||
* This constructor is called to create an InputOrder defined by an extension point in
|
||||
* a plugin manifest file, or returned by a dynamic element provider
|
||||
*
|
||||
* @param parent The IInputType parent of this InputOrder
|
||||
* @param element The InputOrder definition from the manifest file or a dynamic element
|
||||
* provider
|
||||
*/
|
||||
public InputOrder(IInputType parent, IManagedConfigElement element) {
|
||||
this.parent = parent;
|
||||
isExtensionInputOrder = true;
|
||||
|
||||
// setup for resolving
|
||||
resolved = false;
|
||||
|
||||
loadFromManifest(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is called to create an InputOrder whose attributes and children will be
|
||||
* added by separate calls.
|
||||
*
|
||||
* @param InputType The parent of the an InputOrder
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*/
|
||||
public InputOrder(InputType parent, boolean isExtensionElement) {
|
||||
this.parent = parent;
|
||||
isExtensionInputOrder = isExtensionElement;
|
||||
if (!isExtensionElement) {
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>InputOrder</code> based on the specification stored in the
|
||||
* project file (.cdtbuild).
|
||||
*
|
||||
* @param parent The <code>ITool</code> the InputOrder will be added to.
|
||||
* @param element The XML element that contains the InputOrder settings.
|
||||
*/
|
||||
public InputOrder(IInputType parent, Element element) {
|
||||
this.parent = parent;
|
||||
isExtensionInputOrder = false;
|
||||
|
||||
// Initialize from the XML attributes
|
||||
loadFromProject(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>InputOrder</code> based upon an existing InputOrder.
|
||||
*
|
||||
* @param parent The <code>IInputType</code> the InputOrder will be added to.
|
||||
* @param inputOrder The existing InputOrder to clone.
|
||||
*/
|
||||
public InputOrder(IInputType parent, InputOrder inputOrder) {
|
||||
this.parent = parent;
|
||||
isExtensionInputOrder = false;
|
||||
|
||||
// Copy the remaining attributes
|
||||
if (inputOrder.path != null) {
|
||||
path = new String(inputOrder.path);
|
||||
}
|
||||
|
||||
if (inputOrder.order != null) {
|
||||
order = new String(inputOrder.order);
|
||||
}
|
||||
|
||||
if (inputOrder.excluded != null) {
|
||||
excluded = new Boolean(inputOrder.excluded.booleanValue());
|
||||
}
|
||||
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Loads the InputOrder information from the ManagedConfigElement specified in the
|
||||
* argument.
|
||||
*
|
||||
* @param element Contains the InputOrder information
|
||||
*/
|
||||
protected void loadFromManifest(IManagedConfigElement element) {
|
||||
|
||||
// path
|
||||
path = element.getAttribute(IInputOrder.PATH);
|
||||
|
||||
// order
|
||||
order = element.getAttribute(IInputOrder.ORDER);
|
||||
|
||||
// excluded
|
||||
String isEx = element.getAttribute(IInputOrder.EXCLUDED);
|
||||
if (isEx != null){
|
||||
excluded = new Boolean("true".equals(isEx)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Initialize the InputOrder information from the XML element
|
||||
* specified in the argument
|
||||
*
|
||||
* @param element An XML element containing the InputOrder information
|
||||
*/
|
||||
protected void loadFromProject(Element element) {
|
||||
|
||||
// path
|
||||
if (element.hasAttribute(IInputOrder.PATH)) {
|
||||
path = element.getAttribute(IInputOrder.PATH);
|
||||
}
|
||||
|
||||
// order
|
||||
if (element.hasAttribute(IInputOrder.ORDER)) {
|
||||
order = element.getAttribute(IInputOrder.ORDER);
|
||||
}
|
||||
|
||||
// excluded
|
||||
if (element.hasAttribute(IInputOrder.EXCLUDED)) {
|
||||
String isEx = element.getAttribute(IInputOrder.EXCLUDED);
|
||||
if (isEx != null){
|
||||
excluded = new Boolean("true".equals(isEx)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist the InputOrder to the project file.
|
||||
*
|
||||
* @param doc
|
||||
* @param element
|
||||
*/
|
||||
public void serialize(Document doc, Element element) {
|
||||
|
||||
if (path != null) {
|
||||
element.setAttribute(IInputOrder.PATH, path);
|
||||
}
|
||||
|
||||
if (order != null) {
|
||||
element.setAttribute(IInputOrder.ORDER, order);
|
||||
}
|
||||
|
||||
if (excluded != null) {
|
||||
element.setAttribute(IInputOrder.EXCLUDED, excluded.toString());
|
||||
}
|
||||
|
||||
// I am clean now
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* P A R E N T A N D C H I L D H A N D L I N G
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getParent()
|
||||
*/
|
||||
public IInputType getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* M O D E L A T T R I B U T E A C C E S S O R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getPsth()
|
||||
*/
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setPath()
|
||||
*/
|
||||
public void setPath(String newPath) {
|
||||
if (path == null && newPath == null) return;
|
||||
if (path == null || newPath == null || !(path.equals(newPath))) {
|
||||
path = newPath;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getOrder()
|
||||
*/
|
||||
public String getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setOrder()
|
||||
*/
|
||||
public void setOrder(String newOrder) {
|
||||
if (order == null && newOrder == null) return;
|
||||
if (order == null || newOrder == null || !(order.equals(newOrder))) {
|
||||
order = newOrder;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#getExcluded()
|
||||
*/
|
||||
public boolean getExcluded() {
|
||||
return excluded.booleanValue();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IInputOrder#setExcluded()
|
||||
*/
|
||||
public void setExcluded(boolean b) {
|
||||
if (excluded == null || !(b == excluded.booleanValue())) {
|
||||
excluded = new Boolean(b);
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* O B J E C T S T A T E M A I N T E N A N C E
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#isExtensionElement()
|
||||
*/
|
||||
public boolean isExtensionElement() {
|
||||
return isExtensionInputOrder;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#isDirty()
|
||||
*/
|
||||
public boolean isDirty() {
|
||||
// This shouldn't be called for an extension InputOrder
|
||||
if (isExtensionInputOrder) return false;
|
||||
return isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IInputOrder#setDirty(boolean)
|
||||
*/
|
||||
public void setDirty(boolean isDirty) {
|
||||
this.isDirty = isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Resolve the element IDs to interface references
|
||||
*/
|
||||
public void resolveReferences() {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -308,7 +308,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
ITool[] tools = getDefaultConfiguration().getFilteredTools();
|
||||
for (int index = 0; index < tools.length; ++index) {
|
||||
if(tools[index].buildsFileType(sourceExtension)) {
|
||||
return tools[index].getDependencyGenerator();
|
||||
return tools[index].getDependencyGeneratorForExtension(sourceExtension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -663,7 +663,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolInvocation(java.lang.String)
|
||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolForConfiguration(java.lang.String)
|
||||
*/
|
||||
public String getToolForConfiguration(String extension) {
|
||||
// Treat a null argument as an empty string
|
||||
|
@ -678,6 +678,38 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolFromInputExtension(java.lang.String)
|
||||
*/
|
||||
public ITool getToolFromInputExtension(String sourceExtension) {
|
||||
// Get all the tools for the current config
|
||||
ITool[] tools = getFilteredTools();
|
||||
for (int index = 0; index < tools.length; index++) {
|
||||
ITool tool = tools[index];
|
||||
if (tool.buildsFileType(sourceExtension)) {
|
||||
return tool;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getToolFromOutputExtension(java.lang.String)
|
||||
*/
|
||||
public ITool getToolFromOutputExtension(String extension) {
|
||||
// Treat a null argument as an empty string
|
||||
String ext = extension == null ? new String() : extension;
|
||||
// Get all the tools for the current config
|
||||
ITool[] tools = getFilteredTools();
|
||||
for (int index = 0; index < tools.length; index++) {
|
||||
ITool tool = tools[index];
|
||||
if (tool.producesFileType(ext)) {
|
||||
return tool;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo#generateCommandLineInfo(java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2003, 2004 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -1146,8 +1146,15 @@ public class Option extends BuildObject implements IOption {
|
|||
* @see org.eclipse.cdt.core.build.managed.IOption#setCategory(org.eclipse.cdt.core.build.managed.IOptionCategory)
|
||||
*/
|
||||
public void setCategory(IOptionCategory category) {
|
||||
this.category = category;
|
||||
setDirty(true);
|
||||
if (this.category != category) {
|
||||
this.category = category;
|
||||
if (category != null) {
|
||||
categoryId = category.getId();
|
||||
} else {
|
||||
categoryId = null;
|
||||
}
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -0,0 +1,824 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||
|
||||
import org.eclipse.core.runtime.content.*;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedOutputNameProvider;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
public class OutputType extends BuildObject implements IOutputType {
|
||||
|
||||
private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$
|
||||
private static final String EMPTY_STRING = new String();
|
||||
|
||||
// Superclass
|
||||
private IOutputType superClass;
|
||||
private String superClassId;
|
||||
// Parent and children
|
||||
private ITool parent;
|
||||
// Managed Build model attributes
|
||||
private String outputContentTypeId;
|
||||
private IContentType outputContentType;
|
||||
private String outputs;
|
||||
private String optionId;
|
||||
private String buildVariable;
|
||||
private Boolean multipleOfType;
|
||||
private String primaryInputTypeId;
|
||||
private IInputType primaryInputType;
|
||||
private Boolean primaryOutput;
|
||||
private String outputPrefix;
|
||||
private String outputNames;
|
||||
private String namePattern;
|
||||
private IConfigurationElement nameProviderElement = null;
|
||||
private IManagedOutputNameProvider nameProvider = null;
|
||||
// Miscellaneous
|
||||
private boolean isExtensionOutputType = false;
|
||||
private boolean isDirty = false;
|
||||
private boolean resolved = true;
|
||||
|
||||
/*
|
||||
* C O N S T R U C T O R S
|
||||
*/
|
||||
|
||||
/**
|
||||
* This constructor is called to create an OutputType defined by an extension point in
|
||||
* a plugin manifest file, or returned by a dynamic element provider
|
||||
*
|
||||
* @param parent The ITool parent of this OutputType
|
||||
* @param element The OutputType definition from the manifest file or a dynamic element
|
||||
* provider
|
||||
*/
|
||||
public OutputType(ITool parent, IManagedConfigElement element) {
|
||||
this.parent = parent;
|
||||
isExtensionOutputType = true;
|
||||
|
||||
// setup for resolving
|
||||
resolved = false;
|
||||
|
||||
loadFromManifest(element);
|
||||
|
||||
// Hook me up to the Managed Build Manager
|
||||
ManagedBuildManager.addExtensionOutputType(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is called to create an OutputType whose attributes will be
|
||||
* set by separate calls.
|
||||
*
|
||||
* @param Tool The parent of the an OutputType
|
||||
* @param OutputType The superClass, if any
|
||||
* @param String The id for the new OutputType
|
||||
* @param String The name for the new OutputType
|
||||
* @param boolean Indicates whether this is an extension element or a managed project element
|
||||
*/
|
||||
public OutputType(Tool parent, IOutputType superClass, String Id, String name, boolean isExtensionElement) {
|
||||
this.parent = parent;
|
||||
this.superClass = superClass;
|
||||
if (this.superClass != null) {
|
||||
superClassId = this.superClass.getId();
|
||||
}
|
||||
setId(Id);
|
||||
setName(name);
|
||||
isExtensionOutputType = isExtensionElement;
|
||||
if (isExtensionElement) {
|
||||
// Hook me up to the Managed Build Manager
|
||||
ManagedBuildManager.addExtensionOutputType(this);
|
||||
} else {
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>OutputType</code> based on the specification stored in the
|
||||
* project file (.cdtbuild).
|
||||
*
|
||||
* @param parent The <code>ITool</code> the OutputType will be added to.
|
||||
* @param element The XML element that contains the OutputType settings.
|
||||
*/
|
||||
public OutputType(ITool parent, Element element) {
|
||||
this.parent = parent;
|
||||
isExtensionOutputType = false;
|
||||
|
||||
// Initialize from the XML attributes
|
||||
loadFromProject(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an <code>OutputType</code> based upon an existing OutputType.
|
||||
*
|
||||
* @param parent The <code>ITool</code> the OutputType will be added to.
|
||||
* @param Id The identifier of the new OutputType
|
||||
* @param name The name of the new OutputType
|
||||
* @param outputType The existing OutputType to clone.
|
||||
*/
|
||||
public OutputType(ITool parent, String Id, String name, OutputType outputType) {
|
||||
this.parent = parent;
|
||||
superClass = outputType.superClass;
|
||||
if (superClass != null) {
|
||||
if (outputType.superClassId != null) {
|
||||
superClassId = new String(outputType.superClassId);
|
||||
}
|
||||
}
|
||||
setId(Id);
|
||||
setName(name);
|
||||
isExtensionOutputType = false;
|
||||
|
||||
// Copy the remaining attributes
|
||||
if (outputType.outputContentTypeId != null) {
|
||||
outputContentTypeId = new String(outputType.outputContentTypeId);
|
||||
}
|
||||
outputContentType = outputType.outputContentType;
|
||||
if (outputType.outputs != null) {
|
||||
outputs = new String(outputType.outputs);
|
||||
}
|
||||
if (outputType.optionId != null) {
|
||||
optionId = new String(outputType.optionId);
|
||||
}
|
||||
if (outputType.buildVariable != null) {
|
||||
buildVariable = new String(outputType.buildVariable);
|
||||
}
|
||||
if (outputType.multipleOfType != null) {
|
||||
multipleOfType = new Boolean(outputType.multipleOfType.booleanValue());
|
||||
}
|
||||
if (outputType.primaryInputTypeId != null) {
|
||||
primaryInputTypeId = new String(outputType.primaryInputTypeId);
|
||||
}
|
||||
primaryInputType = outputType.primaryInputType;
|
||||
if (outputType.primaryOutput != null) {
|
||||
primaryOutput = new Boolean(outputType.primaryOutput.booleanValue());
|
||||
}
|
||||
if (outputType.outputPrefix != null) {
|
||||
outputPrefix = new String(outputType.outputPrefix);
|
||||
}
|
||||
if (outputType.outputNames != null) {
|
||||
outputNames = new String(outputType.outputNames);
|
||||
}
|
||||
if (outputType.namePattern != null) {
|
||||
namePattern = new String(outputType.namePattern);
|
||||
}
|
||||
|
||||
nameProviderElement = outputType.nameProviderElement;
|
||||
nameProvider = outputType.nameProvider;
|
||||
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Loads the OutputType information from the ManagedConfigElement specified in the
|
||||
* argument.
|
||||
*
|
||||
* @param element Contains the OutputType information
|
||||
*/
|
||||
protected void loadFromManifest(IManagedConfigElement element) {
|
||||
ManagedBuildManager.putConfigElement(this, element);
|
||||
|
||||
// id
|
||||
setId(element.getAttribute(IBuildObject.ID));
|
||||
|
||||
// Get the name
|
||||
setName(element.getAttribute(IBuildObject.NAME));
|
||||
|
||||
// superClass
|
||||
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
|
||||
|
||||
// outputContentType
|
||||
outputContentTypeId = element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE);
|
||||
|
||||
// outputs
|
||||
outputs = element.getAttribute(IOutputType.OUTPUTS);
|
||||
|
||||
// option
|
||||
optionId = element.getAttribute(IOutputType.OPTION);
|
||||
|
||||
// multipleOfType
|
||||
String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
|
||||
if (isMOT != null){
|
||||
multipleOfType = new Boolean("true".equals(isMOT)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// primaryInputType
|
||||
primaryInputTypeId = element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE);
|
||||
|
||||
// primaryOutput
|
||||
String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
|
||||
if (isPO != null){
|
||||
primaryOutput = new Boolean("true".equals(isPO)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
// outputPrefix
|
||||
outputPrefix = element.getAttribute(IOutputType.OUTPUT_PREFIX);
|
||||
|
||||
// outputNames
|
||||
outputNames = element.getAttribute(IOutputType.OUTPUT_NAMES);
|
||||
|
||||
// namePattern
|
||||
namePattern = element.getAttribute(IOutputType.NAME_PATTERN);
|
||||
|
||||
// buildVariable
|
||||
buildVariable = element.getAttribute(IOutputType.BUILD_VARIABLE);
|
||||
|
||||
// Store the configuration element IFF there is a name provider defined
|
||||
String nameProvider = element.getAttribute(IOutputType.NAME_PROVIDER);
|
||||
if (nameProvider != null && element instanceof DefaultManagedConfigElement) {
|
||||
nameProviderElement = ((DefaultManagedConfigElement)element).getConfigurationElement();
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Initialize the OutputType information from the XML element
|
||||
* specified in the argument
|
||||
*
|
||||
* @param element An XML element containing the OutputType information
|
||||
*/
|
||||
protected void loadFromProject(Element element) {
|
||||
|
||||
// id
|
||||
setId(element.getAttribute(IBuildObject.ID));
|
||||
|
||||
// name
|
||||
if (element.hasAttribute(IBuildObject.NAME)) {
|
||||
setName(element.getAttribute(IBuildObject.NAME));
|
||||
}
|
||||
|
||||
// superClass
|
||||
superClassId = element.getAttribute(IProjectType.SUPERCLASS);
|
||||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionOutputType(superClassId);
|
||||
if (superClass == null) {
|
||||
// TODO: Report error
|
||||
}
|
||||
}
|
||||
|
||||
// outputContentType
|
||||
if (element.hasAttribute(IOutputType.OUTPUT_CONTENT_TYPE)) {
|
||||
outputContentTypeId = element.getAttribute(IOutputType.OUTPUT_CONTENT_TYPE);
|
||||
}
|
||||
|
||||
// outputs
|
||||
if (element.hasAttribute(IOutputType.OUTPUTS)) {
|
||||
outputs = element.getAttribute(IOutputType.OUTPUTS);
|
||||
}
|
||||
|
||||
// option
|
||||
if (element.hasAttribute(IOutputType.OPTION)) {
|
||||
optionId = element.getAttribute(IOutputType.OPTION);
|
||||
}
|
||||
|
||||
// multipleOfType
|
||||
if (element.hasAttribute(IOutputType.MULTIPLE_OF_TYPE)) {
|
||||
String isMOT = element.getAttribute(IOutputType.MULTIPLE_OF_TYPE);
|
||||
if (isMOT != null){
|
||||
multipleOfType = new Boolean("true".equals(isMOT)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// primaryInputType
|
||||
if (element.hasAttribute(IOutputType.PRIMARY_INPUT_TYPE)) {
|
||||
primaryInputTypeId = element.getAttribute(IOutputType.PRIMARY_INPUT_TYPE);
|
||||
primaryInputType = parent.getInputTypeById(primaryInputTypeId);
|
||||
}
|
||||
|
||||
// primaryOutput
|
||||
if (element.hasAttribute(IOutputType.PRIMARY_OUTPUT)) {
|
||||
String isPO = element.getAttribute(IOutputType.PRIMARY_OUTPUT);
|
||||
if (isPO != null){
|
||||
primaryOutput = new Boolean("true".equals(isPO)); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
// outputPrefix
|
||||
if (element.hasAttribute(IOutputType.OUTPUT_PREFIX)) {
|
||||
outputPrefix = element.getAttribute(IOutputType.OUTPUT_PREFIX);
|
||||
}
|
||||
|
||||
// outputNames
|
||||
if (element.hasAttribute(IOutputType.OUTPUT_NAMES)) {
|
||||
outputNames = element.getAttribute(IOutputType.OUTPUT_NAMES);
|
||||
}
|
||||
|
||||
// namePattern
|
||||
if (element.hasAttribute(IOutputType.NAME_PATTERN)) {
|
||||
namePattern = element.getAttribute(IOutputType.NAME_PATTERN);
|
||||
}
|
||||
|
||||
// buildVariable
|
||||
if (element.hasAttribute(IOutputType.BUILD_VARIABLE)) {
|
||||
buildVariable = element.getAttribute(IOutputType.BUILD_VARIABLE);
|
||||
}
|
||||
|
||||
// Note: Name Provider cannot be specified in a project file because
|
||||
// an IConfigurationElement is needed to load it!
|
||||
if (element.hasAttribute(IOutputType.NAME_PROVIDER)) {
|
||||
// TODO: Issue warning?
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist the OutputType to the project file.
|
||||
*
|
||||
* @param doc
|
||||
* @param element
|
||||
*/
|
||||
public void serialize(Document doc, Element element) {
|
||||
if (superClass != null)
|
||||
element.setAttribute(IProjectType.SUPERCLASS, superClass.getId());
|
||||
|
||||
element.setAttribute(IBuildObject.ID, id);
|
||||
|
||||
if (name != null) {
|
||||
element.setAttribute(IBuildObject.NAME, name);
|
||||
}
|
||||
|
||||
if (outputContentTypeId != null) {
|
||||
element.setAttribute(IOutputType.OUTPUT_CONTENT_TYPE, outputContentTypeId);
|
||||
}
|
||||
|
||||
if (outputs != null) {
|
||||
element.setAttribute(IOutputType.OUTPUTS, outputs);
|
||||
}
|
||||
|
||||
if (optionId != null) {
|
||||
element.setAttribute(IOutputType.OPTION, optionId);
|
||||
}
|
||||
|
||||
if (multipleOfType != null) {
|
||||
element.setAttribute(IOutputType.MULTIPLE_OF_TYPE, multipleOfType.toString());
|
||||
}
|
||||
|
||||
if (primaryInputTypeId != null) {
|
||||
element.setAttribute(IOutputType.PRIMARY_INPUT_TYPE, primaryInputTypeId);
|
||||
}
|
||||
|
||||
if (primaryOutput != null) {
|
||||
element.setAttribute(IOutputType.PRIMARY_OUTPUT, primaryOutput.toString());
|
||||
}
|
||||
|
||||
if (outputPrefix != null) {
|
||||
element.setAttribute(IOutputType.OUTPUT_PREFIX, outputPrefix);
|
||||
}
|
||||
|
||||
if (outputNames != null) {
|
||||
element.setAttribute(IOutputType.OUTPUT_NAMES, outputNames);
|
||||
}
|
||||
|
||||
if (namePattern != null) {
|
||||
element.setAttribute(IOutputType.NAME_PATTERN, namePattern);
|
||||
}
|
||||
|
||||
if (buildVariable != null) {
|
||||
element.setAttribute(IOutputType.BUILD_VARIABLE, buildVariable);
|
||||
}
|
||||
|
||||
// Note: dependency generator cannot be specified in a project file because
|
||||
// an IConfigurationElement is needed to load it!
|
||||
if (nameProviderElement != null) {
|
||||
// TODO: issue warning?
|
||||
}
|
||||
|
||||
// I am clean now
|
||||
isDirty = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* P A R E N T A N D C H I L D H A N D L I N G
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#getParent()
|
||||
*/
|
||||
public ITool getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/*
|
||||
* M O D E L A T T R I B U T E A C C E S S O R S
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#getSuperClass()
|
||||
*/
|
||||
public IOutputType getSuperClass() {
|
||||
return superClass;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#getName()
|
||||
*/
|
||||
public String getName() {
|
||||
return (name == null && superClass != null) ? superClass.getName() : name;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#getBuildVariable()
|
||||
*/
|
||||
public String getBuildVariable() {
|
||||
if (buildVariable == null) {
|
||||
// If I have a superClass, ask it
|
||||
if (superClass != null) {
|
||||
return superClass.getBuildVariable();
|
||||
} else {
|
||||
// Use default name
|
||||
String name = getName();
|
||||
if (name == null || name.length() == 0) {
|
||||
name = getId();
|
||||
}
|
||||
String defaultName = name.toUpperCase();
|
||||
defaultName = defaultName.replaceAll("\\W", "_"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
defaultName += "_OUTPUTS"; //$NON-NLS-1$
|
||||
return defaultName;
|
||||
}
|
||||
}
|
||||
return buildVariable;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#setBuildVariable()
|
||||
*/
|
||||
public void setBuildVariable(String variableName) {
|
||||
if (variableName == null && buildVariable == null) return;
|
||||
if (buildVariable == null || variableName == null || !(variableName.equals(buildVariable))) {
|
||||
buildVariable = variableName;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#getMultipleOfType()
|
||||
*/
|
||||
public boolean getMultipleOfType() {
|
||||
if (multipleOfType == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getMultipleOfType();
|
||||
} else {
|
||||
return false; // default is false
|
||||
}
|
||||
}
|
||||
return multipleOfType.booleanValue();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setMultipleOfType()
|
||||
*/
|
||||
public void setMultipleOfType(boolean b) {
|
||||
if (multipleOfType == null || !(b == multipleOfType.booleanValue())) {
|
||||
multipleOfType = new Boolean(b);
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getNamePattern()
|
||||
*/
|
||||
public String getNamePattern() {
|
||||
if (namePattern == null) {
|
||||
// If I have a superClass, ask it
|
||||
if (superClass != null) {
|
||||
return superClass.getNamePattern();
|
||||
} else {
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
}
|
||||
return namePattern;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setNamePattern()
|
||||
*/
|
||||
public void setNamePattern(String pattern) {
|
||||
if (pattern == null && namePattern == null) return;
|
||||
if (namePattern == null || pattern == null || !(pattern.equals(namePattern))) {
|
||||
namePattern = pattern;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getNameProviderElement()
|
||||
*/
|
||||
public IConfigurationElement getNameProviderElement() {
|
||||
if (nameProviderElement == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getNameProviderElement();
|
||||
}
|
||||
}
|
||||
return nameProviderElement;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setNameProviderElement()
|
||||
*/
|
||||
public void setNameProviderElement(IConfigurationElement element) {
|
||||
nameProviderElement = element;
|
||||
setDirty(true);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setNameProviderElement()
|
||||
*/
|
||||
public IManagedOutputNameProvider getNameProvider() {
|
||||
if (nameProvider != null) {
|
||||
return nameProvider;
|
||||
}
|
||||
IConfigurationElement element = getNameProviderElement();
|
||||
if (element != null) {
|
||||
try {
|
||||
if (element.getAttribute(NAME_PROVIDER) != null) {
|
||||
nameProvider = (IManagedOutputNameProvider) element.createExecutableExtension(NAME_PROVIDER);
|
||||
return nameProvider;
|
||||
}
|
||||
} catch (CoreException e) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOptionId()
|
||||
*/
|
||||
public String getOptionId() {
|
||||
if (optionId == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getOptionId();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return optionId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOptionId()
|
||||
*/
|
||||
public void setOptionId(String id) {
|
||||
if (id == null && optionId == null) return;
|
||||
if (id == null || optionId == null || !(optionId.equals(id))) {
|
||||
optionId = id;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputContentType()
|
||||
*/
|
||||
public IContentType getOutputContentType() {
|
||||
if (outputContentType == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getOutputContentType();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return outputContentType;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputContentType()
|
||||
*/
|
||||
public void setOutputContentType(IContentType type) {
|
||||
if (outputContentType != type) {
|
||||
outputContentType = type;
|
||||
if (outputContentType != null) {
|
||||
outputContentTypeId = outputContentType.getId();
|
||||
} else {
|
||||
outputContentTypeId = null;
|
||||
}
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputExtensionsAttribute()
|
||||
*/
|
||||
public String[] getOutputExtensionsAttribute() {
|
||||
if (outputs == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getOutputExtensionsAttribute();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return outputs.split(DEFAULT_SEPARATOR);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputExtensionsAttribute()
|
||||
*/
|
||||
public void setOutputExtensionsAttribute(String exts) {
|
||||
if (exts == null && outputs == null) return;
|
||||
if (outputs == null || exts == null || !(exts.equals(outputs))) {
|
||||
outputs = exts;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputExtensions()
|
||||
*/
|
||||
public String[] getOutputExtensions() {
|
||||
// Use content type if specified and registered with Eclipse
|
||||
IContentType type = getOutputContentType();
|
||||
if (type != null) {
|
||||
return type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
|
||||
}
|
||||
return getOutputExtensionsAttribute();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOutputType#isOutputExtension()
|
||||
*/
|
||||
public boolean isOutputExtension(String ext) {
|
||||
String[] exts = getOutputExtensions();
|
||||
for (int i=0; i<exts.length; i++) {
|
||||
if (ext.equals(exts[i])) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputPrefix()
|
||||
*/
|
||||
public String getOutputPrefix() {
|
||||
if (outputPrefix == null) {
|
||||
// If I have a superClass, ask it
|
||||
if (superClass != null) {
|
||||
return superClass.getOutputPrefix();
|
||||
} else {
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
}
|
||||
return outputPrefix;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputPrefix()
|
||||
*/
|
||||
public void setOutputPrefix(String prefix) {
|
||||
if (prefix == null && outputPrefix == null) return;
|
||||
if (outputPrefix == null || prefix == null || !(prefix.equals(outputPrefix))) {
|
||||
outputPrefix = prefix;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getOutputNames()
|
||||
*/
|
||||
public String getOutputNames() {
|
||||
if (outputNames == null) {
|
||||
// If I have a superClass, ask it
|
||||
if (superClass != null) {
|
||||
return superClass.getOutputNames();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return outputNames;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setOutputNames()
|
||||
*/
|
||||
public void getOutputNames(String names) {
|
||||
if (names == null && outputNames == null) return;
|
||||
if (outputNames == null || names == null || !(names.equals(outputNames))) {
|
||||
outputNames = names;
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getPrimaryInputType()
|
||||
*/
|
||||
public IInputType getPrimaryInputType() {
|
||||
if (primaryInputType == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getPrimaryInputType();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return primaryInputType;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setPrimaryInputType()
|
||||
*/
|
||||
public void setPrimaryInputType(IInputType type) {
|
||||
if (primaryInputType != type) {
|
||||
primaryInputType = type;
|
||||
if (primaryInputType != null) {
|
||||
primaryInputTypeId = primaryInputType.getId();
|
||||
} else {
|
||||
primaryInputTypeId = null;
|
||||
}
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#getPrimaryOutput()
|
||||
*/
|
||||
public boolean getPrimaryOutput() {
|
||||
if (primaryOutput == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getPrimaryOutput();
|
||||
} else {
|
||||
return false; // default is false
|
||||
}
|
||||
}
|
||||
return primaryOutput.booleanValue();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOuputType#setPrimaryOutput()
|
||||
*/
|
||||
public void setPrimaryOutput(boolean b) {
|
||||
if (primaryOutput == null || !(b == primaryOutput.booleanValue())) {
|
||||
primaryOutput = new Boolean(b);
|
||||
setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* O B J E C T S T A T E M A I N T E N A N C E
|
||||
*/
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#isExtensionElement()
|
||||
*/
|
||||
public boolean isExtensionElement() {
|
||||
return isExtensionOutputType;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#isDirty()
|
||||
*/
|
||||
public boolean isDirty() {
|
||||
// This shouldn't be called for an extension OutputType
|
||||
if (isExtensionOutputType) return false;
|
||||
return isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOutputType#setDirty(boolean)
|
||||
*/
|
||||
public void setDirty(boolean isDirty) {
|
||||
this.isDirty = isDirty;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* Resolve the element IDs to interface references
|
||||
*/
|
||||
public void resolveReferences() {
|
||||
if (!resolved) {
|
||||
resolved = true;
|
||||
// Resolve superClass
|
||||
if (superClassId != null && superClassId.length() > 0) {
|
||||
superClass = ManagedBuildManager.getExtensionOutputType(superClassId);
|
||||
if (superClass == null) {
|
||||
// Report error
|
||||
ManagedBuildManager.OutputResolveError(
|
||||
"superClass", //$NON-NLS-1$
|
||||
superClassId,
|
||||
"outputType", //$NON-NLS-1$
|
||||
getId());
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve content types
|
||||
IContentTypeManager manager = Platform.getContentTypeManager();
|
||||
if (outputContentTypeId != null && outputContentTypeId.length() > 0) {
|
||||
outputContentType = manager.getContentType(outputContentTypeId);
|
||||
}
|
||||
|
||||
// Resolve primary input type
|
||||
if (primaryInputTypeId != null && primaryInputTypeId.length() > 0) {
|
||||
primaryInputType = parent.getInputTypeById(primaryInputTypeId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -47,28 +47,36 @@ ManagedBuildManager.error.open_failed_title=Managed Make Project File Error
|
|||
ManagedBuildManager.error.open_failed=The Managed Make project file could not be read because of the following error.\n\n{0}\n\nManaged Make functionality will not be available for this project.
|
||||
ManagedBuildManager.error.project.version.error=The version number of the project {0} is greater than the Managed Build System version number.
|
||||
ManagedBuildManager.error.id.nomatch=Error loading Managed Make project information for project {0}. The tool definitions used to create the project are not available.
|
||||
|
||||
# Makefile Generator Messages
|
||||
MakefileGenerator.message.start.file=Building file:
|
||||
MakefileGenerator.message.finish.file=Finished building:
|
||||
MakefileGenerator.message.start.build=Building target:
|
||||
MakefileGenerator.message.finish.build=Finished building target:
|
||||
MakefileGenerator.message.no.target=No tool found that can build the extension specified with the build arrtifact name
|
||||
MakefileGenerator.message.adding.source.folder=Adding folder {0} to sources
|
||||
MakefileGenerator.message.gen.source.makefile=Generating makefile for source folder {0}
|
||||
MakefileGenerator.message.calc.delta=Calculating the delta for project {0}
|
||||
MakefileGenerator.message.finding.sources=Finding source files in project {0}
|
||||
MakefileGenerator.comment.module.list = Every subdirectory with source files must be described here
|
||||
MakefileGenerator.comment.module.variables = Add inputs and outputs from these tool invocations to the build variables
|
||||
MakefileGenerator.comment.source.list = All of the sources participating in the build are defined here
|
||||
MakefileGenerator.comment.build.rule = Each subdirectory must supply rules for building sources it contributes
|
||||
MakefileGenerator.comment.build.toprules = Tool invocations
|
||||
MakefileGenerator.comment.build.alltarget = All Target
|
||||
MakefileGenerator.comment.build.toptargets = Other Targets
|
||||
MakefileGenerator.comment.module.make.includes = Include the makefiles for each source subdirectory
|
||||
MakefileGenerator.comment.module.dep.includes = Include automatically-generated dependency list:
|
||||
MakefileGenerator.comment.autodeps=Automatically-generated dependency list:
|
||||
MakefileGenerator.comment.header=Automatically-generated file. Do not edit!
|
||||
MakefileGenerator.error.spaces=Cannot generate makefile for folder with spaces in name
|
||||
MakefileGenerator.warning.no.source=Nothing to build for project {0}
|
||||
MakefileGenerator.error.no.nameprovider=A nameProvider or outputNames must be specified with multipleType == true
|
||||
|
||||
ManagedBuildInfo.message.job.init = Initializing path container for {0}
|
||||
ManagedBuildInfo.message.init.ok = Initializing path container succeeded for {0}
|
||||
|
||||
# Default GNU Makefile Generator messages
|
||||
GnuMakefileGenerator.message.postproc.dep.file=Verifying contents of dependency file {0}
|
||||
GnuMakefileGenerator.message.postproc.dep.file=Verifying contents of dependency file {0}
|
||||
|
||||
# Tool strings
|
||||
Tool.default.announcement=Invoking:
|
|
@ -1067,7 +1067,7 @@ public class Target extends BuildObject implements ITarget {
|
|||
newTool.setToolCommand(toolRef.getRawToolCommand());
|
||||
newTool.setOutputPrefix(toolRef.getRawOutputPrefix());
|
||||
newTool.setOutputFlag(toolRef.getRawOutputFlag());
|
||||
newTool.setOutputExtensions(toolRef.getRawOutputExtensions());
|
||||
newTool.setOutputsAttribute(toolRef.getRawOutputExtensions());
|
||||
// Handle ToolReference children (OptionReference)
|
||||
Iterator optRefIter = toolRef.getOptionReferenceList().listIterator();
|
||||
while (optRefIter.hasNext()) {
|
||||
|
|
|
@ -470,8 +470,11 @@ public class TargetPlatform extends BuildObject implements ITargetPlatform {
|
|||
* @deprecated
|
||||
*/
|
||||
public void setBinaryParserId(String id) {
|
||||
String[] ids = new String[]{id};
|
||||
setBinaryParserList(ids);
|
||||
if (id == null) {
|
||||
setBinaryParserList(new String[0]);
|
||||
} else {
|
||||
setBinaryParserList(new String[]{id});
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
|||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedIsToolChainSupported;
|
||||
import org.eclipse.cdt.managedbuilder.core.IProjectType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITargetPlatform;
|
||||
|
@ -52,6 +53,8 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
private String errorParserIds;
|
||||
private List osList;
|
||||
private List archList;
|
||||
private String targetToolId;
|
||||
private String secondaryOutputIds;
|
||||
private Boolean isAbstract;
|
||||
private String scannerConfigDiscoveryProfileId;
|
||||
private IConfigurationElement managedIsToolChainSupportedElement = null;
|
||||
|
@ -207,6 +210,12 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
if (toolChain.archList != null) {
|
||||
archList = new ArrayList(toolChain.archList);
|
||||
}
|
||||
if (toolChain.targetToolId != null) {
|
||||
targetToolId = new String(toolChain.targetToolId);
|
||||
}
|
||||
if (toolChain.secondaryOutputIds != null) {
|
||||
secondaryOutputIds = new String(toolChain.secondaryOutputIds);
|
||||
}
|
||||
if (toolChain.isAbstract != null) {
|
||||
isAbstract = new Boolean(toolChain.isAbstract.booleanValue());
|
||||
}
|
||||
|
@ -299,6 +308,12 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
// Get the semicolon separated list of IDs of the error parsers
|
||||
errorParserIds = element.getAttribute(ERROR_PARSERS);
|
||||
|
||||
// Get the semicolon separated list of IDs of the secondary outputs
|
||||
secondaryOutputIds = element.getAttribute(SECONDARY_OUTPUTS);
|
||||
|
||||
// Get the target tool id
|
||||
targetToolId = element.getAttribute(TARGET_TOOL);
|
||||
|
||||
// Get the scanner config discovery profile id
|
||||
scannerConfigDiscoveryProfileId = element.getAttribute(SCANNER_CONFIG_PROFILE_ID);
|
||||
|
||||
|
@ -372,6 +387,16 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
errorParserIds = element.getAttribute(ERROR_PARSERS);
|
||||
}
|
||||
|
||||
// Get the semicolon separated list of IDs of the secondary outputs
|
||||
if (element.hasAttribute(SECONDARY_OUTPUTS)) {
|
||||
secondaryOutputIds = element.getAttribute(SECONDARY_OUTPUTS);
|
||||
}
|
||||
|
||||
// Get the target tool id
|
||||
if (element.hasAttribute(TARGET_TOOL)) {
|
||||
targetToolId = element.getAttribute(TARGET_TOOL);
|
||||
}
|
||||
|
||||
// Get the scanner config discovery profile id
|
||||
if (element.hasAttribute(SCANNER_CONFIG_PROFILE_ID)) {
|
||||
scannerConfigDiscoveryProfileId = element.getAttribute(SCANNER_CONFIG_PROFILE_ID);
|
||||
|
@ -429,6 +454,14 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
if (errorParserIds != null) {
|
||||
element.setAttribute(ERROR_PARSERS, errorParserIds);
|
||||
}
|
||||
|
||||
if (secondaryOutputIds != null) {
|
||||
element.setAttribute(SECONDARY_OUTPUTS, secondaryOutputIds);
|
||||
}
|
||||
|
||||
if (targetToolId != null) {
|
||||
element.setAttribute(TARGET_TOOL, targetToolId);
|
||||
}
|
||||
|
||||
if (scannerConfigDiscoveryProfileId != null) {
|
||||
element.setAttribute(SCANNER_CONFIG_PROFILE_ID, scannerConfigDiscoveryProfileId);
|
||||
|
@ -726,6 +759,53 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
return ids;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getSecondaryOutputs()
|
||||
*/
|
||||
public IOutputType[] getSecondaryOutputs() {
|
||||
IOutputType[] types = null;
|
||||
String ids = secondaryOutputIds;
|
||||
if (ids == null) {
|
||||
if (superClass != null) {
|
||||
return superClass.getSecondaryOutputs();
|
||||
}
|
||||
else {
|
||||
return new IOutputType[0];
|
||||
}
|
||||
}
|
||||
StringTokenizer tok = new StringTokenizer(ids, ";"); //$NON-NLS-1$
|
||||
types = new IOutputType[tok.countTokens()];
|
||||
ITool[] tools = getTools();
|
||||
int i = 0;
|
||||
while (tok.hasMoreElements()) {
|
||||
String id = tok.nextToken();
|
||||
for (int j=0; j<tools.length; j++) {
|
||||
IOutputType type;
|
||||
type = tools[j].getOutputTypeById(id);
|
||||
if (type != null) {
|
||||
types[i++] = type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getTargetTool()
|
||||
*/
|
||||
public String getTargetToolId() {
|
||||
if (targetToolId == null) {
|
||||
// Ask superClass for its list
|
||||
if (superClass != null) {
|
||||
return superClass.getTargetToolId();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return targetToolId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#getErrorParserIds(IConfiguration)
|
||||
*/
|
||||
|
@ -835,6 +915,28 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setSecondaryOutputs()
|
||||
*/
|
||||
public void setSecondaryOutputs(String newIds) {
|
||||
if (secondaryOutputIds == null && newIds == null) return;
|
||||
if (secondaryOutputIds == null || newIds == null || !newIds.equals(secondaryOutputIds)) {
|
||||
secondaryOutputIds = newIds;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setTargetTool()
|
||||
*/
|
||||
public void setTargetTool(String newId) {
|
||||
if (targetToolId == null && newId == null) return;
|
||||
if (targetToolId == null || newId == null || !newId.equals(targetToolId)) {
|
||||
targetToolId = newId;
|
||||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IToolChain#setOSList(String[])
|
||||
|
@ -980,13 +1082,13 @@ public class ToolChain extends BuildObject implements IToolChain {
|
|||
if (tools != null) {
|
||||
for (int i = 0; i < tools.length; i++) {
|
||||
ITool tool = tools[i];
|
||||
String[] extensions = tool.getOutputExtensions();
|
||||
String[] extensions = tool.getOutputsAttribute();
|
||||
if (extensions == null) {
|
||||
tool.setOutputExtensions(""); //$NON-NLS-1$
|
||||
tool.setOutputsAttribute(""); //$NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
if (extensions.length == 0){
|
||||
tool.setOutputExtensions(""); //$NON-NLS-1$
|
||||
tool.setOutputsAttribute(""); //$NON-NLS-1$
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2003,2004 IBM Corporation and others.
|
||||
* Copyright (c) 2003, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -18,15 +18,18 @@ import java.util.List;
|
|||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfigurationV2;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedConfigElement;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IToolReference;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -164,7 +167,7 @@ public class ToolReference implements IToolReference {
|
|||
command = tool.getToolCommand();
|
||||
outputFlag = tool.getOutputFlag();
|
||||
outputPrefix = tool.getOutputPrefix();
|
||||
String[] extensions = tool.getOutputExtensions();
|
||||
String[] extensions = tool.getOutputsAttribute();
|
||||
outputExtensions = new String();
|
||||
if (extensions != null) {
|
||||
for (int index = 0; index < extensions.length; ++index) {
|
||||
|
@ -328,7 +331,12 @@ public class ToolReference implements IToolReference {
|
|||
* @see org.eclipse.cdt.managedbuilder.core.ITool#getInputExtensions()
|
||||
*/
|
||||
public List getInputExtensions() {
|
||||
return getTool().getInputExtensions();
|
||||
String[] exts = getPrimaryInputExtensions();
|
||||
List extList = new ArrayList();
|
||||
for (int i=0; i<exts.length; i++) {
|
||||
extList.add(exts[i]);
|
||||
}
|
||||
return extList;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -574,7 +582,7 @@ public class ToolReference implements IToolReference {
|
|||
public String[] getOutputExtensions() {
|
||||
if (outputExtensions == null){
|
||||
if (parent != null) {
|
||||
return parent.getOutputExtensions();
|
||||
return parent.getOutputsAttribute();
|
||||
} else {
|
||||
return new String[0];
|
||||
}
|
||||
|
@ -751,6 +759,57 @@ public class ToolReference implements IToolReference {
|
|||
isDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#setParent(IBuildObject)
|
||||
*/
|
||||
public void setToolParent(IBuildObject newParent) {
|
||||
if (parent == null) {
|
||||
// bad reference
|
||||
return;
|
||||
}
|
||||
// Set the parent in the parent of this ToolRefernce, the tool
|
||||
((Tool)parent).setToolParent(newParent);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getParent()
|
||||
*/
|
||||
public IBuildObject getParent() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLinePattern()
|
||||
*/
|
||||
public String getCommandLinePattern() {
|
||||
if( parent == null ) return new String();
|
||||
return parent.getCommandLinePattern();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGenerator()
|
||||
*/
|
||||
public IManagedCommandLineGenerator getCommandLineGenerator() {
|
||||
if( parent == null ) return null;
|
||||
return parent.getCommandLineGenerator();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getDependencyGenerator()
|
||||
*/
|
||||
public IManagedDependencyGenerator getDependencyGenerator() {
|
||||
if( parent == null ) return null;
|
||||
return parent.getDependencyGenerator();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandFlags()
|
||||
*/
|
||||
public String[] getCommandFlags() throws BuildException {
|
||||
if( parent == null ) return null;
|
||||
return parent.getCommandFlags();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
|
@ -825,6 +884,180 @@ public class ToolReference implements IToolReference {
|
|||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#createOption()
|
||||
*/
|
||||
public IOption createOption(IOption superClass, String Id, String name, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#removeOption()
|
||||
*/
|
||||
public void removeOption(IOption o) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getChildCategories()
|
||||
*/
|
||||
public IOptionCategory[] getChildCategories() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#setIsAbstract(boolean)
|
||||
*/
|
||||
public void setIsAbstract(boolean b) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLinePattern()
|
||||
*/
|
||||
public void setCommandLinePattern(String pattern) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#setCommandLineGenerator(IConfigurationElement)
|
||||
*/
|
||||
public void setCommandLineGeneratorElement(IConfigurationElement element) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGenerator()
|
||||
*/
|
||||
public IConfigurationElement getDependencyGeneratorElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#setCommandLineGenerator(IConfigurationElement)
|
||||
*/
|
||||
public void setDependencyGeneratorElement(IConfigurationElement element) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGeneratorElement()
|
||||
*/
|
||||
public IConfigurationElement getCommandLineGeneratorElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getAdvancedInputCategory()
|
||||
*/
|
||||
public boolean getAdvancedInputCategory() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#setAdvancedInputCategory()
|
||||
*/
|
||||
public void setAdvancedInputCategory(boolean display) {
|
||||
}
|
||||
|
||||
public IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getAnnouncement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInputType getInputTypeById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInputType[] getInputTypes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOutputType getOutputTypeById(String id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOutputType[] getOutputTypes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void removeInputType(IInputType type) {
|
||||
}
|
||||
|
||||
public void removeOutputType(IOutputType type) {
|
||||
}
|
||||
|
||||
public void setAnnouncement(String announcement) {
|
||||
}
|
||||
|
||||
public String getDefaultInputExtension() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getAllInputExtensions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getPrimaryInputExtensions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInputType getInputType(String inputExtension) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getOutputsAttribute() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOutputType getOutputType(String outputExtension) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setOutputsAttribute(String extensions) {
|
||||
}
|
||||
|
||||
public String[] getAllOutputExtensions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getAllDependencyExtensions() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IInputType getPrimaryInputType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IOutputType getPrimaryOutputType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IPath[] getAdditionalDependencies() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IPath[] getAdditionalResources() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IConfigurationElement getDependencyGeneratorElementForExtension(String sourceExt) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public IManagedDependencyGenerator getDependencyGeneratorForExtension(String sourceExt) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean getCustomBuildStep() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setCustomBuildStep(boolean customBuildStep) {
|
||||
}
|
||||
|
||||
/*
|
||||
* The following methods are added to allow the converter from ToolReference -> Tool
|
||||
* to retrieve the actual value of attributes. These routines do not go to the
|
||||
|
@ -859,112 +1092,4 @@ public class ToolReference implements IToolReference {
|
|||
return command;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#createOption()
|
||||
*/
|
||||
public IOption createOption(IOption superClass, String Id, String name, boolean b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#removeOption()
|
||||
*/
|
||||
public void removeOption(IOption o) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOptionCategory#getChildCategories()
|
||||
*/
|
||||
public IOptionCategory[] getChildCategories() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#setParent(IBuildObject)
|
||||
*/
|
||||
public void setToolParent(IBuildObject newParent) {
|
||||
if (parent == null) {
|
||||
// bad reference
|
||||
return;
|
||||
}
|
||||
// Set the parent in the parent of this ToolRefernce, the tool
|
||||
((Tool)parent).setToolParent(newParent);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.ITool#setIsAbstract(boolean)
|
||||
*/
|
||||
public void setIsAbstract(boolean b) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getParent()
|
||||
*/
|
||||
public IBuildObject getParent() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLinePattern()
|
||||
*/
|
||||
public String getCommandLinePattern() {
|
||||
if( parent == null ) return new String();
|
||||
return parent.getCommandLinePattern();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLinePattern()
|
||||
*/
|
||||
public void setCommandLinePattern(String pattern) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGenerator()
|
||||
*/
|
||||
public IManagedCommandLineGenerator getCommandLineGenerator() {
|
||||
if( parent == null ) return null;
|
||||
return parent.getCommandLineGenerator();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGenerator()
|
||||
*/
|
||||
public IConfigurationElement getCommandLineGeneratorElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#setCommandLineGenerator(IConfigurationElement)
|
||||
*/
|
||||
public void setCommandLineGeneratorElement(IConfigurationElement element) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getDependencyGenerator()
|
||||
*/
|
||||
public IManagedDependencyGenerator getDependencyGenerator() {
|
||||
if( parent == null ) return null;
|
||||
return parent.getDependencyGenerator();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandLineGenerator()
|
||||
*/
|
||||
public IConfigurationElement getDependencyGeneratorElement() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#setCommandLineGenerator(IConfigurationElement)
|
||||
*/
|
||||
public void setDependencyGeneratorElement(IConfigurationElement element) {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.ITool#getCommandFlags()
|
||||
*/
|
||||
public String[] getCommandFlags() throws BuildException {
|
||||
if( parent == null ) return null;
|
||||
return parent.getCommandFlags();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,8 @@ public interface IManagedBuilderMakefileGenerator {
|
|||
public String getMakefileName();
|
||||
|
||||
/**
|
||||
* This method initializes the makefile generator
|
||||
*
|
||||
* @param project
|
||||
* @param info
|
||||
* @param monitor
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,106 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.makegen.gnu;
|
||||
|
||||
import java.util.Vector;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* This interface returns information about a Tool's inputs
|
||||
* and outputs while a Gnu makefile is being generated.
|
||||
*/
|
||||
public interface IManagedBuildGnuToolInfo {
|
||||
public final String DOT = "."; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the tool's inputs have been calculated,
|
||||
* else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean areInputsCalculated();
|
||||
|
||||
/**
|
||||
* Returns the tool's inputs in command line format. This will use
|
||||
* variables rather than actual file names as appropriate.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getCommandInputs();
|
||||
|
||||
/**
|
||||
* Returns the raw list of tool's input file names.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getEnumeratedInputs();
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the tool's outputs have been calculated,
|
||||
* else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean areOutputsCalculated();
|
||||
|
||||
/**
|
||||
* Returns the tool's outputs in command line format. This will use
|
||||
* variables rather than actual file names as appropriate.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getCommandOutputs();
|
||||
|
||||
/**
|
||||
* Returns the raw list of tool's output file names.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getEnumeratedOutputs();
|
||||
|
||||
/**
|
||||
* Returns the raw list of tool's output variable names.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getOutputVariables();
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the tool's dependencies have been calculated,
|
||||
* else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean areDependenciesCalculated();
|
||||
|
||||
/**
|
||||
* Returns the tool's dependencies in command line format. This will use
|
||||
* variables rather than actual file names as appropriate.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getCommandDependencies();
|
||||
|
||||
/**
|
||||
* Returns the raw list of tool's input dependencies.
|
||||
*
|
||||
* @return Vector
|
||||
*/
|
||||
//public Vector getEnumeratedDependencies();
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if this is the target tool
|
||||
* else <code>false</code>.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isTargetTool();
|
||||
}
|
|
@ -0,0 +1,681 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2005 Intel Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
**********************************************************************/
|
||||
package org.eclipse.cdt.managedbuilder.makegen.gnu;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Vector;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.eclipse.cdt.managedbuilder.core.IAdditionalInput;
|
||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOutputType;
|
||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||
import org.eclipse.cdt.managedbuilder.core.IManagedOutputNameProvider;
|
||||
import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.ManagedMakeMessages;
|
||||
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
|
||||
import org.eclipse.cdt.managedbuilder.makegen.gnu.GnuMakefileGenerator;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
|
||||
/**
|
||||
* This class represents information about a Tool's inputs
|
||||
* and outputs while a Gnu makefile is being generated.
|
||||
*/
|
||||
public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
||||
|
||||
private static final String EMPTY_STRING = new String();
|
||||
private static final String OBJS_MACRO = "OBJS"; //$NON-NLS-1$
|
||||
private static final String DEPS_MACRO = "DEPS"; //$NON-NLS-1$
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
private IProject project;
|
||||
private Tool tool;
|
||||
private boolean bIsTargetTool;
|
||||
private String targetName;
|
||||
private String targetExt;
|
||||
private boolean inputsCalculated = false;
|
||||
private boolean outputsCalculated = false;
|
||||
private boolean outputVariablesCalculated = false;
|
||||
private boolean dependenciesCalculated = false;
|
||||
private Vector commandInputs = new Vector();
|
||||
private Vector enumeratedInputs = new Vector();
|
||||
private Vector commandOutputs = new Vector();
|
||||
private Vector enumeratedOutputs = new Vector();
|
||||
private Vector outputVariables = new Vector();
|
||||
private Vector commandDependencies = new Vector();
|
||||
//private Vector enumeratedDependencies = new Vector();
|
||||
// Map of macro names (String) to values (List)
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
public ManagedBuildGnuToolInfo(IProject project, ITool tool, boolean targetTool, String name, String ext) {
|
||||
this.project = project;
|
||||
this.tool = (Tool)tool;
|
||||
bIsTargetTool = targetTool;
|
||||
if (bIsTargetTool) {
|
||||
targetName = name;
|
||||
targetExt = ext;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* IManagedBuildGnuToolInfo Methods
|
||||
*/
|
||||
public boolean areInputsCalculated() {
|
||||
return inputsCalculated;
|
||||
}
|
||||
|
||||
public Vector getCommandInputs() {
|
||||
return commandInputs;
|
||||
}
|
||||
|
||||
public Vector getEnumeratedInputs() {
|
||||
return enumeratedInputs;
|
||||
}
|
||||
|
||||
public boolean areOutputsCalculated() {
|
||||
return outputsCalculated;
|
||||
}
|
||||
|
||||
public Vector getCommandOutputs() {
|
||||
return commandOutputs;
|
||||
}
|
||||
|
||||
public Vector getEnumeratedOutputs() {
|
||||
return enumeratedOutputs;
|
||||
}
|
||||
|
||||
public Vector getOutputVariables() {
|
||||
return outputVariables;
|
||||
}
|
||||
|
||||
public boolean areOutputVariablesCalculated() {
|
||||
return outputVariablesCalculated;
|
||||
}
|
||||
|
||||
public boolean areDependenciesCalculated() {
|
||||
return dependenciesCalculated;
|
||||
}
|
||||
|
||||
public Vector getCommandDependencies() {
|
||||
return commandDependencies;
|
||||
}
|
||||
|
||||
//public Vector getEnumeratedDependencies() {
|
||||
// return enumeratedDependencies;
|
||||
//}
|
||||
|
||||
public boolean isTargetTool() {
|
||||
return bIsTargetTool;
|
||||
}
|
||||
|
||||
/*
|
||||
* Other Methods
|
||||
*/
|
||||
|
||||
public boolean calculateInputs(GnuMakefileGenerator makeGen, IResource[] projResources, boolean lastChance) {
|
||||
// Get the inputs for this tool invocation
|
||||
// Note that command inputs that are also dependencies are also added to the command dependencies list
|
||||
boolean done = true;
|
||||
Vector myCommandInputs = new Vector();
|
||||
Vector myCommandDependencies = new Vector();
|
||||
Vector myEnumeratedInputs = new Vector();
|
||||
|
||||
IInputType[] inTypes = tool.getInputTypes();
|
||||
if (inTypes != null && inTypes.length > 0) {
|
||||
for (int i=0; i<inTypes.length; i++) {
|
||||
IInputType type = inTypes[i];
|
||||
String variable = type.getBuildVariable();
|
||||
boolean useFileExts = false;
|
||||
if (variable.length() > 0) {
|
||||
String cmdVariable = variable = "$(" + variable + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
myCommandInputs.add(cmdVariable);
|
||||
myCommandDependencies.add(cmdVariable);
|
||||
// If there is an output variable with the same name, get
|
||||
// the files associated with it.
|
||||
List outMacroList = makeGen.getBuildVariableList(variable, true);
|
||||
if (outMacroList != null) {
|
||||
myEnumeratedInputs.addAll(outMacroList);
|
||||
} else {
|
||||
// If "last chance", then calculate using file extensions below
|
||||
if (lastChance) {
|
||||
useFileExts = true;
|
||||
} else {
|
||||
done = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (variable.length() == 0 || useFileExts) {
|
||||
if (type.getMultipleOfType()) {
|
||||
// Calculate myEnumeratedInputs using the file extensions and the resources in the project
|
||||
String[] exts = tool.getAllInputExtensions();
|
||||
if (projResources != null) {
|
||||
for (int j=0; j<projResources.length; j++) {
|
||||
if (projResources[i].getType() == IResource.FILE) {
|
||||
String fileExt = projResources[i].getFileExtension();
|
||||
for (int k=0; k<exts.length; k++) {
|
||||
if (fileExt.equals(exts[k])) {
|
||||
// TODO - is project relative correct?
|
||||
if (!useFileExts) {
|
||||
myCommandInputs.add(projResources[i].getProjectRelativePath());
|
||||
}
|
||||
myEnumeratedInputs.add(projResources[i].getProjectRelativePath());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Rule will be generated by addRuleForSource
|
||||
}
|
||||
}
|
||||
// Get any additional inputs specified in the manifest file or the project file
|
||||
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
|
||||
if (addlInputs != null) {
|
||||
for (int j=0; j<addlInputs.length; j++) {
|
||||
IAdditionalInput addlInput = addlInputs[j];
|
||||
int kind = addlInput.getKind();
|
||||
if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
|
||||
kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
|
||||
String paths = addlInput.getPaths();
|
||||
if (paths != null) {
|
||||
String[] pathTokens = paths.split(";"); //$NON-NLS-1$
|
||||
for (int k = 0; k < pathTokens.length; k++) {
|
||||
myCommandInputs.add(pathTokens[k]);
|
||||
myEnumeratedInputs.add(pathTokens[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// For support of pre-CDT 3.0 integrations.
|
||||
if (bIsTargetTool) {
|
||||
// NOTE WELL: This only suuports the case of a single "target tool"
|
||||
// with the following characteristics:
|
||||
// 1. The tool consumes exactly all of the object files produced
|
||||
// by other tools in the build and produces a single output
|
||||
// 2. The target name comes from the configuration artifact name
|
||||
// The rule looks like:
|
||||
// <targ_prefix><target>.<extension>: $(OBJS) <refd_project_1 ... refd_project_n>
|
||||
myCommandInputs.add("$(OBJS)"); //$NON-NLS-1$
|
||||
myCommandInputs.add("$(USER_OBJS)"); //$NON-NLS-1$
|
||||
myCommandInputs.add("$(LIBS)"); //$NON-NLS-1$
|
||||
} else {
|
||||
// Rule will be generated by addRuleForSource
|
||||
}
|
||||
}
|
||||
|
||||
if (done) {
|
||||
commandInputs.addAll(myCommandInputs);
|
||||
commandDependencies.addAll(myCommandDependencies);
|
||||
enumeratedInputs.addAll(myEnumeratedInputs);
|
||||
inputsCalculated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* The priorities for determining the names of the ouputs of a tool are:
|
||||
* 1. If the tool is the build target and primary output, use artifact name & extension
|
||||
* 2. If an option is specified, use the value of the option
|
||||
* 3. If a nameProvider is specified, call it
|
||||
* 4. If outputNames is specified, use it
|
||||
* 5. Use the name pattern to generate a transformation macro
|
||||
* so that the source names can be transformed into the target names
|
||||
* using the built-in string substitution functions of <code>make</code>.
|
||||
*/
|
||||
public boolean calculateOutputs(GnuMakefileGenerator makeGen, HashSet handledInputExtensions, boolean lastChance) {
|
||||
|
||||
boolean done = true;
|
||||
Vector myCommandOutputs = new Vector();
|
||||
Vector myEnumeratedOutputs = new Vector();
|
||||
HashMap myOutputMacros = new HashMap();
|
||||
// The next two fields are used together
|
||||
Vector myBuildVars = new Vector();
|
||||
Vector myBuildVarsValues = new Vector();
|
||||
|
||||
// Get the outputs for this tool invocation
|
||||
IOutputType[] outTypes = tool.getOutputTypes();
|
||||
if (outTypes != null && outTypes.length > 0) {
|
||||
for (int i=0; i<outTypes.length; i++) {
|
||||
Vector typeEnumeratedOutputs = new Vector();
|
||||
IOutputType type = outTypes[i];
|
||||
String outputPrefix = type.getOutputPrefix();
|
||||
String variable = type.getBuildVariable();
|
||||
boolean multOfType = type.getMultipleOfType();
|
||||
boolean primaryOutput = (type == tool.getPrimaryOutputType());
|
||||
IOption option = makeGen.getOption(tool, type.getOptionId());
|
||||
IManagedOutputNameProvider nameProvider = type.getNameProvider();
|
||||
String outputNames = type.getOutputNames();
|
||||
|
||||
// 1. If the tool is the build target and this is the primary output,
|
||||
// use artifact name & extension
|
||||
if (bIsTargetTool && primaryOutput) {
|
||||
String outputName = outputPrefix + targetName;
|
||||
if (targetExt.length() > 0) {
|
||||
outputName += (DOT + targetExt);
|
||||
}
|
||||
myCommandOutputs.add(outputName);
|
||||
typeEnumeratedOutputs.add(outputName);
|
||||
// But this doesn't use any output macro...
|
||||
} else
|
||||
// 2. If an option is specified, use the value of the option
|
||||
if (option != null) {
|
||||
try {
|
||||
List outputs = new ArrayList();
|
||||
int optType = option.getValueType();
|
||||
if (optType == IOption.STRING) {
|
||||
outputs.add(outputPrefix + option.getStringValue());
|
||||
} else if (
|
||||
optType == IOption.STRING_LIST ||
|
||||
optType == IOption.LIBRARIES ||
|
||||
optType == IOption.OBJECTS) {
|
||||
outputs = (List)option.getValue();
|
||||
// Add outputPrefix to each if necessary
|
||||
if (outputPrefix.length() > 0) {
|
||||
for (int j=0; j<outputs.size(); j++) {
|
||||
outputs.set(j, outputPrefix + outputs.get(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
myCommandOutputs.addAll(outputs);
|
||||
typeEnumeratedOutputs.addAll(outputs);
|
||||
if (variable.length() > 0) {
|
||||
if (myOutputMacros.containsKey(variable)) {
|
||||
List currList = (List)myOutputMacros.get(variable);
|
||||
currList.addAll(outputs);
|
||||
myOutputMacros.put(variable, currList);
|
||||
} else {
|
||||
myOutputMacros.put(variable, outputs);
|
||||
}
|
||||
}
|
||||
} catch( BuildException ex ) {
|
||||
}
|
||||
} else
|
||||
// 3. If a nameProvider is specified, call it
|
||||
if (nameProvider != null) {
|
||||
// The inputs must have been calculated before we can do this
|
||||
IPath[] outNames = null;
|
||||
if (!inputsCalculated) {
|
||||
done = false;
|
||||
} else {
|
||||
Vector inputs = getEnumeratedInputs();
|
||||
IPath[] inputPaths = new IPath[inputs.size()];
|
||||
for (int j=0; j<inputPaths.length; j++) {
|
||||
inputPaths[j] = Path.fromOSString((String)inputs.get(j));
|
||||
}
|
||||
outNames = nameProvider.getOutputNames(tool, inputPaths);
|
||||
if (outNames != null) {
|
||||
myCommandOutputs.addAll(Arrays.asList(outNames));
|
||||
typeEnumeratedOutputs.addAll(Arrays.asList(outNames));
|
||||
}
|
||||
}
|
||||
if (variable.length() > 0 && outNames != null) {
|
||||
if (myOutputMacros.containsKey(variable)) {
|
||||
List currList = (List)myOutputMacros.get(variable);
|
||||
currList.addAll(Arrays.asList(outNames));
|
||||
myOutputMacros.put(variable, currList);
|
||||
} else {
|
||||
myOutputMacros.put(variable, Arrays.asList(outNames));
|
||||
}
|
||||
}
|
||||
} else
|
||||
// 4. If outputNames is specified, use it
|
||||
if (outputNames != null) {
|
||||
String[] pathTokens = outputNames.split(";"); //$NON-NLS-1$
|
||||
if (pathTokens.length > 0) {
|
||||
List namesList = Arrays.asList(pathTokens);
|
||||
myCommandOutputs.addAll(namesList);
|
||||
typeEnumeratedOutputs.addAll(namesList);
|
||||
if (variable.length() > 0) {
|
||||
if (myOutputMacros.containsKey(variable)) {
|
||||
List currList = (List)myOutputMacros.get(variable);
|
||||
currList.addAll(namesList);
|
||||
myOutputMacros.put(variable, currList);
|
||||
} else {
|
||||
myOutputMacros.put(variable, namesList);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 5. Use the name pattern to generate a transformation macro
|
||||
// so that the source names can be transformed into the target names
|
||||
// using the built-in string substitution functions of <code>make</code>.
|
||||
if (multOfType) {
|
||||
// This case is not handled - a nameProvider or outputNames must be specified
|
||||
List errList = new ArrayList();
|
||||
errList.add(ManagedMakeMessages.getResourceString("MakefileGenerator.error.no.nameprovider")); //$NON-NLS-1$
|
||||
myCommandOutputs.add(errList);
|
||||
} else {
|
||||
String namePattern = type.getNamePattern();
|
||||
if (namePattern == null || namePattern.length() == 0) {
|
||||
namePattern = outputPrefix + IManagedBuilderMakefileGenerator.WILDCARD;
|
||||
}
|
||||
else if (outputPrefix.length() > 0) {
|
||||
namePattern = outputPrefix + namePattern;
|
||||
}
|
||||
String outExt = (type.getOutputExtensions())[0];
|
||||
if (outExt != null && outExt.length() > 0) {
|
||||
namePattern += DOT + outExt;
|
||||
}
|
||||
|
||||
// Calculate the output name
|
||||
// The inputs must have been calculated before we can do this
|
||||
if (!inputsCalculated) {
|
||||
done = false;
|
||||
} else {
|
||||
Vector inputs = getEnumeratedInputs();
|
||||
String fileName;
|
||||
if (inputs.size() > 0) {
|
||||
// Get the input file name
|
||||
fileName = (Path.fromOSString((String)inputs.get(0))).removeFileExtension().lastSegment();
|
||||
// Check if this is a build macro. If so, use the raw macro name.
|
||||
if (fileName.startsWith("$(") && fileName.endsWith(")")) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
fileName = fileName.substring(2,fileName.length()-1);
|
||||
}
|
||||
} else {
|
||||
fileName = "default"; //$NON-NLS-1$
|
||||
}
|
||||
// Replace the % with the file name
|
||||
myCommandOutputs.add(namePattern.replaceAll("%", fileName)); //$NON-NLS-1$
|
||||
typeEnumeratedOutputs.add(namePattern.replaceAll("%", fileName)); //$NON-NLS-1$
|
||||
if (variable.length() > 0) {
|
||||
List outputs = new ArrayList();
|
||||
outputs.add(fileName);
|
||||
if (myOutputMacros.containsKey(variable)) {
|
||||
List currList = (List)myOutputMacros.get(variable);
|
||||
currList.addAll(outputs);
|
||||
myOutputMacros.put(variable, currList);
|
||||
} else {
|
||||
myOutputMacros.put(variable, outputs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (variable.length() > 0) {
|
||||
myBuildVars.add(variable);
|
||||
myBuildVarsValues.add(typeEnumeratedOutputs);
|
||||
}
|
||||
myEnumeratedOutputs.addAll(typeEnumeratedOutputs);
|
||||
}
|
||||
} else {
|
||||
if (bIsTargetTool) {
|
||||
String outputPrefix = tool.getOutputPrefix();
|
||||
String outputName = outputPrefix + targetName;
|
||||
if (targetExt.length() > 0) {
|
||||
outputName += (DOT + targetExt);
|
||||
}
|
||||
myCommandOutputs.add(outputName);
|
||||
myEnumeratedOutputs.add(outputName);
|
||||
} else {
|
||||
// For support of pre-CDT 3.0 integrations.
|
||||
// NOTE WELL: This only supports the case of a single "target tool"
|
||||
// that consumes exactly all of the object files, $OBJS, produced
|
||||
// by other tools in the build and produces a single output
|
||||
}
|
||||
}
|
||||
|
||||
// Add the output macros of this tool to the buildOutVars map
|
||||
Iterator iterator = myOutputMacros.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry)iterator.next();
|
||||
String macroName = (String)entry.getKey();
|
||||
List newMacroValue = (List)entry.getValue();
|
||||
HashMap map = makeGen.getBuildOutputVars();
|
||||
if (map.containsKey(macroName)) {
|
||||
List macroValue = (List)map.get(macroName);
|
||||
macroValue.addAll(newMacroValue);
|
||||
map.put(macroName, macroValue);
|
||||
} else {
|
||||
map.put(macroName, newMacroValue);
|
||||
}
|
||||
}
|
||||
outputVariablesCalculated = true;
|
||||
|
||||
if (done) {
|
||||
commandOutputs.addAll(myCommandOutputs);
|
||||
enumeratedOutputs.addAll(myEnumeratedOutputs);
|
||||
outputVariables.addAll(myOutputMacros.keySet());
|
||||
outputsCalculated = true;
|
||||
for (int i=0; i<myBuildVars.size(); i++) {
|
||||
makeGen.addMacroAdditionFiles(makeGen.getTopBuildOutputVars(), (String)myBuildVars.get(i), (Vector)myBuildVarsValues.get(i));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean calculateDependencies(GnuMakefileGenerator makeGen, HashSet handledInputExtensions, boolean lastChance) {
|
||||
// Get the dependencies for this tool invocation
|
||||
boolean done = true;
|
||||
Vector myCommandDependencies = new Vector();
|
||||
//Vector myEnumeratedDependencies = new Vector();
|
||||
HashMap myOutputMacros = new HashMap();
|
||||
|
||||
IInputType[] inTypes = tool.getInputTypes();
|
||||
if (inTypes != null && inTypes.length > 0) {
|
||||
for (int i=0; i<inTypes.length; i++) {
|
||||
IInputType type = inTypes[i];
|
||||
String variable = type.getBuildVariable();
|
||||
|
||||
IManagedDependencyGenerator depGen = type.getDependencyGenerator();
|
||||
if (depGen != null) {
|
||||
int calcType = depGen.getCalculatorType();
|
||||
switch (calcType) {
|
||||
case IManagedDependencyGenerator.TYPE_COMMAND:
|
||||
// iterate over all extensions that the tool knows how to handle
|
||||
String[] extensionsList = type.getSourceExtensions();
|
||||
for (int j=0; j<extensionsList.length; j++) {
|
||||
String extensionName = extensionsList[j];
|
||||
|
||||
// Generated files should not appear in the list.
|
||||
if(!makeGen.getOutputExtensions().contains(extensionName) && !handledInputExtensions.contains(extensionName)) {
|
||||
handledInputExtensions.add(extensionName);
|
||||
String depsMacro = calculateSourceMacro(makeGen, extensionName, IManagedBuilderMakefileGenerator.DEP_EXT,
|
||||
IManagedBuilderMakefileGenerator.WILDCARD);
|
||||
|
||||
List depsList = new ArrayList();
|
||||
depsList.add(depsMacro);
|
||||
if (myOutputMacros.containsKey(DEPS_MACRO)) {
|
||||
List currList = (List)myOutputMacros.get(DEPS_MACRO);
|
||||
currList.addAll(depsList);
|
||||
myOutputMacros.put(DEPS_MACRO, currList);
|
||||
} else {
|
||||
myOutputMacros.put(DEPS_MACRO, depsList);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IManagedDependencyGenerator.TYPE_INDEXER:
|
||||
case IManagedDependencyGenerator.TYPE_EXTERNAL:
|
||||
// The inputs must have been calculated before we can do this
|
||||
if (!inputsCalculated) {
|
||||
done = false;
|
||||
} else {
|
||||
Vector inputs = getEnumeratedInputs();
|
||||
for (int j=0; j<inputs.size(); j++) {
|
||||
IResource[] outNames = depGen.findDependencies(project.getFile((String)inputs.get(j)), project);
|
||||
if (outNames != null) {
|
||||
for (int k=0; k<outNames.length; k++) {
|
||||
myCommandDependencies.add(outNames[k].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Add additional dependencies specified in AdditionalInput elements
|
||||
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
|
||||
if (addlInputs != null && addlInputs.length > 0) {
|
||||
for (int j=0; j<addlInputs.length; j++) {
|
||||
IAdditionalInput addlInput = addlInputs[j];
|
||||
int kind = addlInput.getKind();
|
||||
if (kind == IAdditionalInput.KIND_ADDITIONAL_DEPENDENCY ||
|
||||
kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
|
||||
String paths = addlInput.getPaths();
|
||||
if (paths != null) {
|
||||
String[] pathTokens = paths.split(";"); //$NON-NLS-1$
|
||||
for (int k = 0; k < pathTokens.length; k++) {
|
||||
myCommandDependencies.add(pathTokens[k]);
|
||||
//myEnumeratedInputs.add(pathTokens[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (bIsTargetTool) {
|
||||
// For support of pre-CDT 3.0 integrations.
|
||||
// NOTE WELL: This only supports the case of a single "target tool"
|
||||
// with the following characteristics:
|
||||
// 1. The tool consumes exactly all of the object files produced
|
||||
// by other tools in the build and produces a single output
|
||||
// 2. The target name comes from the configuration artifact name
|
||||
// The rule looks like:
|
||||
// <targ_prefix><target>.<extension>: $(OBJS) <refd_project_1 ... refd_project_n>
|
||||
myCommandDependencies.add("$(OBJS)"); //$NON-NLS-1$
|
||||
myCommandDependencies.add("$(USER_OBJS)"); //$NON-NLS-1$
|
||||
} else {
|
||||
String[] extensionsList = tool.getAllInputExtensions();
|
||||
|
||||
// Handle dependencies from the dependencyCalculator
|
||||
IManagedDependencyGenerator depGen = tool.getDependencyGenerator();
|
||||
if (depGen != null) {
|
||||
int calcType = depGen.getCalculatorType();
|
||||
switch (calcType) {
|
||||
case IManagedDependencyGenerator.TYPE_COMMAND:
|
||||
// iterate over all extensions that the tool knows how to handle
|
||||
for (int i=0; i<extensionsList.length; i++) {
|
||||
String extensionName = extensionsList[i];
|
||||
|
||||
// Generated files should not appear in the list.
|
||||
if(!makeGen.getOutputExtensions().contains(extensionName) && !handledInputExtensions.contains(extensionName)) {
|
||||
handledInputExtensions.add(extensionName);
|
||||
String depsMacro = calculateSourceMacro(makeGen, extensionName, IManagedBuilderMakefileGenerator.DEP_EXT,
|
||||
IManagedBuilderMakefileGenerator.WILDCARD);
|
||||
|
||||
List depsList = new ArrayList();
|
||||
depsList.add(depsMacro);
|
||||
if (myOutputMacros.containsKey(DEPS_MACRO)) {
|
||||
List currList = (List)myOutputMacros.get(DEPS_MACRO);
|
||||
currList.addAll(depsList);
|
||||
myOutputMacros.put(DEPS_MACRO, currList);
|
||||
} else {
|
||||
myOutputMacros.put(DEPS_MACRO, depsList);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IManagedDependencyGenerator.TYPE_INDEXER:
|
||||
case IManagedDependencyGenerator.TYPE_EXTERNAL:
|
||||
// The inputs must have been calculated before we can do this
|
||||
if (!inputsCalculated) {
|
||||
done = false;
|
||||
} else {
|
||||
Vector inputs = getEnumeratedInputs();
|
||||
for (int j=0; j<inputs.size(); j++) {
|
||||
IResource[] outNames = depGen.findDependencies(project.getFile((String)inputs.get(j)), project);
|
||||
if (outNames != null) {
|
||||
for (int k=0; k<outNames.length; k++) {
|
||||
myCommandDependencies.add(outNames[k].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the output macros of this tool to the buildOutVars map
|
||||
Iterator iterator = myOutputMacros.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry)iterator.next();
|
||||
String macroName = (String)entry.getKey();
|
||||
List newMacroValue = (List)entry.getValue();
|
||||
HashMap map = makeGen.getBuildOutputVars();
|
||||
if (map.containsKey(macroName)) {
|
||||
List macroValue = (List)map.get(macroName);
|
||||
macroValue.addAll(newMacroValue);
|
||||
map.put(macroName, macroValue);
|
||||
} else {
|
||||
map.put(macroName, newMacroValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (done) {
|
||||
commandDependencies.addAll(myCommandDependencies);
|
||||
//enumeratedDependencies.addAll(myEnumeratedDependencies);
|
||||
dependenciesCalculated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Calculate the source macro for the given extension
|
||||
*/
|
||||
protected String calculateSourceMacro(GnuMakefileGenerator makeGen, String srcExtensionName, String outExtensionName, String wildcard) {
|
||||
StringBuffer macroName = makeGen.getSourceMacroName(srcExtensionName);
|
||||
String OptDotExt = ""; //$NON-NLS-1$
|
||||
if (outExtensionName != null) {
|
||||
OptDotExt = DOT + outExtensionName;
|
||||
} else
|
||||
if (tool.getOutputExtension(srcExtensionName) != "") //$NON-NLS-1$
|
||||
OptDotExt = DOT + tool.getOutputExtension(srcExtensionName);
|
||||
|
||||
// create rule of the form
|
||||
// OBJS = $(macroName1: $(ROOT)/%.input1=%.output1) ... $(macroNameN: $(ROOT)/%.inputN=%.outputN)
|
||||
StringBuffer objectsBuffer = new StringBuffer();
|
||||
objectsBuffer.append(IManagedBuilderMakefileGenerator.WHITESPACE + "$(" + macroName + //$NON-NLS-1$
|
||||
IManagedBuilderMakefileGenerator.COLON + "$(ROOT)" + //$NON-NLS-1$
|
||||
IManagedBuilderMakefileGenerator.SEPARATOR + IManagedBuilderMakefileGenerator.WILDCARD +
|
||||
DOT + srcExtensionName + "=" + wildcard + OptDotExt + ")" ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return objectsBuffer.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -348,7 +348,7 @@ class UpdateManagedProject20 {
|
|||
|
||||
if(oldToolRef.hasAttribute(IToolReference.OUTPUTS)){
|
||||
String outputs = oldToolRef.getAttribute(IToolReference.OUTPUTS);
|
||||
tool.setOutputExtensions(outputs);
|
||||
tool.setOutputsAttribute(outputs);
|
||||
}
|
||||
|
||||
NodeList optRefs = oldToolRef.getElementsByTagName(ITool.OPTION_REF);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 2004 IBM Corporation and others.
|
||||
* Copyright (c) 2004, 2005 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v0.5
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -256,8 +256,8 @@ public class BuildToolSettingsPage extends BuildSettingsPage {
|
|||
}
|
||||
|
||||
String outputName = "temp"; //$NON-NLS-1$
|
||||
if (tool.getInputExtensions().get(0) != null) {
|
||||
outputName += tool.getInputExtensions().get(0);
|
||||
if (tool.getDefaultInputExtension() != null) {
|
||||
outputName += tool.getDefaultInputExtension();
|
||||
}
|
||||
String[] f = new String[ flags.size() ];
|
||||
IManagedCommandLineGenerator gen = tool.getCommandLineGenerator();
|
||||
|
|
Loading…
Add table
Reference in a new issue