Is there a public method to set the project build command? [message #65308] |
Wed, 26 March 2003 15:01 |
Eclipse User |
|
|
|
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();
}
|
|
|
Powered by
FUDForum. Page generated in 0.03016 seconds