Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Adding build configurations

Hi Wyatt,

My responses are embedded below.

Regards,
Leo

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of wspear
Sent: Thursday, September 01, 2005 3:20 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Adding build configurations

Thank you very much for the help.  I've been able to generate new 
configurations and dig into the build chain.  Fun stuff.  Some new 
questions have come up though.

1: How do you save a new build configuration permanently?  Presently the

ones I generate with this method are absent after restarting Eclipse.

ManagedBuildManager.saveBuildInfo(project.getProject(),true); was the 
only method I could find that seemed like it might address this, but 
using it only seems to break the managed build system of the target 
project (it becomes unavailable).  The same thing happens if the new 
configuration is selected and applied via the UI before restarting 
Eclipse. 

------------------------------------------------------------------------
--

[Leo]  That's the correct method.  There are 2 ways to help you see what
is happening:

1.  Examine the .cdtbuild file before and after you add the
configuration to see what has changed.  If something has changed, see if
it appears to conform to the build model described in the Managed Build
System Extensibility Document in the on-line help.  If nothing has
changed, note the code below at the beginning of the saveBuildInfo
method:

			// Save the build info
			if (buildInfo != null && 
					!buildInfo.isReadOnly() &&
					buildInfo.isValid() &&
					(force == true ||
buildInfo.isDirty())) {

It's probably failing one of these checks.

2.  Download the CDT code, build and debug it within Eclipse.  It's not
that hard to do and it's the easiest way to learn what code is doing.
Here is the way that I develop CDT:

  -  Create a "fresh" Eclipse SDK installation.  Don't add CDT.
  -  Open the CVS Repository Perspective
  -  Create a New... Repository Location
  -  Set Host to dev.eclipse.org
  -  Set Repository path to /home/tools
  -  Set User to anonymous and click Finish
  -  Expand the new entry in the CVS Repositories view and then expand
HEAD
  -  Select:
    o  All of the entries under org.eclipse.cdt-build except for "old"
    o  All of the entries under org.eclipse.cdt-core
    o  All of the entries under org.eclipse.cdt-debug
    o  All of the entries under org.eclipse.cdt-doc
    o  All of the entries under org.eclipse.cdt-launch
    o  All of the entries under org.eclipse.cdt-releng except for "old"
  -  Right click and select Check Out As...
  -  In the dialog that is displayed, just click finish
  -  If you have automatic building set, CDT will begin building,
otherwise build it.  There should not be any errors in the build, but
there will be warnings.
  -  To debug CDT, go to the Plug-in Development perspective, set
breakpoints in the code and then Debug As... an Eclipse Application.

------------------------------------------------------------------------
--

Does the build configuration ID (or does other configuration data) need 
to conform to any particular format to ensure that it can be properly 
saved to a CDT project's persistent files?

------------------------------------------------------------------------
--
 
[Leo]  Not that I can think of.

------------------------------------------------------------------------
--

On a possibly related note, 
ManagedBuildManager.setSelectedConfiguration(project.getProject(),newCon
fig); 
does not seem to have any effect.  (It isn't documented but I would 
expect it to be the programmatic equivalent of selecting and applying a 
build configuration in the UI).

------------------------------------------------------------------------
--
 
[Leo]  Use setDefaultConfiguration instead, but it won't display any UI.
UI property pages are displayed by Eclipse when the user selects
Properties.  It uses information that the CDT plug-ins place in their
plugin.xml file.

------------------------------------------------------------------------
--

2:  How do you modify the configuration-specific environment settings?  
I've checked out the EnvironmentVariableSupplier and 
EnvironmentVariableProvider systems.  There are lots of 'gets' but I 
haven't yet discovered a way of programmatically setting or appending to

the environment.

------------------------------------------------------------------------
--

[Leo]  See the Build Environment Variables design document in bugzilla
(#88497).  I'm not sure if that can be done other than in the context of
a tool-chain definition.

------------------------------------------------------------------------
--


Thanks Again,
Wyatt


Treggiari, Leo wrote:

>You should use the interfaces/methods defined in
>org.eclipse.cdt.managedbuilder.core.  These are the "somewhat" public
>managed build system interfaces.  I say "somewhat" since they aren't
>documented, and it is possible that some might change, be removed, etc.
>when we do document the public interfaces.  But we won't make changes
>without good reason.
>
>Here is an example of how you would add a new configuration to a
>project.
>
> IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
> IManagedProject managedProj = info.getManagedProject();
> IConfiguration newConfig =
>managedProj.createConfiguration(parentConfig, id); 		
>
>Regards,
>Leo
>
>-----Original Message-----
>From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
>On Behalf Of wspear
>Sent: Tuesday, August 23, 2005 2:39 PM
>To: cdt-dev@xxxxxxxxxxx
>Subject: [cdt-dev] Adding build configurations
>
>Greetings,
>
>I'm looking for a good way to programmatically (with a plugin) add new 
>build configurations (supplementing Debug and Release) to the CDT's 
>managed make build system (either for specified projects or globally).

>A means of automatically defining configuration environment variables, 
>in particular, would be useful. 
>
>If someone could point me to the relevant chunk of the CDT API or
source
>
>(if such functions are implemented) that would be great.  Editing the 
>relevant XML file(s) directly has been the only method I've found so
far
>
>and I'm guessing that's not the best practice (plus I haven't yet found

>how to add configuration environment variables via the XML file(s)).
>
>Thanks,
>
>Wyatt Spear
>_______________________________________________
>cdt-dev mailing list
>cdt-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/cdt-dev
>_______________________________________________
>cdt-dev mailing list
>cdt-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/cdt-dev
>  
>

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top