Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix compilation for CDT 8.2
  • Loading branch information
amorellgarcia committed Nov 25, 2013
commit 9d8618acf00cd5c7230c8326084730569ea5c7ac
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private enum State {
new MacroOptionParser("#define\\s+(\\S*)\\s*(\\S*)", "$1", "$2", ICSettingEntry.BUILTIN | ICSettingEntry.READONLY), };

@Override
protected String getToolchainId() {
public String getToolchainId() {
return GCC_TOOLCHAIN_ID;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package it.baeyens.arduino.tools;

import org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvidersKeeper;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
Expand All @@ -12,11 +13,12 @@
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
import org.eclipse.cdt.managedbuilder.internal.dataprovider.ConfigurationDataProvider;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

import it.baeyens.arduino.ui.BuildConfigurationsPage.ConfigurationDescriptor;

import java.util.ArrayList;

@SuppressWarnings("restriction")
Expand Down Expand Up @@ -99,7 +101,12 @@ public static void setCProjectDescription(IProject project,
}
CConfigurationData data = cfg.getConfigurationData();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amorellgarcia
This piece of code was removed for kepler and then brought back in because juno failed.
Before I accept your pull request I want to be sure this works in juno and kepler (and I still need to find out how I can easily test a pull request)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but this method is now removed from Kepler so I changed it with the "if block" that is below.

That block code, is written folllowing the recommendations from http://wiki.eclipse.org/CDT/ScannerDiscovery61/API
As you can in the paragraph:
"New interface ILanguageSettingsProvidersKeeper for modifying language setting providers, which is implemented by the CConfigurationDescription class. See the function testProjectDescription_ReadWriteDescription() in LanguageSettingsPersistenceProjectTests for example code.:"

This patch also should fix the issue #83

ICConfigurationDescription cfgDes = des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, data);
ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);

if (cfgDes instanceof ILanguageSettingsProvidersKeeper) {
ILanguageSettingsProvidersKeeper lspk = (ILanguageSettingsProvidersKeeper)cfgDes;
lspk.setDefaultLanguageSettingsProvidersIds(new String[] {alCfgs.get(i).ToolchainID});
}
// ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly the if test for CDT 8.2
I assume having this line in the else should do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that in Kepler that static method no longer exists. Maybe in newer versions there is a separate method to set indexer configuration paths.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

och they didn't make it depricated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ConfigurationDataProvider is located at org.eclipse.cdt.managedbuilder.internal.dataprovider package that is internal. I think that internal classes doesn't need to be deprecated before their removal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. This code should have been in cdt

}
monitor.worked(50);
mngr.setProjectDescription(project, des);
Expand Down