Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Missing CDT project type extension

Hi,

I'm new to Eclipse and CDT development. In my project I need to
programatically create a CDT managed build project for my unit tests. The
creation of the project works fine when I execute the code in Eclipse as a
"JUnit Plug-in Test". The problem is that when I run my tests in my build
with Maven Surfire on a Linux workstation all my tests are failing because
the method
ManagedBuildManager.getExtensionProjectType("cdt.managedbuild.target.gnu.exe")
returns null! Here's the code:

ICProjectDescriptionManager mgr =
CoreModel.getDefault().getProjectDescriptionManager();
ICProjectDescription des = mgr.getProjectDescription(project, true);

IManagedBuildInfo info = ManagedBuildManager.createBuildInfo(project);
IProjectType projType =
ManagedBuildManager.getExtensionProjectType("cdt.managedbuild.target.gnu.exe");
// RETURNS NULL
IToolChain toolChain =
ManagedBuildManager.getExtensionToolChain("cdt.managedbuild.toolchain.gnu.exe.debug");

ManagedProject mProj = new ManagedProject(project, projType); // CAUSES
NullPointerException
info.setManagedProject(mProj);

IConfiguration[] configs =
ManagedBuildManager.getExtensionConfigurations(toolChain, projType);

Do you have any idea why this code only works in Eclipse itself?

Thanks a lot,
Henry

-- 
View this message in context: http://old.nabble.com/Missing-CDT-project-type-extension-tp29904674p29904674.html
Sent from the Eclipse CDT - Development mailing list archive at Nabble.com.



Back to the top