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
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
Expand Down Expand Up @@ -61,8 +60,6 @@
import org.eclipse.cdt.core.language.settings.providers.LanguageSettingsManager;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.CoreModelUtil;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.core.parser.IScannerInfoChangeListener;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
Expand All @@ -72,7 +69,6 @@
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyManager;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentBuildPathsChangeListener;
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
import org.eclipse.cdt.managedbuilder.internal.buildproperties.BuildPropertyManager;
import org.eclipse.cdt.managedbuilder.internal.core.BooleanExpressionApplicabilityCalculator;
Expand Down Expand Up @@ -251,14 +247,8 @@ public class ManagedBuildManager extends AbstractCExtension {
// This map has a lifecycle corresponding to the build definitions extension loading.
private static Map<IBuildObject, IManagedConfigElement> configElementMap;

// private static List sortedToolChains;
// private static Map builtTypeToToolChainListMap;
// Listeners interested in build model changes
private static Map<IResource, List<IScannerInfoChangeListener>> buildModelListeners;
// Random number for derived object model elements
private static Random randomNumber;
// Environment Build Paths Change Listener
private static IEnvironmentBuildPathsChangeListener fEnvironmentBuildPathsChangeListener;

private static HashMap<MatchKey<ToolChain>, List<ToolChain>> fSortedToolChains;
private static HashMap<MatchKey<Tool>, List<Tool>> fSortedTools;
Expand All @@ -274,16 +264,6 @@ private static interface ISorter {
void sort();
}

static {
getEnvironmentVariableProvider()
.subscribe(fEnvironmentBuildPathsChangeListener = (configuration, buildPathType) -> {
// if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
// initializePathEntries(configuration,null);
// notifyListeners(configuration,null);
// }
});
}

/**
* @return the next random number as a positive integer.
*/
Expand Down Expand Up @@ -820,47 +800,11 @@ public static IConfiguration getSelectedConfiguration(IProject project) {
return null;
}

/* (non-Javadoc)
*
* @param config
* @param option
/**
* Unreferenced in CDT
* @deprecated
*/
/*
private static void notifyListeners(IConfiguration config, IOption option) {
// Continue if change is something that effect the scanner
try {
//an option can be null in the case of calling this method from the environment
//build path change listener
if (config.isTemporary() ||
(option != null && option.getValueType() != IOption.INCLUDE_PATH
&& option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
&& option.getValueType() != IOption.INCLUDE_FILES
&& option.getValueType() != IOption.LIBRARY_PATHS
&& option.getValueType() != IOption.LIBRARY_FILES
&& option.getValueType() != IOption.MACRO_FILES
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
&& option.getValueType() != IOption.UNDEF_MACRO_FILES
)) {
return;
}
} catch (BuildException e) {return;}

// Figure out if there is a listener for this change
IResource resource = config.getOwner();
List listeners = (List) getBuildModelListeners().get(resource);
if (listeners == null) {
return;
}
ListIterator iter = listeners.listIterator();
while (iter.hasNext()) {
((IScannerInfoChangeListener)iter.next()).changeNotification(resource, (IScannerInfo)getBuildInfo(resource));
}
}
*/
@Deprecated(forRemoval = true)
public static void initializePathEntries(IConfiguration config, IOption option) {
try {
if (config.isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH
Expand All @@ -885,43 +829,17 @@ public static void initializePathEntries(IConfiguration config, IOption option)

}

/**
* Unreferenced in CDT
* @deprecated
*/
@Deprecated(forRemoval = true)
public static void initializePathEntries(IResourceConfiguration resConfig, IOption option) {
IConfiguration cfg = resConfig.getParent();
if (cfg != null)
initializePathEntries(cfg, option);
}

private static void notifyListeners(IResourceInfo resConfig, IOption option) {
// Continue if change is something that effect the scanreser
try {
if (resConfig.getParent().isTemporary() || (option != null && option.getValueType() != IOption.INCLUDE_PATH
&& option.getValueType() != IOption.PREPROCESSOR_SYMBOLS
&& option.getValueType() != IOption.INCLUDE_FILES && option.getValueType() != IOption.LIBRARY_PATHS
&& option.getValueType() != IOption.LIBRARY_FILES && option.getValueType() != IOption.MACRO_FILES
&& option.getValueType() != IOption.UNDEF_INCLUDE_PATH
&& option.getValueType() != IOption.UNDEF_PREPROCESSOR_SYMBOLS
&& option.getValueType() != IOption.UNDEF_INCLUDE_FILES
&& option.getValueType() != IOption.UNDEF_LIBRARY_PATHS
&& option.getValueType() != IOption.UNDEF_LIBRARY_FILES
&& option.getValueType() != IOption.UNDEF_MACRO_FILES && !option.isForScannerDiscovery())) {
return;
}
} catch (BuildException e) {
return;
}

// Figure out if there is a listener for this change
IResource resource = resConfig.getParent().getOwner();
List<IScannerInfoChangeListener> listeners = getBuildModelListeners().get(resource);
if (listeners == null) {
return;
}
ListIterator<IScannerInfoChangeListener> iter = listeners.listIterator();
while (iter.hasNext()) {
iter.next().changeNotification(resource, (IScannerInfo) getBuildInfo(resource));
}
}

/**
* Adds the version of the managed build system to the project
* specified in the argument.
Expand Down Expand Up @@ -995,8 +913,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
} else {
// Event handling Failed.
}
// initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
Expand Down Expand Up @@ -1061,8 +977,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
} else {
// Event handling Failed.
}
// initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
Expand Down Expand Up @@ -1127,8 +1041,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
} else {
// Event handling Failed.
}
// initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
Expand All @@ -1147,8 +1059,6 @@ public static IOption setOption(IResourceInfo resConfig, IHoldsOptions holder, I
} else {
// Event handling Failed.
}
// initializePathEntries(resConfig,retOpt);
notifyListeners(resConfig, retOpt);
} catch (BuildException e) {
return null;
}
Expand Down Expand Up @@ -1478,6 +1388,11 @@ public static void updateCoreSettings(IProject project) throws CoreException {
updateBuildInfo(project, true);
}

/**
* Unreferenced in CDT
* @deprecated
*/
@Deprecated
public static void updateCoreSettings(IConfiguration cfg) throws CoreException {
IProject project = cfg.getOwner().getProject();
ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project);
Expand All @@ -1488,6 +1403,11 @@ public static void updateCoreSettings(IConfiguration cfg) throws CoreException {
}
}

/**
* Unreferenced in CDT
* @deprecated
*/
@Deprecated(forRemoval = true)
public static void updateCoreSettings(IProject project, IConfiguration[] cfgs) throws CoreException {
updateCoreSettings(project, cfgs, false);
}
Expand Down Expand Up @@ -2980,16 +2900,6 @@ public static URL getURLInBuildDefinitions(DefaultManagedConfigElement element,
return null;
}

/*
* @return
*/
private static Map<IResource, List<IScannerInfoChangeListener>> getBuildModelListeners() {
if (buildModelListeners == null) {
buildModelListeners = new HashMap<>();
}
return buildModelListeners;
}

private static Map<IBuildObject, IManagedConfigElement> getConfigElementMap() {
if (!projectTypesLoading)
throw new IllegalStateException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
* listeners of the environment build path changes should implement this interface
*
* @since 3.0
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
public interface IEnvironmentBuildPathsChangeListener {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,17 @@ public IBuildEnvironmentVariable getVariable(String variableName, Object level,
* adds the listener that will return notifications about the include and library paths changes.
* The ManagedBuildManager will register the change listener and will notify all registered
* Scanned Info Change Listeners about the include paths change.
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
void subscribe(IEnvironmentBuildPathsChangeListener listener);

/**
* removes the include and library paths change listener
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
void unsubscribe(IEnvironmentBuildPathsChangeListener listener);
}
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,22 @@ private List<IEnvironmentBuildPathsChangeListener> getListeners() {

/**
* notifies registered listeners
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
private void notifyListeners(IConfiguration configuration, int buildPathType) {
List<IEnvironmentBuildPathsChangeListener> listeners = getListeners();
for (IEnvironmentBuildPathsChangeListener listener : listeners) {
listener.buildPathsChanged(configuration, buildPathType);
}
}

/**
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
@Override
public synchronized void subscribe(IEnvironmentBuildPathsChangeListener listener) {
if (listener == null)
Expand All @@ -257,6 +265,11 @@ public synchronized void subscribe(IEnvironmentBuildPathsChangeListener listener
listeners.add(listener);
}

/**
*
* @deprecated Not referenced in CDT
*/
@Deprecated(forRemoval = true)
@Override
public synchronized void unsubscribe(IEnvironmentBuildPathsChangeListener listener) {
if (listener == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* @deprecated Since CDT 4.0 replaced by {@link ScannerInfoProviderProxy}. Still
* used as a default for projects created by earlier CDT versions.
*/
@Deprecated
@Deprecated(forRemoval = true)
public class ScannerProvider extends AbstractCExtension implements IScannerInfoProvider, IElementChangedListener {

// Listeners interested in build model changes
Expand Down