1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 21:35:40 +02:00

Work for bug 52647.

This commit is contained in:
Sean Evoy 2004-02-24 15:18:13 +00:00
parent 5872a87f8c
commit 73178a9453
9 changed files with 1538 additions and 1321 deletions

View file

@ -1,337 +1,361 @@
2004-02-17 Sean Evoy 2004-02-23 Sean Evoy
Fix for critical bug 44163. Fix for bug 52647.
The managed build info would become confused when the project it was associated In 1.2, the target stored the raw, overridden build command the user
with was renamed. The project still stored the build information in its session specified on the property page. This string may or may not have included
data, but the internal reference to the owner project was not updated in the arguments to make. The managed build info was responsible for parsing the
build info. Now, when the build info is retrieved from a project, the manager command from the arguments and returning both to the makefile generator.
asks the info to do a sanity test to check the identity of the true owner against The problem was that the logic was too light-weight to really parse a
the owner the it thinks it has. If they differ, the build information updates its complex command line. That logic has been refactored to the property page itself,
owner and the owner of all the targets it maintains for the project. so the price of parsing is payed once.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java The Target and its public interface have been reworked to set and get the
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java arguments for make. This is treated as a project-level setting. It cannot
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java be defined in a manifest for now. There is also a capability to reset and
test the args when checking for an overridden make command in a target.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
Fixes for 51646 * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Moved the makefile comment character out of the hard-coded strings and into
the makefile generator. The arguments are now passed to the spawner that launches make correctly.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
The ManagedBuildInfo is off the hook now. Rather than performing any
Fixes for bug 49590: parsing or foo-fa-raw, it simply delegates the lookup to the target.
The target maintains the default extension and the overridden extension. There * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
is an interface to get and set the extension, but the method to get the default
extension is deprecated. 2004-02-17 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java Fix for critical bug 44163.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java The managed build info would become confused when the project it was associated
with was renamed. The project still stored the build information in its session
The build information now has a method to get at the extension data, but the internal reference to the owner project was not updated in the
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java build info. Now, when the build info is retrieved from a project, the manager
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java asks the info to do a sanity test to check the identity of the true owner against
the owner the it thinks it has. If they differ, the build information updates its
The makefile generator now asks for both the name and the extension when owner and the owner of all the targets it maintains for the project.
generating targets and dependencies. * src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
2003-10-23 Bogdan Gheorghe * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Updated the indexManager.perfomConcurrentJob call in MakefileGenerator
2003-10-03 Sean Evoy Fixes for 51646
Fix for critical bug 44134. Moved the makefile comment character out of the hard-coded strings and into
the makefile generator.
The problem lies in how the makefile is generated when a build target * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
references other projects. The makefile creates a command to change to * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
the build directory of the referenced project and call $(MAKE) there, i.e.
cd <dep_project_build_dir>; $(MAKE) clean all Fixes for bug 49590:
The target maintains the default extension and the overridden extension. There
The problem arises when the directory change fails. As of RC0, the command is an interface to get and set the extension, but the method to get the default
after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive extension is deprecated.
make call in the build directory of the build target and 'make' will keep * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
invoking more 'make's until Eclipse runs out of memory. With a manual build, * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
the user can still cancel the build. When autobuild is turned on, they cannot.
The only way to shut down Eclipse under that scenario is to kill it, and when The build information now has a method to get at the extension
it restarts, autobuild is still enabled and the problem repeats. * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
cd <dep_project_build_dir> && $(MAKE) clean all The makefile generator now asks for both the name and the extension when
generating targets and dependencies.
When the dependencies are generated this way, the 'cd' will fail as will the * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
build. The final tweak is to ignore the 'cd' failure and allow the rest of
the build to continue, i.e. 2003-10-23 Bogdan Gheorghe
-cd <dep_project_build_dir> && $(MAKE) clean all Updated the indexManager.perfomConcurrentJob call in MakefileGenerator
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java 2003-10-03 Sean Evoy
Fix for critical bug 44134.
2003-10-01 Sean Evoy
Final fix for bugs 44020. The problem lies in how the makefile is generated when a build target
The problem lay with the way that new projects were being created when the references other projects. The makefile creates a command to change to
root configuration of the project had tool references overriding options. the build directory of the referenced project and call $(MAKE) there, i.e.
What the new configuration should have been doing is making a personal copy cd <dep_project_build_dir>; $(MAKE) clean all
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it. The problem arises when the directory change fails. As of RC0, the command
after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive
OptionReference provides a method to retreive its option (so new make call in the build directory of the build target and 'make' will keep
OptionReferences can be cloned). invoking more 'make's until Eclipse runs out of memory. With a manual build,
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java the user can still cancel the build. When autobuild is turned on, they cannot.
The only way to shut down Eclipse under that scenario is to kill it, and when
Configuration now behaves correctly when it is created from another configuration. it restarts, autobuild is still enabled and the problem repeats.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
2003-10-01 Sean Evoy cd <dep_project_build_dir> && $(MAKE) clean all
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of When the dependencies are generated this way, the 'cd' will fail as will the
project natures that the tool should be filtered against in the build model build. The final tweak is to ignore the 'cd' failure and allow the rest of
and UI. the build to continue, i.e.
* schema/ManagedBuildTools.exsd -cd <dep_project_build_dir> && $(MAKE) clean all
Updated the ITool interface and its mplementors to pay attention to this new * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
attribute when loading from a plugin file. Clients can querry for a numeric
constant indicating the filter. 2003-10-01 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/core/ITool.java Final fix for bugs 44020.
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java The problem lay with the way that new projects were being created when the
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
All the methods in managed build manager that access information stored in a tool of the tool reference and its options. Instead, they were all sharing the
first check that the tool is valid for the project nature. parents. Seems simple enough now that I found it.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
OptionReference provides a method to retreive its option (so new
Put a safety check in the option reference constructor when reading one in from OptionReferences can be cloned).
a project file. I the option reference is to an option not managed by the build * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
model, the constructor does not add itself to the runtime representation of the
model. Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
In preparation for 44020, each new target created is assigned a truly random ID. 2003-10-01 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
2003-09-30 Sean Evoy project natures that the tool should be filtered against in the build model
Fix for bug 41826. and UI.
* schema/ManagedBuildTools.exsd
Finished the use case for changing header files and triggering a build. I had
to add a new attribute to the build model schema to allow a build information Updated the ITool interface and its mplementors to pay attention to this new
client to determine that a file is considered a header file. attribute when loading from a plugin file. Clients can querry for a numeric
* schema/ManagedBuildTools.exsd constant indicating the filter.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
The ITool, and its implementors now have a method to test if an extension is * src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
considered to belong to a header file. The Tool also pays attention to the new * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
attribute when it reads itself in from the plugin file.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java All the methods in managed build manager that access information stored in a tool
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java first check that the tool is valid for the project nature.
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
There is a method for clients of this information on the BuildInfo interface and Put a safety check in the option reference constructor when reading one in from
its implementor. a project file. I the option reference is to an option not managed by the build
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java model, the constructor does not add itself to the runtime representation of the
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java model.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects. In preparation for 44020, each new target created is assigned a truly random ID.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The makefile generator had to be tweaked to properly add folders that are effected 2003-09-30 Sean Evoy
by header file changes. Fix for bug 41826.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Finished the use case for changing header files and triggering a build. I had
2003-09-26 Sean Evoy to add a new attribute to the build model schema to allow a build information
A partial implementation for bug 41826. This patch contains the logic to properly client to determine that a file is considered a header file.
respond in the face of the following project changes: * schema/ManagedBuildTools.exsd
1. A generated project element, such as the build target or an intermediate file, The ITool, and its implementors now have a method to test if an extension is
is deleted in the build project, or any projects it references. considered to belong to a header file. The Tool also pays attention to the new
2. The build settings change in the build project or any projects it attribute when it reads itself in from the plugin file.
references. * src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
In order to actually do this correctly, I had to stop being so precious during the * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
build. The makefile generator was was calculating the "build needed" state as it
walked the change delta. However, the Eclipse core has already determined that I There is a method for clients of this information on the BuildInfo interface and
need to do a build. Further, as I discovered earlier, it doesn't always pass what its implementor.
has changed in referenced projects as part of the delta. Essentially, that means I * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
will never be able to fully calculate the change set in the makefile generator's * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
delta visitor, and to even approximate a decent set of cases, the logic would quickly
bog down in complexity. The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects.
The solution is to trust Eclipse and alway invoke make when my incremental builder * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
is called. At worst, if there is no significant change, make will execute and
report nothing to be done. The makefile generator had to be tweaked to properly add folders that are effected
by header file changes.
The modified makefile builder no longer asks the makefile generator if it should * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
build. It also no longer cares if the change set is empty (make will report that).
Since it responds to changes in referenced project's build information, it also 2003-09-26 Sean Evoy
scrubs all relevant projects after building. Since a build might involve building A partial implementation for bug 41826. This patch contains the logic to properly
referenced project elements, those projects get their project views refreshed after respond in the face of the following project changes:
build. The build markers for referenced projects are removed prior to build.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java 1. A generated project element, such as the build target or an intermediate file,
is deleted in the build project, or any projects it references.
The makefile generator has been simplified. The resource delta visitor logic no 2. The build settings change in the build project or any projects it
longer trie to decide if a build should occur. The method to ask has been removed. references.
The class no longer throws an exception if the change set is empty. I am also a bit
more careful to call make with the right targets if a referenced project is built. In order to actually do this correctly, I had to stop being so precious during the
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java build. The makefile generator was was calculating the "build needed" state as it
walked the change delta. However, the Eclipse core has already determined that I
2003-09-26 Sean Evoy need to do a build. Further, as I discovered earlier, it doesn't always pass what
I added a fix to the builder and makefile generator to properly handle the following case. has changed in referenced projects as part of the delta. Essentially, that means I
Project A depends on Project B. Something changes in project B and the user requests will never be able to fully calculate the change set in the makefile generator's
that A be built. Inthis case, the incremental builder is invoked, but it is passed a delta visitor, and to even approximate a decent set of cases, the logic would quickly
0-length delta on the top resource. Now, the logic of the builder is to treat that case as a bog down in complexity.
build event that triggers no makefile regeneration, just an invocation of make.
The solution is to trust Eclipse and alway invoke make when my incremental builder
Now handles the case where there is no flag applied to the make command and just is called. At worst, if there is no significant change, make will execute and
passes the targets as arguments. report nothing to be done.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The modified makefile builder no longer asks the makefile generator if it should
The makefile generator now considers the case where the delta is for a project resource build. It also no longer cares if the change set is empty (make will report that).
and has no children. If so, it flags that a build is needed but no makefile generation Since it responds to changes in referenced project's build information, it also
occurs. It also throws a new exception if the top makefile is not saved. scrubs all relevant projects after building. Since a build might involve building
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java referenced project elements, those projects get their project views refreshed after
build. The build markers for referenced projects are removed prior to build.
2003-09-25 Sean Evoy * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
A patch to resolve the problem with refreshing the project after a build, or
bug 42522 if you care about those sorts of things. The managed make builder was The makefile generator has been simplified. The resource delta visitor logic no
calling refresh at inside a bad if statement. I corrected that and projects longer trie to decide if a build should occur. The method to ask has been removed.
refresh correctly. Of course, if you have the wrong binary parser selected you are The class no longer throws an exception if the change set is empty. I am also a bit
hosed. You will also notice that the string constants have been changed to more careful to call make with the right targets if a referenced project is built.
resolve to a different name. The standard builder uses this name and I wanted * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
to minimize the possibility of problems later.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java 2003-09-26 Sean Evoy
I added a fix to the builder and makefile generator to properly handle the following case.
Prepended "Managed" to the externalized string identifiers to avoid future overlap Project A depends on Project B. Something changes in project B and the user requests
with the standard build system. Had to update the makefile generator to use the that A be built. Inthis case, the incremental builder is invoked, but it is passed a
new identifiers. 0-length delta on the top resource. Now, the logic of the builder is to treat that case as a
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties build event that triggers no makefile regeneration, just an invocation of make.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Now handles the case where there is no flag applied to the make command and just
Changed the signature of the 'getMakeArguments' to return a string instead of an passes the targets as arguments.
array so the builder can invoke make with the user-specified args. I also changed * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
the logic of the getMakeCommand method in the implementor so that it only returns
a string containing the command itself. The makefile generator now considers the case where the delta is for a project resource
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java and has no children. If so, it flags that a build is needed but no makefile generation
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java occurs. It also throws a new exception if the top makefile is not saved.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Explicitly trim all arrays to size before converting them to String[] for Options
and Tools. 2003-09-25 Sean Evoy
*src/org/eclipse/cdt/managedbuilder/internal/core/Option.java A patch to resolve the problem with refreshing the project after a build, or
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java bug 42522 if you care about those sorts of things. The managed make builder was
calling refresh at inside a bad if statement. I corrected that and projects
Fixed a missing bit of logic in the Configuration when a user-object option is refresh correctly. Of course, if you have the wrong binary parser selected you are
deleted. Now the build model really does get rid of the the value. hosed. You will also notice that the string constants have been changed to
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java resolve to a different name. The standard builder uses this name and I wanted
to minimize the possibility of problems later.
2003-09-25 Sean Evoy * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
This patch contains a lot of changes needed to implement fixes for 42648 and
43122. Prepended "Managed" to the externalized string identifiers to avoid future overlap
with the standard build system. Had to update the makefile generator to use the
For 42648, the schema for the the target had to be modified to include a new identifiers.
comma-separated list of valid host platforms. * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* schema/ManagedBuildTools.exsd * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
The target had to be updated to properly read in and understand this info, and Changed the signature of the 'getMakeArguments' to return a string instead of an
the interface had to be updated to return a list to the clients in the UI. The array so the builder can invoke make with the user-specified args. I also changed
target was also changed slightly. It now uses a safer accessor method to get at the logic of the getMakeCommand method in the implementor so that it only returns
the list of tools it maintains. I have also stopped persisting non-variant info a string containing the command itself.
to the project file on serialize. There are elements of the target that are not * src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
subject to change by the user (yet) so they should not be saved. * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java Explicitly trim all arrays to size before converting them to String[] for Options
and Tools.
For 43122, I started by simply adding a tool reference to the configurations. *src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
The tool reference had option references for debug and optimization levels. It * src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
should have worked, but the model was not handling the inheritance properly. The
JUnit tests were not finding it because of how they were configured. It was most Fixed a missing bit of logic in the Configuration when a user-object option is
evident in the UI. So, the way configurations and tool reference search for deleted. Now the build model really does get rid of the the value.
overridden option references had to be modified. While I was in there, I cleaned * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
up some of the accessor and iteration code in ToolReference and OptionReference.
2003-09-25 Sean Evoy
For the configuration, the only significant change was a new search method to This patch contains a lot of changes needed to implement fixes for 42648 and
find all option references for a given tool, no matter where they are stored. 43122.
The method had to consider what was overridden in a child config, what was added by
a child config, and what the parent (or parents) define. For 42648, the schema for the the target had to be modified to include a
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java comma-separated list of valid host platforms.
* schema/ManagedBuildTools.exsd
Option reference now pays attention to overidden values in the plugin file. Until
now, it only handled the overrides in the project file. The target had to be updated to properly read in and understand this info, and
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java the interface had to be updated to return a list to the clients in the UI. The
target was also changed slightly. It now uses a safer accessor method to get at
The ToolReference now distinguishes between local option references which it the list of tools it maintains. I have also stopped persisting non-variant info
manages directly, and option references held by tool references in the parent(s) to the project file on serialize. There are elements of the target that are not
of its owner. It only serializes its own references, but when asked for options subject to change by the user (yet) so they should not be saved.
relating to the tool it references, it replies with all option references in its * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
hierarchy. * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
For 43122, I started by simply adding a tool reference to the configurations.
The tool reference had option references for debug and optimization levels. It
2003-09-25 Bogdan Gheorghe should have worked, but the model was not handling the inheritance properly. The
Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the JUnit tests were not finding it because of how they were configured. It was most
projects that dependend a file. evident in the UI. So, the way configurations and tool reference search for
overridden option references had to be modified. While I was in there, I cleaned
Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob up some of the accessor and iteration code in ToolReference and OptionReference.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java For the configuration, the only significant change was a new search method to
find all option references for a given tool, no matter where they are stored.
2003-09-24 Sean Evoy The method had to consider what was overridden in a child config, what was added by
Changed the implementor of IScannerInfo to answer only absolute paths when asked for a child config, and what the parent (or parents) define.
includes paths. Users will specify the includes paths in the managed build UI in such a way * src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
that the compiler will not complain. Either they will use absolute paths, or they will specify
them relative to the build directory. In the second case, it is easier for the managed builder Option reference now pays attention to overidden values in the plugin file. Until
to convert the paths relative to this directory into absolute paths before replying tha it is for now, it only handled the overrides in the project file.
the client to figure this out. * src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The ToolReference now distinguishes between local option references which it
2003-09-23 Sean Evoy manages directly, and option references held by tool references in the parent(s)
All the work in this patch is for critical bug 43292. In order to manage of its owner. It only serializes its own references, but when asked for options
configurations, there had to be a method through ITarget to remove relating to the tool it references, it replies with all option references in its
configurations. Also, to support the naming of newly created configurations, hierarchy.
I added a name method to the IConfiguration interface. Finally, the ITarget * src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
needed to support setting (and resetting) the make command to use when building.
* src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java 2003-09-25 Bogdan Gheorghe
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the
projects that dependend a file.
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob
hard-code the binary parser for project creation. There is a new getter
method in the interface and the implementor contains additional code to * src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java
extract the information from a project file or plugin manifest. The
interface also contains new strings to make changing the specification 2003-09-24 Sean Evoy
easier in the future. Changed the implementor of IScannerInfo to answer only absolute paths when asked for
* schema/ManagedBuildTools.exsd includes paths. Users will specify the includes paths in the managed build UI in such a way
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java that the compiler will not complain. Either they will use absolute paths, or they will specify
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java them relative to the build directory. In the second case, it is easier for the managed builder
to convert the paths relative to this directory into absolute paths before replying tha it is for
Fix for bug 41720: libraries are now found for Solaris and Linux the client to figure this out.
executables. The problem was the executable had no extension and * src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
the client of the build model passed null instead of the empty string.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java 2003-09-23 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java All the work in this patch is for critical bug 43292. In order to manage
configurations, there had to be a method through ITarget to remove
2003-09-16 Sean Evoy configurations. Also, to support the naming of newly created configurations,
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a I added a name method to the IConfiguration interface. Finally, the ITarget
more descriptive "addSourceDependencies". Added a flag when the needed to support setting (and resetting) the make command to use when building.
inter-project dependencies are calculated so that clean and all are * src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
properly passed to the make invocation. Finally, I replaced the hard-coded * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
'make' with $(MAKE) * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-19 Sean Evoy
It also contains some more work on 41826, specifically on the logic to Added a new field to the target specification in the build model to
implement a rebuild when the build settings change. The builder checks for hard-code the binary parser for project creation. There is a new getter
a build model change whenever a build is requested and responds appropriately. method in the interface and the implementor contains additional code to
The make targets (i.e. 'clean' and 'all') are also calculated differently now. extract the information from a project file or plugin manifest. The
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java interface also contains new strings to make changing the specification
easier in the future.
The build model was modified to set a dirty flag when an option changes. I also * schema/ManagedBuildTools.exsd
made a change to avoid an NPE when the build info was loaded. * src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java * src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java Fix for bug 41720: libraries are now found for Solaris and Linux
executables. The problem was the executable had no extension and
the client of the build model passed null instead of the empty string.
2003-09-15 Sean Evoy * src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
First submission of code to new project. Moved the managed builder * src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
source code out of the cdt.core project. This includes the code to
implement the build model, along with the shema and extension point 2003-09-16 Sean Evoy
declaration. Moved the builder, scnanaer info provider and managed Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
nature definitions into the package as well. more descriptive "addSourceDependencies". Added a flag when the
inter-project dependencies are calculated so that clean and all are
There are 2 new classes to handle the externalized strings: properly passed to the make invocation. Finally, I replaced the hard-coded
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java 'make' with $(MAKE)
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
It also contains some more work on 41826, specifically on the logic to
implement a rebuild when the build settings change. The builder checks for
a build model change whenever a build is requested and responds appropriately.
The make targets (i.e. 'clean' and 'all') are also calculated differently now.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The build model was modified to set a dirty flag when an option changes. I also
made a change to avoid an NPE when the build info was loaded.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
2003-09-15 Sean Evoy
First submission of code to new project. Moved the managed builder
source code out of the cdt.core project. This includes the code to
implement the build model, along with the shema and extension point
declaration. Moved the builder, scnanaer info provider and managed
nature definitions into the package as well.
There are 2 new classes to handle the externalized strings:
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties * src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties

View file

@ -26,6 +26,7 @@ public interface ITarget extends IBuildObject {
public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$ public static final String IS_ABSTRACT = "isAbstract"; //$NON-NLS-1$
public static final String IS_TEST = "isTest"; //$NON-NLS-1$ public static final String IS_TEST = "isTest"; //$NON-NLS-1$
public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$ public static final String MAKE_COMMAND = "makeCommand"; //$NON-NLS-1$
public static final String MAKE_ARGS = "makeArguments"; //$NON-NLS-1$
public static final String OS_LIST = "osList"; //$NON-NLS-1$ public static final String OS_LIST = "osList"; //$NON-NLS-1$
public static final String PARENT = "parent"; //$NON-NLS-1$ public static final String PARENT = "parent"; //$NON-NLS-1$
@ -95,6 +96,15 @@ public interface ITarget extends IBuildObject {
*/ */
public String getDefaultExtension(); public String getDefaultExtension();
/**
* Answers the command line arguments to pass to the make utility used
* by the receiver to build a project.
*
* @return
*/
public String getMakeArguments();
/** /**
* Answers the name of the make utility for the target. * Answers the name of the make utility for the target.
* *
@ -193,6 +203,14 @@ public interface ITarget extends IBuildObject {
*/ */
public void setArtifactName(String name); public void setArtifactName(String name);
/**
* Sets the arguments to be passed to the make utility used by the
* receiver to produce a build goal.
*
* @param makeArgs
*/
public void setMakeArguments(String makeArgs);
/** /**
* Sets the make command for the receiver to the value in the argument. * Sets the make command for the receiver to the value in the argument.
* *

View file

@ -335,9 +335,10 @@ public class GeneratedMakefileBuilder extends ACBuilder {
// Get the arguments to be passed to make from build model // Get the arguments to be passed to make from build model
ArrayList makeArgs = new ArrayList(); ArrayList makeArgs = new ArrayList();
String args = info.getMakeArguments(); String arg = info.getMakeArguments();
if (args.length() > 0) { String[] args = arg.split("\\s");
makeArgs.add(args); for (int i = 0; i < args.length; ++i) {
makeArgs.add(args[i]);
} }
makeArgs.addAll(Arrays.asList(getMakeTargets(fullBuild))); makeArgs.addAll(Arrays.asList(getMakeTargets(fullBuild)));
String[] makeTargets = (String[]) makeArgs.toArray(new String[makeArgs.size()]); String[] makeTargets = (String[]) makeArgs.toArray(new String[makeArgs.size()]);

View file

@ -19,15 +19,15 @@ import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.managedbuilder.core.BuildException; import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IOption; import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.ITarget; import org.eclipse.cdt.managedbuilder.core.ITarget;
import org.eclipse.cdt.managedbuilder.core.ITool; import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
@ -47,6 +47,11 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
private Map defaultConfigurations; private Map defaultConfigurations;
private ITarget defaultTarget; private ITarget defaultTarget;
/**
* Create a new managed build information for the IResource specified in the argument
*
* @param owner
*/
public ManagedBuildInfo(IResource owner) { public ManagedBuildInfo(IResource owner) {
targetMap = new HashMap(); targetMap = new HashMap();
targets = new ArrayList(); targets = new ArrayList();
@ -54,13 +59,20 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
this.owner = owner; this.owner = owner;
} }
/**
* Reads the build information from the project file and creates the
* internal representation of the build settings for the project.
*
* @param owner
* @param element
*/
public ManagedBuildInfo(IResource owner, Element element) { public ManagedBuildInfo(IResource owner, Element element) {
this(owner); this(owner);
Node child = element.getFirstChild();
// The id of the default configuration // The id of the default configuration
String defaultTargetId = null; String defaultTargetId = null;
List configIds = new ArrayList(); List configIds = new ArrayList();
Node child = element.getFirstChild();
while (child != null) { while (child != null) {
if (child.getNodeName().equals("target")) { if (child.getNodeName().equals("target")) {
new Target(this, (Element)child); new Target(this, (Element)child);
@ -495,46 +507,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeArguments() * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeArguments()
*/ */
public String getMakeArguments() { public String getMakeArguments() {
String arguments = new String(); return getDefaultTarget().getMakeArguments();
// The make command may or may not have any flags
ITarget target = getDefaultTarget();
String command = target.getMakeCommand();
// If it does, the flags will be everything between the '-' and the next space
int indexOfArgs = command.indexOf('-');
if (indexOfArgs != - 1) {
try {
String argsAndTargs = command.substring(indexOfArgs);
int indexOfTargs = argsAndTargs.indexOf(' ');
arguments = (indexOfTargs != -1) ?
argsAndTargs.substring(0, indexOfTargs) :
argsAndTargs;
// Make sure the arg list does not contain f or C
} catch (IndexOutOfBoundsException e) {
}
}
return arguments.trim();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeCommand() * @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getMakeCommand()
*/ */
public String getMakeCommand() { public String getMakeCommand() {
String command = new String(); return getDefaultTarget().getMakeCommand();
ITarget target = getDefaultTarget();
command = target.getMakeCommand();
// There may actually be arguments, so just get everything up to the first '-'
int indexOfArgs = command.indexOf('-');
if (indexOfArgs != -1) {
// Return ecverything up to the first argument as the command
return command.substring(0, indexOfArgs).trim();
} else {
return command.trim();
}
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -42,6 +42,7 @@ public class Target extends BuildObject implements ITarget {
private String extension; private String extension;
private boolean isAbstract = false; private boolean isAbstract = false;
private boolean isTest = false; private boolean isTest = false;
private String makeArguments;
private String makeCommand; private String makeCommand;
private IResource owner; private IResource owner;
private ITarget parent; private ITarget parent;
@ -214,10 +215,13 @@ public class Target extends BuildObject implements ITarget {
// Get the clean command // Get the clean command
cleanCommand = element.getAttribute(CLEAN_COMMAND); cleanCommand = element.getAttribute(CLEAN_COMMAND);
// Get the make command // Get the make command and arguments
if (element.hasAttribute(MAKE_COMMAND)) { if (element.hasAttribute(MAKE_COMMAND)) {
makeCommand = element.getAttribute(MAKE_COMMAND); makeCommand = element.getAttribute(MAKE_COMMAND);
} }
if(element.hasAttribute(MAKE_ARGS)) {
makeArguments = element.getAttribute(MAKE_ARGS);
}
Node child = element.getFirstChild(); Node child = element.getFirstChild();
while (child != null) { while (child != null) {
@ -249,6 +253,7 @@ public class Target extends BuildObject implements ITarget {
*/ */
public void resetMakeCommand() { public void resetMakeCommand() {
makeCommand = null; makeCommand = null;
makeArguments = null;
} }
/** /**
@ -272,6 +277,9 @@ public class Target extends BuildObject implements ITarget {
if (makeCommand != null) { if (makeCommand != null) {
element.setAttribute(MAKE_COMMAND, makeCommand); element.setAttribute(MAKE_COMMAND, makeCommand);
} }
if (makeArguments != null) {
element.setAttribute(MAKE_ARGS, makeArguments);
}
if (configurations != null) if (configurations != null)
for (int i = 0; i < configurations.size(); ++i) { for (int i = 0; i < configurations.size(); ++i) {
@ -282,6 +290,22 @@ public class Target extends BuildObject implements ITarget {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#getMakeArguments()
*/
public String getMakeArguments() {
if (makeArguments == null) {
// See if it is defined in my parent
if (parent != null) {
return parent.getMakeArguments();
} else {
// No parent and no user setting
return new String("");
}
}
return makeArguments;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.build.managed.ITarget#getMakeCommand() * @see org.eclipse.cdt.core.build.managed.ITarget#getMakeCommand()
*/ */
@ -376,7 +400,9 @@ public class Target extends BuildObject implements ITarget {
* @see org.eclipse.cdt.managedbuilder.core.ITarget#hasMakeCommandOverride() * @see org.eclipse.cdt.managedbuilder.core.ITarget#hasMakeCommandOverride()
*/ */
public boolean hasOverridenMakeCommand() { public boolean hasOverridenMakeCommand() {
return (makeCommand != null && !makeCommand.equals(parent.getMakeCommand())); // We answer true if the make command or the flags are different
return ((makeCommand != null && !makeCommand.equals(parent.getMakeCommand()))
|| (makeArguments != null && !makeArguments.equals(parent.getMakeArguments())));
} }
/** /**
@ -551,6 +577,15 @@ public class Target extends BuildObject implements ITarget {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#setMakeArguments(java.lang.String)
*/
public void setMakeArguments(String makeArgs) {
if (makeArgs != null && !getMakeArguments().equals(makeArgs)) {
makeArguments = makeArgs;
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITarget#setMakeCommand(java.lang.String) * @see org.eclipse.cdt.managedbuilder.core.ITarget#setMakeCommand(java.lang.String)
*/ */

View file

@ -1,189 +1,202 @@
2004-2-17 Sean Evoy 2004-02-23 Sean Evoy
Fixes for 51640 Fix for bug 52647.
Externalized strings for the target names. In 1.2, the target stored the raw, overridden build command the user
* plugin.properties specified on the property page. This fix involves enhancing the logic
* plugin.xml to pry apart the command from the args, and moving it into the property
itself, so the build system only pays the price to parse once.
Fixes for bug 49590: Obviously since the make command or the args can be overridden by a user,
The system now makes a distinction between the name of the output and its extension. the logic as to when to enable the edit field and check box in the manage
The UI for managing the name of the build output now has a field for entering the dialog had to be tweaked. I am still not 100% satisfied, but this gets the
extension. The new project wizard does not automatically append the extension to the meat of the fix into the hands of users.
name of the build output. * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java 2004-2-17 Sean Evoy
Fixes for 51640
Some ground work for C11: Externalized strings for the target names.
Added a browse button and an area for selecting a path variable to the browse * plugin.properties
dialog. However, this is still turned off since it is not fully functional. * plugin.xml
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java Fixes for bug 49590:
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java The system now makes a distinction between the name of the output and its extension.
The UI for managing the name of the build output now has a field for entering the
Changed the order of the configurations in the manifest so that debug configurations are the default for every project. extension. The new project wizard does not automatically append the extension to the
* plugin.xml name of the build output.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
2003-11-10 Tanya Wolff * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
I18N-Externalized strings from plugin.xml.
I18N-Added keys & strings to plugin.properties. Some ground work for C11:
Fixed an id error in linux c compiler debugger options. Added a browse button and an area for selecting a path variable to the browse
* plugin.xml dialog. However, this is still turned off since it is not fully functional.
* plugin.properties * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
2003-11-11 Sean Evoy * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
Work to implement bugzilla 44841:
Added a scrollbar to the list control inside the custom list field editor. Changed the order of the configurations in the manifest so that debug configurations are the default for every project.
Also added an Edit button to the field editor to make it easier for keyboard-only * plugin.xml
accessibility.
2003-11-10 Tanya Wolff
Work for bugzilla 44451:
Changed the method that prompts user for information so that if the user cancels I18N-Externalized strings from plugin.xml.
with an empty input dialog, the method always returns an empty string. The responsibility I18N-Added keys & strings to plugin.properties.
now rests with the caller to test the return value for length > 0 to decide whether or Fixed an id error in linux c compiler debugger options.
not to add string to the list. * plugin.xml
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java * plugin.properties
Moved string constants from core UI plugin to build UI plugin. These values are duplicated 2003-11-11 Sean Evoy
in the standadrd make UI plugin anyway, so the argument for keeping them in a common Work to implement bugzilla 44841:
plugin seems pretty weak. This removes another dependency between the builder UI and Added a scrollbar to the list control inside the custom list field editor.
common UI plugin. I did have to change the string resource lookup method in a few of Also added an Edit button to the field editor to make it easier for keyboard-only
the UI implementation classes that use the constants. accessibility.
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java Work for bugzilla 44451:
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java Changed the method that prompts user for information so that if the user cancels
* src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java with an empty input dialog, the method always returns an empty string. The responsibility
now rests with the caller to test the return value for length > 0 to decide whether or
2003-10-17 Tom Tromey not to add string to the list.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
Changed -werror to -Werror
* plugin.xml Moved string constants from core UI plugin to build UI plugin. These values are duplicated
in the standadrd make UI plugin anyway, so the argument for keeping them in a common
2003-10-14 Alain Magloire plugin seems pretty weak. This removes another dependency between the builder UI and
common UI plugin. I did have to change the string resource lookup method in a few of
ICOptionPage was added a new method the UI implementation classes that use the constants.
Preferences getPreferences(); * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
This is needed to get the preference store when saving * src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
On the plugin. We had the equivalent for project * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
IProject getProject(); * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage 2003-10-17 Tom Tromey
2003-10-01 Sean Evoy Changed -werror to -Werror
Fix for bugs 43490 (trivial), 44020, and 43980. * plugin.xml
A massive change has occurred in the plugin file. I added new C tools that apply
only to projects with C natures. I also added option overrides in the default 2003-10-14 Alain Magloire
configurations for these new tools. The trivial fix for the new C project wizard
involved changing the icon entry in the plugin file. ICOptionPage was added a new method
* plugin.xml Preferences getPreferences();
This is needed to get the preference store when saving
In preparation for 44020, each new configuration created is assigned a truly On the plugin. We had the equivalent for project
random ID. IProject getProject();
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage
Removed a tooltip that was not being populated properly. 2003-10-01 Sean Evoy
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java Fix for bugs 43490 (trivial), 44020, and 43980.
A massive change has occurred in the plugin file. I added new C tools that apply
2003-09-30 Sean Evoy only to projects with C natures. I also added option overrides in the default
Fix for bug 41826. configurations for these new tools. The trivial fix for the new C project wizard
involved changing the icon entry in the plugin file.
Updated the tool specifications for Win32, Linux, and Solaris so that header * plugin.xml
file extension info is available.
* plugin.xml In preparation for 44020, each new configuration created is assigned a truly
random ID.
2003-09-25 Sean Evoy * src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
For bug (really an enhancement request)43756, I added the word default to a * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
widget label to try and make it clear that a new configuration will be based
on default values, not user-overridden stuff. It remains to be seen if this Removed a tooltip that was not being populated properly.
actually helps, but it seems reasonable. * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
2003-09-30 Sean Evoy
For bug 43220 I now display a widget just for user objects. Fix for bug 41826.
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java Updated the tool specifications for Win32, Linux, and Solaris so that header
file extension info is available.
I also reordered the plugin definition for the linker tools, and moved some of * plugin.xml
the option labels to the plugin property file. I also added a user object option
to each linker tool definition. 2003-09-25 Sean Evoy
* plugin.properties For bug (really an enhancement request)43756, I added the word default to a
* plugin.xml widget label to try and make it clear that a new configuration will be based
on default values, not user-overridden stuff. It remains to be seen if this
2003-09-25 Sean Evoy actually helps, but it seems reasonable.
This patch contains a lot of changes needed to implement fixes for 42648 and * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
43122.
For bug 43220 I now display a widget just for user objects.
The properties file has been updated to externalize some of the option labels * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolSettingsPage.java
to try and address some of the concern about continuity between UIs on * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
different platforms.
* plugin.properties I also reordered the plugin definition for the linker tools, and moved some of
the option labels to the plugin property file. I also added a user object option
There are changes in the plugin XML file to accomodate showing the targets to each linker tool definition.
only on the correct host platform. Option names have bee replaced with * plugin.properties
externalized equivalents where possible. The release and debug configurations * plugin.xml
for each configuration now apply "reasonable" defaults for debug and optimization
option. Finally, the Cygwinb tool specification has been brought closer to those 2003-09-25 Sean Evoy
for *nix. This patch contains a lot of changes needed to implement fixes for 42648 and
* plugin.xml 43122.
Only targets that correspond to the host platforms are shown in the drop-down The properties file has been updated to externalize some of the option labels
list. to try and address some of the concern about continuity between UIs on
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java different platforms.
* plugin.properties
2003-09-23 Sean Evoy
I added a fix for critical bug 43439. The new project wizard is ready to be hooked There are changes in the plugin XML file to accomodate showing the targets
up to the help system content on F1. There is a new file with the string constant only on the correct host platform. Option names have bee replaced with
the doc project will use to map the widget to a help file. externalized equivalents where possible. The release and debug configurations
* src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java for each configuration now apply "reasonable" defaults for debug and optimization
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java option. Finally, the Cygwinb tool specification has been brought closer to those
for *nix.
In support of the fix for critical bug 43292, I added a new set of widgets to * plugin.xml
the ManageConfigDialog implementation. I added new string literals in the properties
file for the plugin. There are obviously new event handlers for the Manage dialog. Only targets that correspond to the host platforms are shown in the drop-down
It displays the make command for the target, the name of the build artifact, and list.
a list of current and deleted configurations. There is no way to add new targets. * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
Users can restore deleted configurations up until they click OK. The client of this
dialog has been changed to properly respond to the changes. The NewConfigurationDialog 2003-09-23 Sean Evoy
now displays an externalized string in the title bar. I added a fix for critical bug 43439. The new project wizard is ready to be hooked
* plugin.xml up to the help system content on F1. There is a new file with the string constant
* plugin.properties the doc project will use to map the widget to a help file.
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties * src/org/eclipse/cdt/managedbuilder/ui/wizards/CProjectPlatformPage.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java * src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java In support of the fix for critical bug 43292, I added a new set of widgets to
the ManageConfigDialog implementation. I added new string literals in the properties
2003-09-19 Sean Evoy file for the plugin. There are obviously new event handlers for the Manage dialog.
Removed the binary parser selection tab from the new class wizard. Updated the It displays the make command for the target, the name of the build artifact, and
page description externalized string. a list of current and deleted configurations. There is no way to add new targets.
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties Users can restore deleted configurations up until they click OK. The client of this
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java dialog has been changed to properly respond to the changes. The NewConfigurationDialog
now displays an externalized string in the title bar.
Added the hard-coded binary parser info to the defined targets. * plugin.xml
* plugin.xml * plugin.properties
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
Fixed the event handling for add/remove in the list widget for build settings pages. * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java * src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
2003-09-16 Sean Evoy
Changed the initialization and button status logic so the list buttons are 2003-09-19 Sean Evoy
enabled correctly on start-up and that the fist item in the list (if Removed the binary parser selection tab from the new class wizard. Updated the
any) is selected. Also changed the "Add" event handler to properly enable page description externalized string.
the buttons and set the list selection. * src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectOptionPage.java
* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
Added the hard-coded binary parser info to the defined targets.
2003-09-15 Sean Evoy * plugin.xml
First submission of code to new project. Moved all the managed
builder-specific UI elements out of the cdt.ui project. This Fixed the event handling for add/remove in the list widget for build settings pages.
includes the icons, and externalized strings. * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
There are 2 new classes to handle the externalized strings and image 2003-09-16 Sean Evoy
files: Changed the initialization and button status logic so the list buttons are
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties enabled correctly on start-up and that the fist item in the list (if
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java any) is selected. Also changed the "Add" event handler to properly enable
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java the buttons and set the list selection.
The property pages have been modified to use a mix of externalized * src/org/eclipse/cdt/managedbuilder/ui/properties/BuildOptionListFieldEditor.java
strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project
wizard has been reimplemented using the new C project classes added by 2003-09-15 Sean Evoy
First submission of code to new project. Moved all the managed
builder-specific UI elements out of the cdt.ui project. This
includes the icons, and externalized strings.
There are 2 new classes to handle the externalized strings and image
files:
* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIImages.java
The property pages have been modified to use a mix of externalized
strings from the CUIPlugin and ManagedBuilderUIPlugin. The new project
wizard has been reimplemented using the new C project classes added by
QNX September 12, 2003. The UI itself has not changed. QNX September 12, 2003. The UI itself has not changed.

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,8 @@ import java.util.Map;
import java.util.Random; import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@ -458,8 +460,12 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
// This is a cheap assignment to null so do it to be doubly sure // This is a cheap assignment to null so do it to be doubly sure
selectedTarget.resetMakeCommand(); selectedTarget.resetMakeCommand();
} else { } else {
String makeCommand = manageDialog.getMakeCommand(); // Parse for command and arguments
String rawCommand = manageDialog.getMakeCommand();
String makeCommand = parseMakeCommand(rawCommand);
selectedTarget.setMakeCommand(makeCommand); selectedTarget.setMakeCommand(makeCommand);
String makeArguments = parseMakeArgs(rawCommand);
selectedTarget.setMakeArguments(makeArguments);
} }
// Check to see if any configurations have to be deleted // Check to see if any configurations have to be deleted
@ -547,6 +553,126 @@ public class BuildPropertyPage extends PropertyPage implements IWorkbenchPropert
sashForm.setWeights(DEFAULT_SASH_WEIGHTS); sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
} }
/* (non-Javadoc)
* @param rawCommand
* @return
*/
private String parseMakeArgs(String rawCommand) {
StringBuffer result = new StringBuffer();
// Parse out the command
String actualCommand = parseMakeCommand(rawCommand);
// The flags and targets are anything not in the command
String arguments = rawCommand.substring(actualCommand.length());
// If there aren't any, we can stop
if (arguments.length() == 0) {
return result.toString().trim();
}
String[] tokens = arguments.trim().split("\\s");
/*
* Cases to consider
* --<flag> Sensible, modern single flag. Add to result and continue.
* -<flags> Flags in single token, add to result and stop
* -<flag_with_arg> ARG Flag with argument. Add next token if valid arg.
* -<mixed_flags> ARG Mix of flags, one takes arg. Add next token if valid arg.
* -<flag_with_arg>ARG Corrupt case where next token should be arg but isn't
* -<flags> [target].. Flags with no args, another token, add flags and stop.
*/
Pattern flagPattern = Pattern.compile("C|f|I|j|l|O|W");
// Look for a '-' followed by 1 or more flags with no args and exactly 1 that expects args
Pattern mixedFlagWithArg = Pattern.compile("-[^CfIjloW]*[CfIjloW]{1}.+");
for (int i = 0; i < tokens.length; ++i) {
String currentToken = tokens[i];
if (currentToken.startsWith("--")) {
result.append(currentToken);
result.append(" ");
} else if (currentToken.startsWith("-")) {
// Is there another token
if (i + 1 >= tokens.length) {
//We are done
result.append(currentToken);
} else {
String nextToken = tokens[i + 1];
// Are we expecting arguments
Matcher flagMatcher = flagPattern.matcher(currentToken);
if (!flagMatcher.find()) {
// Evalutate whether the next token should be added normally
result.append(currentToken);
result.append(" ");
} else {
// Look for the case where there is no space between flag and arg
if (mixedFlagWithArg.matcher(currentToken).matches()) {
// Add this single token and keep going
result.append(currentToken);
result.append(" ");
} else {
// Add this token and the next one right now
result.append(currentToken);
result.append(" ");
result.append(nextToken);
result.append(" ");
// Skip the next token the next time through, though
++i;
}
}
}
}
}
return result.toString().trim();
}
/* (non-Javadoc)
*
* @param string
* @return
*/
private String parseMakeCommand(String rawCommand) {
StringBuffer command = new StringBuffer();
boolean hasSpace = false;
// Try to separate out the command from the arguments
String[] result = rawCommand.split("\\s");
/*
* Here are the cases to consider:
* cmd First segment is last segment, assume is command
* cmd [flags] First segment is the command
* path/cmd [flags] Same as above
* path with space/make [flags] Must append each segment up-to flags as command
*/
for (int i = 0; i < result.length; ++i) {
// Get the segment
String cmdSegment = result[i];
// If there is not another segment, we found the end
if (i + 1 >= result.length) {
command.append(cmdSegment);
} else {
// See if the next segment is the start of the flags
String nextSegment = result[i + 1];
if (nextSegment.startsWith("-")) {
// we have found the end of the command
command.append(cmdSegment);
break;
} else {
command.append(cmdSegment);
// Add the whitespace back
command.append(" ");
hasSpace = true;
}
}
}
// if (hasSpace == true) {
// return "\"" + command.toString().trim() + "\"";
// } else {
return command.toString().trim();
// }
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults() * @see org.eclipse.jface.preference.PreferencePage#performDefaults()

View file

@ -64,7 +64,7 @@ public class ManageConfigDialog extends Dialog {
private SortedMap deletedConfigs; private SortedMap deletedConfigs;
// Map of configuration names and ids // Map of configuration names and ids
private SortedMap existingConfigs; private SortedMap existingConfigs;
// The make command associated with the target // The make command associated with the target
private String makeCommand; private String makeCommand;
// The target the configs belong to // The target the configs belong to
private ITarget managedTarget; private ITarget managedTarget;
@ -95,8 +95,7 @@ public class ManageConfigDialog extends Dialog {
this.title = title; this.title = title;
this.managedTarget = target; this.managedTarget = target;
// Figure out the default make command setMakeCommand();
makeCommand = managedTarget.getMakeCommand();
// Get the name of the build artifact // Get the name of the build artifact
artifactExt = managedTarget.getArtifactExtension(); artifactExt = managedTarget.getArtifactExtension();
@ -186,7 +185,7 @@ public class ManageConfigDialog extends Dialog {
buildArtifactExt.setFont(outputGroup.getFont()); buildArtifactExt.setFont(outputGroup.getFont());
buildArtifactExt.setText(artifactExt); buildArtifactExt.setText(artifactExt);
data = new GridData(GridData.FILL_HORIZONTAL); data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.widthHint = (IDialogConstants.ENTRY_FIELD_WIDTH / 2);
buildArtifactExt.setLayoutData(data); buildArtifactExt.setLayoutData(data);
buildArtifactExt.addDisposeListener(new DisposeListener() { buildArtifactExt.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) { public void widgetDisposed(DisposeEvent e) {
@ -238,7 +237,7 @@ public class ManageConfigDialog extends Dialog {
currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); currentConfigList = new List(currentComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
currentConfigList.setFont(currentComp.getFont()); currentConfigList.setFont(currentComp.getFont());
data = new GridData(GridData.FILL_BOTH); data = new GridData(GridData.FILL_BOTH);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.widthHint = (IDialogConstants.ENTRY_FIELD_WIDTH / 2);
currentConfigList.setLayoutData(data); currentConfigList.setLayoutData(data);
currentConfigList.addDisposeListener(new DisposeListener() { currentConfigList.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) { public void widgetDisposed(DisposeEvent event) {
@ -306,7 +305,7 @@ public class ManageConfigDialog extends Dialog {
deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER); deletedConfigList = new List(deletedComp, SWT.SINGLE|SWT.V_SCROLL|SWT.H_SCROLL|SWT.BORDER);
deletedConfigList.setFont(deletedComp.getFont()); deletedConfigList.setFont(deletedComp.getFont());
data = new GridData(GridData.FILL_BOTH); data = new GridData(GridData.FILL_BOTH);
data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; data.widthHint = (IDialogConstants.ENTRY_FIELD_WIDTH / 2);
deletedConfigList.setLayoutData(data); deletedConfigList.setLayoutData(data);
deletedConfigList.addDisposeListener(new DisposeListener() { deletedConfigList.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) { public void widgetDisposed(DisposeEvent event) {
@ -563,7 +562,27 @@ public class ManageConfigDialog extends Dialog {
*/ */
protected void handleUseDefaultPressed() { protected void handleUseDefaultPressed() {
// If the state of the button is unchecked, then we want to enable the edit widget // If the state of the button is unchecked, then we want to enable the edit widget
makeCommandEntry.setEditable(!makeCommandDefault.getSelection()); boolean checked = makeCommandDefault.getSelection();
if (checked == true) {
managedTarget.resetMakeCommand();
setMakeCommand();
makeCommandEntry.setText(makeCommand);
makeCommandEntry.setEditable(false);
} else {
makeCommandEntry.setEditable(true);
}
}
/*
*
*/
private void setMakeCommand() {
// Figure out the make command
makeCommand = managedTarget.getMakeCommand();
String makeArgs = managedTarget.getMakeArguments();
if (makeArgs.length() > 0) {
makeCommand += " " + makeArgs;
}
} }
private void updateButtons() { private void updateButtons() {