1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Marked those strings that are non-translatable as such and externalized those strings that can be translated. There is still work to be done in this area for this plugin.

This commit is contained in:
Sean Evoy 2004-03-02 16:35:03 +00:00
parent b529cdd23d
commit 8503542b55
13 changed files with 578 additions and 547 deletions

View file

@ -1,425 +1,443 @@
2004-03-02 Sean Evoy
Work to support feature C1, "Set Tool Command in Project".
Now it is possible to store an overridden tool command in a tool
reference. The tool command can be overridden directly in an
existing reference, or through the configuration, which creates a
new tool reference.
2004-02-26 Jeremiah Lott
Added a header to the automatically generated makefiles to alert users
not to edit them. Also added includes directives to bring in user-supplied
makefiles to support additional targets, macro definitions, and custom
build steps. Strings are externalized.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2004-02-26 Sean Evoy
Work for C14, add the ability to inherit a tool description via a tool
reference.
Changed the schema to allow a tool reference to belong to a target.
* schema/ManagedBuildTools.exsd
Changed the manifest logic in the managed build manager to load and
retrieve tool definitions as well as target definitions. The schema
allowed for this, but the logic was missing.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
Made some bookeeping additions to the target so that it can store references
to tools. First, the target loads any tool references it has. Then it loads
tools and configurations. The target also has to consider the presence of tool
references when it determines how many tools it has, so the logic that counted
and returned the number of tools in the target was updated. Some key changes in
this regard relate to how the target looks up the tool references it has. It
now has to ask the managed build info if it has a tool definition for the reference
if there are no tools defined for the target level for a given reference.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Tool references now have the potential to be owned by either a target or a
configuration. Changed the owner to the superclass of both and figure out
which the parent is at runtime to perform the proper registration and information
look-up. Also removed the reference to a target from a tool and the interface to
extract the target from ITool.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
An unrelated bug had to do with a problem my testing uncovered with nested
categories. The manifest reader was looking at the wrong field to determine
the parent, but for the manifests we have created, this has not proven to be
a problem so far.
* src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
* src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
2004-02-24 Sean Evoy
Changed the makefile generator to escape any whitespace it finds in a dependency
path. Now it is possible to build a project in a location with spaces but
you still cannot have internal folders with spaces in the name.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Tweaked the builder to put only the make command in invocation if there were
no arguments spec'd. It seemed to be causing a fake error message
to be reported on Linux even though make was successfully building the project.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
2004-02-23 Sean Evoy
Fix for bug 52647.
In 1.2, the target stored the raw, overridden build command the user
specified on the property page. This string may or may not have included
arguments to make. The managed build info was responsible for parsing the
command from the arguments and returning both to the makefile generator.
The problem was that the logic was too light-weight to really parse a
complex command line. That logic has been refactored to the property page itself,
so the price of parsing is payed once.
The Target and its public interface have been reworked to set and get the
arguments for make. This is treated as a project-level setting. It cannot
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
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The arguments are now passed to the spawner that launches make correctly.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The ManagedBuildInfo is off the hook now. Rather than performing any
parsing or foo-fa-raw, it simply delegates the lookup to the target.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2004-02-17 Sean Evoy
Fix for critical bug 44163.
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
data, but the internal reference to the owner project was not updated in the
build info. Now, when the build info is retrieved from a project, the manager
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
owner and the owner of all the targets it maintains for the project.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
* 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
Fixes for 51646
Moved the makefile comment character out of the hard-coded strings and into
the makefile generator.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Fixes for bug 49590:
The target maintains the default extension and the overridden extension. There
is an interface to get and set the extension, but the method to get the default
extension is deprecated.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The build information now has a method to get at the extension
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The makefile generator now asks for both the name and the extension when
generating targets and dependencies.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-23 Bogdan Gheorghe
Updated the indexManager.perfomConcurrentJob call in MakefileGenerator
2003-10-03 Sean Evoy
Fix for critical bug 44134.
The problem lies in how the makefile is generated when a build target
references other projects. The makefile creates a command to change to
the build directory of the referenced project and call $(MAKE) there, i.e.
cd <dep_project_build_dir>; $(MAKE) clean all
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
make call in the build directory of the build target and 'make' will keep
invoking more 'make's until Eclipse runs out of memory. With a manual build,
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
it restarts, autobuild is still enabled and the problem repeats.
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
cd <dep_project_build_dir> && $(MAKE) clean all
When the dependencies are generated this way, the 'cd' will fail as will the
build. The final tweak is to ignore the 'cd' failure and allow the rest of
the build to continue, i.e.
-cd <dep_project_build_dir> && $(MAKE) clean all
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it.
OptionReference provides a method to retreive its option (so new
OptionReferences can be cloned).
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
project natures that the tool should be filtered against in the build model
and UI.
* schema/ManagedBuildTools.exsd
Updated the ITool interface and its mplementors to pay attention to this new
attribute when loading from a plugin file. Clients can querry for a numeric
constant indicating the filter.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
All the methods in managed build manager that access information stored in a tool
first check that the tool is valid for the project nature.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Put a safety check in the option reference constructor when reading one in from
a project file. I the option reference is to an option not managed by the build
model, the constructor does not add itself to the runtime representation of the
model.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
In preparation for 44020, each new target created is assigned a truly random ID.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-30 Sean Evoy
Fix for bug 41826.
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
client to determine that a file is considered a header file.
* schema/ManagedBuildTools.exsd
The ITool, and its implementors now have a method to test if an extension is
considered to belong to a header file. The Tool also pays attention to the new
attribute when it reads itself in from the plugin file.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
There is a method for clients of this information on the BuildInfo interface and
its implementor.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator had to be tweaked to properly add folders that are effected
by header file changes.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
A partial implementation for bug 41826. This patch contains the logic to properly
respond in the face of the following project changes:
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.
2. The build settings change in the build project or any projects it
references.
In order to actually do this correctly, I had to stop being so precious during the
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
need to do a build. Further, as I discovered earlier, it doesn't always pass what
has changed in referenced projects as part of the delta. Essentially, that means I
will never be able to fully calculate the change set in the makefile generator's
delta visitor, and to even approximate a decent set of cases, the logic would quickly
bog down in complexity.
The solution is to trust Eclipse and alway invoke make when my incremental builder
is called. At worst, if there is no significant change, make will execute and
report nothing to be done.
The modified makefile builder no longer asks the makefile generator if it should
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
scrubs all relevant projects after building. Since a build might involve building
referenced project elements, those projects get their project views refreshed after
build. The build markers for referenced projects are removed prior to build.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator has been simplified. The resource delta visitor logic no
longer trie to decide if a build should occur. The method to ask has been removed.
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.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
I added a fix to the builder and makefile generator to properly handle the following case.
Project A depends on Project B. Something changes in project B and the user requests
that A be built. Inthis case, the incremental builder is invoked, but it is passed a
0-length delta on the top resource. Now, the logic of the builder is to treat that case as a
build event that triggers no makefile regeneration, just an invocation of make.
Now handles the case where there is no flag applied to the make command and just
passes the targets as arguments.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator now considers the case where the delta is for a project resource
and has no children. If so, it flags that a build is needed but no makefile generation
occurs. It also throws a new exception if the top makefile is not saved.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-25 Sean Evoy
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
calling refresh at inside a bad if statement. I corrected that and projects
refresh correctly. Of course, if you have the wrong binary parser selected you are
hosed. You will also notice that the string constants have been changed to
resolve to a different name. The standard builder uses this name and I wanted
to minimize the possibility of problems later.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
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
new identifiers.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Changed the signature of the 'getMakeArguments' to return a string instead of an
array so the builder can invoke make with the user-specified args. I also changed
the logic of the getMakeCommand method in the implementor so that it only returns
a string containing the command itself.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Explicitly trim all arrays to size before converting them to String[] for Options
and Tools.
*src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
Fixed a missing bit of logic in the Configuration when a user-object option is
deleted. Now the build model really does get rid of the the value.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-09-25 Sean Evoy
This patch contains a lot of changes needed to implement fixes for 42648 and
43122.
For 42648, the schema for the the target had to be modified to include a
comma-separated list of valid host platforms.
* schema/ManagedBuildTools.exsd
The target had to be updated to properly read in and understand this info, and
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 list of tools it maintains. I have also stopped persisting non-variant info
to the project file on serialize. There are elements of the target that are not
subject to change by the user (yet) so they should not be saved.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.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
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
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
up some of the accessor and iteration code in ToolReference and OptionReference.
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.
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.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
Option reference now pays attention to overidden values in the plugin file. Until
now, it only handled the overrides in the project file.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
The ToolReference now distinguishes between local option references which it
manages directly, and option references held by tool references in the parent(s)
of its owner. It only serializes its own references, but when asked for options
relating to the tool it references, it replies with all option references in its
hierarchy.
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
2003-09-25 Bogdan Gheorghe
Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the
projects that dependend a file.
Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob
* src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
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
to convert the paths relative to this directory into absolute paths before replying tha it is for
the client to figure this out.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2003-09-23 Sean Evoy
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
configurations. Also, to support the naming of newly created configurations,
I added a name method to the IConfiguration interface. Finally, the ITarget
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
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to
hard-code the binary parser for project creation. There is a new getter
method in the interface and the implementor contains additional code to
extract the information from a project file or plugin manifest. The
interface also contains new strings to make changing the specification
easier in the future.
* schema/ManagedBuildTools.exsd
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.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.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-16 Sean Evoy
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
more descriptive "addSourceDependencies". Added a flag when the
inter-project dependencies are calculated so that clean and all are
properly passed to the make invocation. Finally, I replaced the hard-coded
'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
2004-03-02 James Ciesielski
Marked those strings that are non-translatable as such and externalized
those strings that can be translated. There is still work to be done in
this area for this plugin.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderManager.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedCProjectNature.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
2004-03-02 Sean Evoy
Work to support feature C1, "Set Tool Command in Project".
Now it is possible to store an overridden tool command in a tool
reference. The tool command can be overridden directly in an
existing reference, or through the configuration, which creates a
new tool reference.
2004-02-26 Jeremiah Lott
Added a header to the automatically generated makefiles to alert users
not to edit them. Also added includes directives to bring in user-supplied
makefiles to support additional targets, macro definitions, and custom
build steps. Strings are externalized.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2004-02-26 Sean Evoy
Work for C14, add the ability to inherit a tool description via a tool
reference.
Changed the schema to allow a tool reference to belong to a target.
* schema/ManagedBuildTools.exsd
Changed the manifest logic in the managed build manager to load and
retrieve tool definitions as well as target definitions. The schema
allowed for this, but the logic was missing.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
Made some bookeeping additions to the target so that it can store references
to tools. First, the target loads any tool references it has. Then it loads
tools and configurations. The target also has to consider the presence of tool
references when it determines how many tools it has, so the logic that counted
and returned the number of tools in the target was updated. Some key changes in
this regard relate to how the target looks up the tool references it has. It
now has to ask the managed build info if it has a tool definition for the reference
if there are no tools defined for the target level for a given reference.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Tool references now have the potential to be owned by either a target or a
configuration. Changed the owner to the superclass of both and figure out
which the parent is at runtime to perform the proper registration and information
look-up. Also removed the reference to a target from a tool and the interface to
extract the target from ITool.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
An unrelated bug had to do with a problem my testing uncovered with nested
categories. The manifest reader was looking at the wrong field to determine
the parent, but for the manifests we have created, this has not proven to be
a problem so far.
* src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
* src/org/eclipse/cdt/managedbuilder/core/IOptionCategory.java
2004-02-24 Sean Evoy
Changed the makefile generator to escape any whitespace it finds in a dependency
path. Now it is possible to build a project in a location with spaces but
you still cannot have internal folders with spaces in the name.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Tweaked the builder to put only the make command in invocation if there were
no arguments spec'd. It seemed to be causing a fake error message
to be reported on Linux even though make was successfully building the project.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
2004-02-23 Sean Evoy
Fix for bug 52647.
In 1.2, the target stored the raw, overridden build command the user
specified on the property page. This string may or may not have included
arguments to make. The managed build info was responsible for parsing the
command from the arguments and returning both to the makefile generator.
The problem was that the logic was too light-weight to really parse a
complex command line. That logic has been refactored to the property page itself,
so the price of parsing is payed once.
The Target and its public interface have been reworked to set and get the
arguments for make. This is treated as a project-level setting. It cannot
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
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The arguments are now passed to the spawner that launches make correctly.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The ManagedBuildInfo is off the hook now. Rather than performing any
parsing or foo-fa-raw, it simply delegates the lookup to the target.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2004-02-17 Sean Evoy
Fix for critical bug 44163.
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
data, but the internal reference to the owner project was not updated in the
build info. Now, when the build info is retrieved from a project, the manager
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
owner and the owner of all the targets it maintains for the project.
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
* 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
Fixes for 51646
Moved the makefile comment character out of the hard-coded strings and into
the makefile generator.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Fixes for bug 49590:
The target maintains the default extension and the overridden extension. There
is an interface to get and set the extension, but the method to get the default
extension is deprecated.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
The build information now has a method to get at the extension
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The makefile generator now asks for both the name and the extension when
generating targets and dependencies.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-23 Bogdan Gheorghe
Updated the indexManager.perfomConcurrentJob call in MakefileGenerator
2003-10-03 Sean Evoy
Fix for critical bug 44134.
The problem lies in how the makefile is generated when a build target
references other projects. The makefile creates a command to change to
the build directory of the referenced project and call $(MAKE) there, i.e.
cd <dep_project_build_dir>; $(MAKE) clean all
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
make call in the build directory of the build target and 'make' will keep
invoking more 'make's until Eclipse runs out of memory. With a manual build,
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
it restarts, autobuild is still enabled and the problem repeats.
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
cd <dep_project_build_dir> && $(MAKE) clean all
When the dependencies are generated this way, the 'cd' will fail as will the
build. The final tweak is to ignore the 'cd' failure and allow the rest of
the build to continue, i.e.
-cd <dep_project_build_dir> && $(MAKE) clean all
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it.
OptionReference provides a method to retreive its option (so new
OptionReferences can be cloned).
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
project natures that the tool should be filtered against in the build model
and UI.
* schema/ManagedBuildTools.exsd
Updated the ITool interface and its mplementors to pay attention to this new
attribute when loading from a plugin file. Clients can querry for a numeric
constant indicating the filter.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
All the methods in managed build manager that access information stored in a tool
first check that the tool is valid for the project nature.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Put a safety check in the option reference constructor when reading one in from
a project file. I the option reference is to an option not managed by the build
model, the constructor does not add itself to the runtime representation of the
model.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
In preparation for 44020, each new target created is assigned a truly random ID.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-30 Sean Evoy
Fix for bug 41826.
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
client to determine that a file is considered a header file.
* schema/ManagedBuildTools.exsd
The ITool, and its implementors now have a method to test if an extension is
considered to belong to a header file. The Tool also pays attention to the new
attribute when it reads itself in from the plugin file.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
There is a method for clients of this information on the BuildInfo interface and
its implementor.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator had to be tweaked to properly add folders that are effected
by header file changes.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
A partial implementation for bug 41826. This patch contains the logic to properly
respond in the face of the following project changes:
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.
2. The build settings change in the build project or any projects it
references.
In order to actually do this correctly, I had to stop being so precious during the
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
need to do a build. Further, as I discovered earlier, it doesn't always pass what
has changed in referenced projects as part of the delta. Essentially, that means I
will never be able to fully calculate the change set in the makefile generator's
delta visitor, and to even approximate a decent set of cases, the logic would quickly
bog down in complexity.
The solution is to trust Eclipse and alway invoke make when my incremental builder
is called. At worst, if there is no significant change, make will execute and
report nothing to be done.
The modified makefile builder no longer asks the makefile generator if it should
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
scrubs all relevant projects after building. Since a build might involve building
referenced project elements, those projects get their project views refreshed after
build. The build markers for referenced projects are removed prior to build.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator has been simplified. The resource delta visitor logic no
longer trie to decide if a build should occur. The method to ask has been removed.
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.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
I added a fix to the builder and makefile generator to properly handle the following case.
Project A depends on Project B. Something changes in project B and the user requests
that A be built. Inthis case, the incremental builder is invoked, but it is passed a
0-length delta on the top resource. Now, the logic of the builder is to treat that case as a
build event that triggers no makefile regeneration, just an invocation of make.
Now handles the case where there is no flag applied to the make command and just
passes the targets as arguments.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator now considers the case where the delta is for a project resource
and has no children. If so, it flags that a build is needed but no makefile generation
occurs. It also throws a new exception if the top makefile is not saved.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-25 Sean Evoy
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
calling refresh at inside a bad if statement. I corrected that and projects
refresh correctly. Of course, if you have the wrong binary parser selected you are
hosed. You will also notice that the string constants have been changed to
resolve to a different name. The standard builder uses this name and I wanted
to minimize the possibility of problems later.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
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
new identifiers.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Changed the signature of the 'getMakeArguments' to return a string instead of an
array so the builder can invoke make with the user-specified args. I also changed
the logic of the getMakeCommand method in the implementor so that it only returns
a string containing the command itself.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Explicitly trim all arrays to size before converting them to String[] for Options
and Tools.
*src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
Fixed a missing bit of logic in the Configuration when a user-object option is
deleted. Now the build model really does get rid of the the value.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-09-25 Sean Evoy
This patch contains a lot of changes needed to implement fixes for 42648 and
43122.
For 42648, the schema for the the target had to be modified to include a
comma-separated list of valid host platforms.
* schema/ManagedBuildTools.exsd
The target had to be updated to properly read in and understand this info, and
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 list of tools it maintains. I have also stopped persisting non-variant info
to the project file on serialize. There are elements of the target that are not
subject to change by the user (yet) so they should not be saved.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.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
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
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
up some of the accessor and iteration code in ToolReference and OptionReference.
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.
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.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
Option reference now pays attention to overidden values in the plugin file. Until
now, it only handled the overrides in the project file.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
The ToolReference now distinguishes between local option references which it
manages directly, and option references held by tool references in the parent(s)
of its owner. It only serializes its own references, but when asked for options
relating to the tool it references, it replies with all option references in its
hierarchy.
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
2003-09-25 Bogdan Gheorghe
Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the
projects that dependend a file.
Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob
* src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
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
to convert the paths relative to this directory into absolute paths before replying tha it is for
the client to figure this out.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2003-09-23 Sean Evoy
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
configurations. Also, to support the naming of newly created configurations,
I added a name method to the IConfiguration interface. Finally, the ITarget
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
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to
hard-code the binary parser for project creation. There is a new getter
method in the interface and the implementor contains additional code to
extract the information from a project file or plugin manifest. The
interface also contains new strings to make changing the specification
easier in the future.
* schema/ManagedBuildTools.exsd
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.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.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-16 Sean Evoy
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
more descriptive "addSourceDependencies". Added a flag when the
inter-project dependencies are calculated so that clean and all are
properly passed to the make invocation. Finally, I replaced the hard-coded
'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

View file

@ -14,6 +14,8 @@ package org.eclipse.cdt.managedbuilder.core;
import java.util.List;
public interface IManagedBuildInfo {
public static final String DEFAULT_TARGET = "defaultTarget"; //$NON-NLS-1$
public static final String DEFAULT_CONFIGURATION = "defaultConfig"; //$NON-NLS-1$
/**
* Add a new target to the build information for the receiver

View file

@ -34,6 +34,7 @@ import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.Target;
import org.eclipse.cdt.managedbuilder.internal.core.Tool;
import org.eclipse.core.resources.IFile;
@ -55,7 +56,7 @@ import org.w3c.dom.Node;
*/
public class ManagedBuildManager extends AbstractCExtension implements IScannerInfoProvider {
private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo");
private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo"); //$NON-NLS-1$
private static final String ROOT_ELEM_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
private static final String FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
private static final ITarget[] emptyTargets = new ITarget[0];
@ -63,7 +64,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
public static final String EXTENSION_POINT_ID = "ManagedBuildInfo"; //$NON-NLS-1$
// This is the version of the manifest and project files that
private static final String buildInfoVersion = "2.0.0";
private static final String buildInfoVersion = "2.0.0"; //$NON-NLS-1$
private static boolean extensionTargetsLoaded = false;
private static Map extensionTargetMap;
private static List extensionTargets;
@ -298,7 +299,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
String xml = null;
try {
Serializer serializer
= SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format);
= SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(new OutputStreamWriter(s, "UTF8"), format); //$NON-NLS-1$
serializer.asDOMSerializer().serialize(doc);
xml = s.toString("UTF8"); //$NON-NLS-1$
IFile rscFile = project.getFile(FILE_NAME);
@ -405,13 +406,13 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
if (resource instanceof IProject) {
// Must be an extension target (why?)
if (owner != null)
throw new BuildException("addTarget: owner not null");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.owner_not_null")); //$NON-NLS-1$
} else {
// Owner must be owned by the project containing this resource
if (owner == null)
throw new BuildException("addTarget: null owner");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.null_owner")); //$NON-NLS-1$
if (!owner.equals(resource.getProject()))
throw new BuildException("addTarget: owner not project");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("ManagedBuildManager.error.owner_not_project")); //$NON-NLS-1$
}
// Passed validation

View file

@ -50,9 +50,9 @@ public class ManagedBuilderCorePlugin extends Plugin {
try {
return resourceBundle.getString(key);
} catch (MissingResourceException e) {
return "!" + key + "!";
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
} catch (NullPointerException e) {
return "#" + key + "#";
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -27,7 +27,7 @@ import org.eclipse.core.runtime.Plugin;
public class ManagedCProjectNature implements IProjectNature {
public static final String BUILDER_NAME = "genmakebuilder";
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME;
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
private static final String MNG_NATURE_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".managedBuildNature";
private IProject project;
@ -50,7 +50,7 @@ public class ManagedCProjectNature implements IProjectNature {
// TODO Remove this when the new StandardBuild nature adds the cbuilder
for (int i = 0; i < commands.length; i++) {
ICommand command = commands[i];
if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) {
if (command.getBuilderName().equals("org.eclipse.cdt.core.cbuilder")) { //$NON-NLS-1$
// Remove the command
Vector vec = new Vector(Arrays.asList(commands));
vec.removeElementAt(i);
@ -112,7 +112,7 @@ public class ManagedCProjectNature implements IProjectNature {
Plugin plugin = (Plugin)ManagedBuilderCorePlugin.getDefault();
IPluginDescriptor descriptor = plugin.getDescriptor();
if (descriptor.getExtension(BUILDER_NAME) != null) {
return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME;
return descriptor.getUniqueIdentifier() + "." + BUILDER_NAME; //$NON-NLS-1$
}
return BUILDER_ID;
}

View file

@ -206,9 +206,9 @@ public class GeneratedMakefileBuilder extends ACBuilder {
protected String[] getMakeTargets(boolean fullBuild) {
List args = new ArrayList();
if (fullBuild) {
args.add("clean");
args.add("clean"); //$NON-NLS-1$
}
args.add("all");
args.add("all"); //$NON-NLS-1$
return (String[])args.toArray(new String[args.size()]);
}
@ -337,7 +337,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
ArrayList makeArgs = new ArrayList();
String arg = info.getMakeArguments();
if (arg.length() > 0) {
String[] args = arg.split("\\s");
String[] args = arg.split("\\s"); //$NON-NLS-1$
for (int i = 0; i < args.length; ++i) {
makeArgs.add(args[i]);
}
@ -406,13 +406,13 @@ public class GeneratedMakefileBuilder extends ACBuilder {
if (errMsg != null && errMsg.length() > 0) {
String errorDesc = ManagedBuilderCorePlugin.getResourceString(BUILD_ERROR);
buf.append(errorDesc);
buf.append(System.getProperty("line.separator", "\n"));
buf.append("(").append(errMsg).append(")");
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-2$
buf.append("(").append(errMsg).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
// Report a successful build
String successMsg = ManagedBuilderCorePlugin.getFormattedString(BUILD_FINISHED, currentProject.getName());
buf.append(successMsg);
buf.append(System.getProperty("line.separator", "\n"));
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-2$
}
// Write message on the console
@ -421,7 +421,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
stdout.close();
stderr.close();
monitor.subTask(ManagedBuilderCorePlugin.getResourceString(MARKERS)); //$NON-NLS-1$
monitor.subTask(ManagedBuilderCorePlugin.getResourceString(MARKERS));
epm.reportProblems();
}
} catch (Exception e) {

View file

@ -321,7 +321,7 @@ public class MakefileGenerator {
// Calculate the new directory relative to the build output
IPath moduleRelativePath = module.getProjectRelativePath();
String relativePath = moduleRelativePath.toString();
relativePath += relativePath.length() == 0 ? "" : SEPARATOR;
relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
// Create the buffer to hold the output for the module and a dep calculator
StringBuffer buffer = new StringBuffer();
@ -381,13 +381,13 @@ public class MakefileGenerator {
*/
private String escapeWhitespaces(String path) {
// Escape the spaces in the path/filename if it has any
String[] segments = path.split("\\s");
String[] segments = path.split("\\s"); //$NON-NLS-1$
if (segments.length > 1) {
StringBuffer escapedPath = new StringBuffer();
for (int index = 0; index < segments.length; ++index) {
escapedPath.append(segments[index]);
if (index + 1 < segments.length) {
escapedPath.append("\\ ");
escapedPath.append("\\ "); //$NON-NLS-1$
}
}
return escapedPath.toString().trim();
@ -432,27 +432,27 @@ public class MakefileGenerator {
StringBuffer buffer = new StringBuffer();
// Add the ROOT macro
buffer.append("ROOT := .." + NEWLINE);
buffer.append("ROOT := .." + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// include makefile.init supplementary makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_INIT + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_INIT + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Get the clean command from the build model
buffer.append("RM := ");
buffer.append("RM := "); //$NON-NLS-1$
buffer.append(info.getCleanCommand() + NEWLINE);
buffer.append(NEWLINE);
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(SRC_LISTS) + NEWLINE);
buffer.append("C_SRCS := " + NEWLINE);
buffer.append("CC_SRCS := " + NEWLINE);
buffer.append("CXX_SRCS := " + NEWLINE);
buffer.append("CAPC_SRCS := " + NEWLINE);
buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE);
buffer.append("C_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CC_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CXX_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CAPC_SRCS := " + NEWLINE); //$NON-NLS-1$
buffer.append("CPP_SRCS := " + NEWLINE + NEWLINE); //$NON-NLS-1$
// Add the libraries this project depends on
buffer.append("LIBS := ");
buffer.append("LIBS := "); //$NON-NLS-1$
String[] libs = info.getLibsForTarget(extension);
for (int i = 0; i < libs.length; i++) {
String string = libs[i];
@ -461,7 +461,7 @@ public class MakefileGenerator {
buffer.append(NEWLINE + NEWLINE);
// Add the extra user-specified objects
buffer.append("USER_OBJS := ");
buffer.append("USER_OBJS := "); //$NON-NLS-1$
String[] userObjs = info.getUserObjectsForTarget(extension);
for (int j = 0; j < userObjs.length; j++) {
String string = userObjs[j];
@ -469,7 +469,7 @@ public class MakefileGenerator {
}
buffer.append(NEWLINE + NEWLINE);
buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE);
buffer.append("OBJS = $(C_SRCS:$(ROOT)/%.c=%.o) $(CC_SRCS:$(ROOT)/%.cc=%.o) $(CXX_SRCS:$(ROOT)/%.cxx=%.o) $(CAPC_SRCS:$(ROOT)/%.C=%.o) $(CPP_SRCS:$(ROOT)/%.cpp=%.o)" + NEWLINE); //$NON-NLS-1$
return (buffer.append(NEWLINE));
}
@ -480,7 +480,7 @@ public class MakefileGenerator {
StringBuffer buffer = new StringBuffer();
// Add the comment
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_LIST) + NEWLINE);
buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE);
buffer.append("SUBDIRS := " + LINEBREAK + NEWLINE); //$NON-NLS-1$
// Get all the module names
ListIterator iter = getSubdirList().listIterator();
@ -488,7 +488,7 @@ public class MakefileGenerator {
IContainer container = (IContainer) iter.next();
// Check the special case where the module is the project root
if (container.getFullPath() == project.getFullPath()) {
buffer.append("." + WHITESPACE + LINEBREAK + NEWLINE);
buffer.append(DOT + WHITESPACE + LINEBREAK + NEWLINE);
} else {
IPath path = container.getProjectRelativePath();
buffer.append(path.toString() + WHITESPACE + LINEBREAK + NEWLINE);
@ -498,11 +498,11 @@ public class MakefileGenerator {
// Now add the makefile instruction to include all the subdirectory makefile fragments
buffer.append(NEWLINE);
buffer.append(COMMENT_SYMBOL +WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.mk, $(SUBDIRS)}" + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Include makefile.defs supplemental makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_DEFS + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_DEFS + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
return buffer;
@ -520,20 +520,20 @@ public class MakefileGenerator {
// Calculate the new directory relative to the build output
IPath moduleRelativePath = module.getProjectRelativePath();
String relativePath = moduleRelativePath.toString();
relativePath += relativePath.length() == 0 ? "" : SEPARATOR;
relativePath += relativePath.length() == 0 ? "" : SEPARATOR; //$NON-NLS-1$
// String buffers
StringBuffer buffer = new StringBuffer();
StringBuffer cBuffer = new StringBuffer("C_SRCS += " + LINEBREAK + NEWLINE);
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE);
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE);
cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE);
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE);
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE);
StringBuffer cBuffer = new StringBuffer("C_SRCS += " + LINEBREAK + NEWLINE); //$NON-NLS-1$
cBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer ccBuffer = new StringBuffer("CC_SRCS += \\" + NEWLINE); //$NON-NLS-1$
ccBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer cxxBuffer = new StringBuffer("CXX_SRCS += \\" + NEWLINE); //$NON-NLS-1$
cxxBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer capcBuffer = new StringBuffer("CAPC_SRCS += \\" + NEWLINE); //$NON-NLS-1$
capcBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer cppBuffer = new StringBuffer("CPP_SRCS += \\" + NEWLINE); //$NON-NLS-1$
cppBuffer.append("${addprefix $(ROOT)/" + relativePath + "," + LINEBREAK + NEWLINE); //$NON-NLS-1$//$NON-NLS-2$
StringBuffer ruleBuffer = new StringBuffer(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(MOD_RULES) + NEWLINE);
// Put the comment in
@ -546,13 +546,13 @@ public class MakefileGenerator {
if (resource.getType() == IResource.FILE) {
String ext = resource.getFileExtension();
if (info.buildsFileType(ext)) {
if (new String("c").equals(ext)) {
if (new String("c").equals(ext)) { //$NON-NLS-1$
cBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("cc").equalsIgnoreCase(ext)) {
} else if (new String("cc").equalsIgnoreCase(ext)) { //$NON-NLS-1$
ccBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("cxx").equalsIgnoreCase(ext)) {
} else if (new String("cxx").equalsIgnoreCase(ext)) { //$NON-NLS-1$
cxxBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else if (new String("C").equals(ext)) {
} else if (new String("C").equals(ext)) { //$NON-NLS-1$
capcBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
} else {
cppBuffer.append(resource.getName() + WHITESPACE + LINEBREAK + NEWLINE);
@ -565,11 +565,11 @@ public class MakefileGenerator {
}
// Finish the commands in the buffers
buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE));
buffer.append(cBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(ccBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(cxxBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(capcBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
buffer.append(cppBuffer.append("}" + NEWLINE + NEWLINE)); //$NON-NLS-1$
return buffer.append(ruleBuffer + NEWLINE);
}
@ -588,7 +588,7 @@ public class MakefileGenerator {
String flags = info.getFlagsForTarget(extension);
String outflag = info.getOutputFlag(extension);
String outputPrefix = info.getOutputPrefix(extension);
String targets = rebuild ? "clean all" : "all";
String targets = rebuild ? "clean all" : "all"; //$NON-NLS-1$ //$NON-NLS-2$
// Get all the projects the build target depends on
IProject[] deps = null;
@ -601,9 +601,9 @@ public class MakefileGenerator {
// Write out the all target first in case someone just runs make
// all: targ_<target_name> [deps]
String defaultTarget = "all:";
String defaultTarget = "all:"; //$NON-NLS-1$
if (deps.length > 0) {
defaultTarget += WHITESPACE + "deps";
defaultTarget += WHITESPACE + "deps"; //$NON-NLS-1$
}
buffer.append(defaultTarget + WHITESPACE + outputPrefix + target);
if (extension.length() > 0) {
@ -619,7 +619,7 @@ public class MakefileGenerator {
*/
List managedProjectOutputs = new ArrayList();
if (deps.length > 0) {
buffer.append("deps:" + NEWLINE);
buffer.append("deps:" + NEWLINE); //$NON-NLS-1$
if (deps != null) {
for (int i = 0; i < deps.length; i++) {
IProject dep = deps[i];
@ -635,7 +635,7 @@ public class MakefileGenerator {
String depExt = depInfo.getBuildArtifactExtension();
String depPrefix = depInfo.getOutputPrefix(depExt);
if (depInfo.isDirty()) {
depTargets = "clean all";
depTargets = "clean all"; //$NON-NLS-1$
}
String dependency = buildDir + SEPARATOR + depPrefix + depTarget;
if (depExt.length() > 0) {
@ -643,7 +643,7 @@ public class MakefileGenerator {
}
managedProjectOutputs.add(dependency);
}
buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE);
buffer.append(TAB + "-cd" + WHITESPACE + buildDir + WHITESPACE + LOGICAL_AND + WHITESPACE + "$(MAKE) " + depTargets + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
}
}
buffer.append(NEWLINE);
@ -658,27 +658,27 @@ public class MakefileGenerator {
if (extension.length() > 0) {
buffer.append(DOT + extension);
}
buffer.append(COLON + WHITESPACE + "$(OBJS)");
buffer.append(COLON + WHITESPACE + "$(OBJS)"); //$NON-NLS-1$
Iterator iter = managedProjectOutputs.listIterator();
while (iter.hasNext()) {
buffer.append(WHITESPACE + (String)iter.next());
}
buffer.append(NEWLINE);
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(USER_OBJS) $(LIBS)");
buffer.append(TAB + cmd + WHITESPACE + flags + WHITESPACE + outflag + WHITESPACE + "$@" + WHITESPACE + "$(OBJS) $(USER_OBJS) $(LIBS)"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(NEWLINE + NEWLINE);
// Always add a clean target
buffer.append("clean:" + NEWLINE);
buffer.append(TAB + "-$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE);
buffer.append("clean:" + NEWLINE); //$NON-NLS-1$
buffer.append(TAB + "-$(RM)" + WHITESPACE + "$(OBJS)" + WHITESPACE + outputPrefix + target + NEWLINE + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE);
buffer.append(".PHONY: all clean deps" + NEWLINE + NEWLINE); //$NON-NLS-1$
buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedBuilderCorePlugin.getResourceString(DEP_INCL) + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE);
buffer.append("-include ${patsubst %, %/subdir.dep, $(SUBDIRS)}" + NEWLINE); //$NON-NLS-1$
buffer.append(NEWLINE);
// Include makefile.targets supplemental makefile
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_TARGETS + NEWLINE);
buffer.append("-include $(ROOT)" + SEPARATOR + MAKEFILE_TARGETS + NEWLINE); //$NON-NLS-1$
return buffer;
}
@ -717,7 +717,7 @@ public class MakefileGenerator {
* source1/%.o: $(ROOT)/source1/%.cpp
* g++ -g -O2 -c -I/cygdrive/c/eclipse/workspace/Project/headers -o $@ $<
*/
rule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + "$(ROOT)" + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension;
rule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + "$(ROOT)" + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension; //$NON-NLS-1$
}
// Check if the rule is listed as something we already generated in the makefile
@ -731,7 +731,7 @@ public class MakefileGenerator {
buildFlags = info.getFlagsForSource(inputExtension);
outflag = info.getOutputFlag(outputExtension);
outputPrefix = info.getOutputPrefix(outputExtension);
buffer.append(TAB + cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + "$@" + WHITESPACE + "$<" + NEWLINE + NEWLINE);
buffer.append(TAB + cmd + WHITESPACE + buildFlags + WHITESPACE + outflag + WHITESPACE + outputPrefix + "$@" + WHITESPACE + "$<" + NEWLINE + NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -74,13 +74,13 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
String defaultTargetId = null;
List configIds = new ArrayList();
while (child != null) {
if (child.getNodeName().equals("target")) {
if (child.getNodeName().equals(ITarget.TARGET_ELEMENT_NAME)) {
new Target(this, (Element)child);
} else if (child.getNodeName().equals("defaultConfig")) {
} else if (child.getNodeName().equals(DEFAULT_CONFIGURATION)) {
// We may not have read the config in yet, so just cache it
configIds.add(((Element)child).getAttribute("id"));
} else if (child.getNodeName().equals("defaultTarget")) {
defaultTargetId = ((Element)child).getAttribute("id");
configIds.add(((Element)child).getAttribute(IConfiguration.ID));
} else if (child.getNodeName().equals(DEFAULT_TARGET)) {
defaultTargetId = ((Element)child).getAttribute(ITarget.ID);
}
child = child.getNextSibling();
}
@ -280,7 +280,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
}
String key = new String();
String value = new String();
int index = symbol.indexOf("=");
int index = symbol.indexOf("="); //$NON-NLS-1$
if (index != -1) {
key = symbol.substring(0, index).trim();
value = symbol.substring(index + 1).trim();
@ -392,7 +392,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
IPath location = owner.getLocation();
// If the build info is out of date this might be null
if (location == null) {
location = new Path(".");
location = new Path("."); //$NON-NLS-1$
}
IPath root = location.addTrailingSeparator().append(config.getName());
ITool[] tools = config.getTools();
@ -824,21 +824,21 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
public void serialize(Document doc, Element element) {
// Write out each target and their default config
for (int i = 0; i < targets.size(); ++i) {
Element targetElement = doc.createElement("target");
Element targetElement = doc.createElement(ITarget.TARGET_ELEMENT_NAME);
element.appendChild(targetElement);
((Target)targets.get(i)).serialize(doc, targetElement);
IConfiguration config = getDefaultConfiguration((ITarget)targets.get(i));
if (config != null) {
Element configEl = doc.createElement("defaultConfig");
Element configEl = doc.createElement(DEFAULT_CONFIGURATION);
element.appendChild(configEl);
configEl.setAttribute("id", config.getId());
configEl.setAttribute(IConfiguration.ID, config.getId());
}
}
// Persist the default target
if (getDefaultTarget() != null){
Element targEl = doc.createElement("defaultTarget");
Element targEl = doc.createElement(DEFAULT_TARGET);
element.appendChild(targEl);
targEl.setAttribute("id", getDefaultTarget().getId());
targEl.setAttribute(ITarget.ID, getDefaultTarget().getId());
}
}

View file

@ -20,6 +20,7 @@ import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.core.runtime.IConfigurationElement;
public class Option extends BuildObject implements IOption {
@ -178,7 +179,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getDefinedSymbols() throws BuildException {
if (valueType != PREPROCESSOR_SYMBOLS) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -202,7 +203,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getIncludePaths() throws BuildException {
if (valueType != INCLUDE_PATH) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -218,7 +219,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getLibraries() throws BuildException {
if (valueType != LIBRARIES) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -234,7 +235,7 @@ public class Option extends BuildObject implements IOption {
*/
public String getSelectedEnum() throws BuildException {
if (valueType != ENUMERATED) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
return defaultEnumName == null ? EMPTY_STRING : defaultEnumName;
}
@ -244,7 +245,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getStringListValue() throws BuildException {
if (valueType != STRING_LIST) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
ArrayList v = (ArrayList)value;
if (v == null) {
@ -260,7 +261,7 @@ public class Option extends BuildObject implements IOption {
*/
public String getStringValue() throws BuildException {
if (valueType != STRING) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
return value == null ? EMPTY_STRING : (String)value;
}
@ -277,7 +278,7 @@ public class Option extends BuildObject implements IOption {
*/
public String[] getUserObjects() throws BuildException {
if (valueType != OBJECTS) {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
// This is the right puppy, so return its list value
ArrayList v = (ArrayList)value;
@ -311,7 +312,7 @@ public class Option extends BuildObject implements IOption {
{
if (valueType != IOption.STRING
|| valueType != ENUMERATED)
throw new BuildException("Bad value for type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
if (config == null) {
this.value = value;
@ -333,7 +334,7 @@ public class Option extends BuildObject implements IOption {
|| valueType != PREPROCESSOR_SYMBOLS
|| valueType != LIBRARIES
|| valueType != OBJECTS)
throw new BuildException("Bad value for type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
if (config == null) {
this.value = value;

View file

@ -19,6 +19,7 @@ import org.eclipse.cdt.managedbuilder.core.BuildException;
import org.eclipse.cdt.managedbuilder.core.IOption;
import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.core.runtime.IConfigurationElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@ -190,7 +191,7 @@ public class OptionReference implements IOption {
while (iter.hasNext()) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next());
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false");
valueElement.setAttribute(LIST_ITEM_BUILTIN, "false"); //$NON-NLS-1$
element.appendChild(valueElement);
}
// Serialize the built-ins that have been overridden
@ -199,7 +200,7 @@ public class OptionReference implements IOption {
while (iter.hasNext()) {
Element valueElement = doc.createElement(LIST_VALUE);
valueElement.setAttribute(LIST_ITEM_VALUE, (String)iter.next());
valueElement.setAttribute(LIST_ITEM_BUILTIN, "true");
valueElement.setAttribute(LIST_ITEM_BUILTIN, "true"); //$NON-NLS-1$
element.appendChild(valueElement);
}
}
@ -239,7 +240,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -268,7 +269,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -282,7 +283,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -304,7 +305,7 @@ public class OptionReference implements IOption {
Boolean bool = (Boolean) value;
return bool.booleanValue();
} else {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@ -334,7 +335,7 @@ public class OptionReference implements IOption {
// Value will contain the human-readable name of the enum
return (String) value;
} else {
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}
@ -349,7 +350,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -361,7 +362,7 @@ public class OptionReference implements IOption {
else if (getValueType() == STRING)
return (String)value;
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -391,7 +392,7 @@ public class OptionReference implements IOption {
return (String[]) list.toArray(new String[list.size()]);
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/* (non-Javadoc)
@ -433,7 +434,7 @@ public class OptionReference implements IOption {
if (getValueType() == BOOLEAN)
this.value = new Boolean(value);
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/**
@ -444,7 +445,7 @@ public class OptionReference implements IOption {
if (getValueType() == STRING || getValueType() == ENUMERATED)
this.value = value;
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
/**
@ -463,7 +464,7 @@ public class OptionReference implements IOption {
this.value = new ArrayList(Arrays.asList(value));
}
else
throw new BuildException("bad value type");
throw new BuildException(ManagedBuilderCorePlugin.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
}
}

View file

@ -25,4 +25,12 @@ ManagedMakeBuilder.comment.build.rule = Each subdirectory must supply rules for
ManagedMakeBuilder.comment.module.make.includes = Include the makefiles for each source subdirectory
ManagedMakeBuilder.comment.module.dep.includes = Include automatically-generated dependency list:
ManagedMakeBuilder.comment.autodeps = Automatically-generated dependency list:
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
ManagedMakeBuilder.comment.header = Automatically-generated file. Do not edit!
# Option exception messages
Option.error.bad_value_type=Bad value for type
# Managed build manager exception messages
ManagedBuildManager.error.owner_not_null=addTarget: owner not null
ManagedBuildManager.error.null_owner=addTarget: null owner
ManagedBuildManager.error.owner_not_project=addTarget: owner not project

View file

@ -83,7 +83,7 @@ public class Target extends BuildObject implements ITarget {
if (id < 0) {
id *= -1;
}
setId(owner.getName() + "." + parent.getId() + "." + id);
setId(owner.getName() + "." + parent.getId() + "." + id); //$NON-NLS-1$ //$NON-NLS-2$
setName(parent.getName());
this.artifactName = parent.getArtifactName();
this.binaryParserId = parent.getBinaryParserId();
@ -133,10 +133,10 @@ public class Target extends BuildObject implements ITarget {
}
// isAbstract
isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT)));
isAbstract = ("true".equals(element.getAttribute(IS_ABSTRACT))); //$NON-NLS-1$
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$
// Get the clean command
cleanCommand = element.getAttribute(CLEAN_COMMAND);
@ -148,7 +148,7 @@ public class Target extends BuildObject implements ITarget {
String os = element.getAttribute(OS_LIST);
if (os != null) {
targetOSList = new ArrayList();
StringTokenizer tokens = new StringTokenizer(os, ",");
StringTokenizer tokens = new StringTokenizer(os, ","); //$NON-NLS-1$
while (tokens.hasMoreTokens()) {
targetOSList.add(tokens.nextToken().trim());
}
@ -204,11 +204,11 @@ public class Target extends BuildObject implements ITarget {
parent = ManagedBuildManager.getTarget(null, parentId);
// isAbstract
if ("true".equals(element.getAttribute(IS_ABSTRACT)))
if ("true".equals(element.getAttribute(IS_ABSTRACT))) //$NON-NLS-1$
isAbstract = true;
// Is this a test target
isTest = ("true".equals(element.getAttribute(IS_TEST)));
isTest = ("true".equals(element.getAttribute(IS_TEST))); //$NON-NLS-1$
// Get the clean command
cleanCommand = element.getAttribute(CLEAN_COMMAND);
@ -265,12 +265,12 @@ public class Target extends BuildObject implements ITarget {
element.setAttribute(NAME, getName());
if (parent != null)
element.setAttribute(PARENT, parent.getId());
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false");
element.setAttribute(IS_ABSTRACT, isAbstract ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
element.setAttribute(ARTIFACT_NAME, getArtifactName());
if (extension != null) {
element.setAttribute(EXTENSION, extension);
}
element.setAttribute(IS_TEST, isTest ? "true" : "false");
element.setAttribute(IS_TEST, isTest ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
element.setAttribute(CLEAN_COMMAND, getCleanCommand());
if (makeCommand != null) {
element.setAttribute(MAKE_COMMAND, makeCommand);
@ -312,7 +312,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getMakeArguments();
} else {
// No parent and no user setting
return new String("");
return new String(""); //$NON-NLS-1$
}
}
return makeArguments;
@ -329,7 +329,7 @@ public class Target extends BuildObject implements ITarget {
return parent.getMakeCommand();
} else {
// The user has forgotten to specify a command in the plugin manifets.
return new String("make");
return new String("make"); //$NON-NLS-1$
}
} else {
return makeCommand;
@ -534,10 +534,10 @@ public class Target extends BuildObject implements ITarget {
return parent.getCleanCommand();
} else {
// User forgot to specify it. Guess based on OS.
if (BootLoader.getOS().equals("OS_WIN32")) {
return new String("del");
if (BootLoader.getOS().equals("OS_WIN32")) { //$NON-NLS-1$
return new String("del"); //$NON-NLS-1$
} else {
return new String("rm");
return new String("rm"); //$NON-NLS-1$
}
}
} else {

View file

@ -32,7 +32,7 @@ import org.eclipse.core.runtime.IConfigurationElement;
*/
public class Tool extends BuildObject implements ITool, IOptionCategory {
private static final String DEFAULT_SEPARATOR = ",";
private static final String DEFAULT_SEPARATOR = ","; //$NON-NLS-1$
private static final IOptionCategory[] EMPTY_CATEGORIES = new IOptionCategory[0];
private static final IOption[] EMPTY_OPTIONS = new IOption[0];
@ -337,11 +337,11 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
// Get the nature filter
String nature = element.getAttribute(NATURE);
if (nature == null || "both".equals(nature)) {
if (nature == null || "both".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_BOTH;
} else if ("cnature".equals(nature)) {
} else if ("cnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_C;
} else if ("ccnature".equals(nature)) {
} else if ("ccnature".equals(nature)) { //$NON-NLS-1$
natureFilter = FILTER_CC;
} else {
natureFilter = FILTER_BOTH;