1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-18 22:45:23 +02:00

bug 357442: User-friendlier message about missing toolchain

This commit is contained in:
Andrew Gvozdev 2012-09-16 07:22:50 -04:00
parent d643e121a0
commit b1fc6f69be
3 changed files with 44 additions and 46 deletions

View file

@ -13,49 +13,45 @@ package org.eclipse.cdt.managedbuilder.envvar;
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
/**
*
* this interface is to be implemented by the tool-integrator
* for supplying the configuration-specific environment
* This interface is to be implemented by the tool-integrator for supplying the configuration-specific
* environment.
*
* @since 3.0
*/
public interface IConfigurationEnvironmentVariableSupplier{
public interface IConfigurationEnvironmentVariableSupplier {
/**
*
* @param variableName the variable name
* @param configuration configuration
* @param variableName - the variable name.
* @param configuration - configuration.
* @param provider the instance of the environment variable provider to be used for querying the
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
* The provider passed to a supplier will ignore searching the variables for the levels
* higher than the current supplier level, will query only the lower-precedence suppliers
* for the current level and will query all suppliers for the lower levels.
* This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
* @return the reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
* The provider passed to a supplier will ignore searching the variables for the levels
* higher than the current supplier level, will query only the lower-precedence suppliers
* for the current level and will query all suppliers for the lower levels.
* This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
* @return The reference to the IBuildEnvironmentVariable interface representing
* the variable of a given name or {@code null} if the variable is not defined.
*/
IBuildEnvironmentVariable getVariable(String variableName,
IConfiguration configuration,
IEnvironmentVariableProvider provider);
IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider);
/**
* @param configuration configuration
* @param provider the instance of the environment variable provider to be used for querying the
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
* The provider passed to a supplier will ignore searching the variables for the levels
* higher than the current supplier level, will query only the lower-precedence suppliers
* for the current level and will query all suppliers for the lower levels.
* This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
* @return the array of IBuildEnvironmentVariable that represents the environment variables
* @param configuration - configuration.
* @param provider - the instance of the environment variable provider to be used for querying the
* environment variables from within the supplier. The supplier should use this provider to obtain
* the already defined environment instead of using the "default" provider returned by the
* ManagedBuildManager.getEnvironmentVariableProvider().
* The provider passed to a supplier will ignore searching the variables for the levels
* higher than the current supplier level, will query only the lower-precedence suppliers
* for the current level and will query all suppliers for the lower levels.
* This is done to avoid infinite loops that could be caused if the supplier calls the provider
* and the provider in turn calls that supplier again. Also the supplier should not know anything
* about the environment variables defined for the higher levels.
* @return The array of IBuildEnvironmentVariable that represents the environment variables.
* If the array contains any {@code null} it will be ignored.
*/
IBuildEnvironmentVariable[] getVariables (IConfiguration configuration,
IEnvironmentVariableProvider provider);
IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider);
}

View file

@ -26,6 +26,7 @@ import org.eclipse.cdt.managedbuilder.core.IFileInfo;
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
import org.eclipse.cdt.managedbuilder.core.ITool;
import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
@ -178,8 +179,9 @@ public class BuildConfigurationData extends CConfigurationData {
String msg = null;
if(!fCfg.isSupported()){
flags |= CConfigurationStatus.TOOLCHAIN_NOT_SUPPORTED;
msg = DataProviderMessages.getString("BuildConfigurationData.NoConfigurationSupport"); //$NON-NLS-1$
IToolChain toolChain = fCfg.getToolChain();
String tname = toolChain != null ? toolChain.getName() : ""; //$NON-NLS-1$
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.NoToolchainSupport"), tname); //$NON-NLS-1$
} else if (ManagedBuildManager.getExtensionConfiguration(fCfg)==null){
flags |= CConfigurationStatus.SETTINGS_INVALID;
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), fCfg.getId()); //$NON-NLS-1$

View file

@ -21,5 +21,5 @@ ProjectConverter.6=the project conversion failed
ProjectConverter.7=targets conversion
ProjectConverter.8=the project conversion failed due to unknown reason
ProjectConverter.9=the given project is not a valid CDT project
BuildConfigurationData.NoConfigurationSupport=The configuration support is not installed on the system
BuildConfigurationData.NoToolchainSupport=Toolchain "{0}" is not detected. Refer to "C/C++ Development User Guide", "Before you begin" about installing toolchains.
BuildConfigurationData.OrphanedConfiguration=Orphaned configuration. No base extension cfg exists for {0}