Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Is there a public method to set the project build command?
Is there a public method to set the project build command? [message #65308] Wed, 26 March 2003 20:01
Eclipse UserFriend
Originally posted by: derek.p.gilbert.intel.com

I have a new project wizard that creates a new project and then converts
it to a C project depending on some user data. I want to be able to
default the build settings for this new project as if the user went
through the new C project wizard so that they don't have to modify it
using the project properties. Is there a public method that I can use to
default the build settings. I tried using the following code which did not
error but it also didn't set anything. Thanks

import org.eclipse.cdt.core.CProjectNature; //Top of file import

//Actual code from my method copied from settingsBlock code in CDT
//Trying to default the project build command
try {
CProjectNature nature = (CProjectNature)
project.getNature(CProjectNature.C_NATURE_ID);
if (nature != null) {
String bldLine = "make -f testbld.mak";
int start = bldLine.indexOf(' ');
IPath path;
if ( start == -1 ) {
path = new Path(bldLine);
} else {
path = new Path(bldLine.substring(0, start));
}
nature.setBuildCommand(path, new SubProgressMonitor(monitor, 50));
String args = "";
if ( start != -1 ) {
args = bldLine.substring(start + 1);
}
nature.setFullBuildArguments(args, new SubProgressMonitor(monitor, 50));
}

} catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Previous Topic:Outline View
Next Topic:convertProjectToC to convert existing project: errors
Goto Forum:
  


Current Time: Wed Jul 03 01:22:25 GMT 2024

Powered by FUDForum. Page generated in 0.02452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top