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:
parent
d643e121a0
commit
b1fc6f69be
3 changed files with 44 additions and 46 deletions
|
@ -13,49 +13,45 @@ package org.eclipse.cdt.managedbuilder.envvar;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* This interface is to be implemented by the tool-integrator for supplying the configuration-specific
|
||||||
* this interface is to be implemented by the tool-integrator
|
* environment.
|
||||||
* for supplying the configuration-specific environment
|
*
|
||||||
*
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public interface IConfigurationEnvironmentVariableSupplier{
|
public interface IConfigurationEnvironmentVariableSupplier {
|
||||||
/**
|
/**
|
||||||
*
|
* @param variableName - the variable name.
|
||||||
* @param variableName the variable name
|
* @param configuration - configuration.
|
||||||
* @param configuration configuration
|
|
||||||
* @param provider the instance of the environment variable provider to be used for querying the
|
* @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
|
* 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
|
* the already defined environment instead of using the "default" provider returned by the
|
||||||
* ManagedBuildManager.getEnvironmentVariableProvider().
|
* ManagedBuildManager.getEnvironmentVariableProvider().
|
||||||
* The provider passed to a supplier will ignore searching the variables for the levels
|
* 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
|
* 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.
|
* 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
|
* 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
|
* 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.
|
* about the environment variables defined for the higher levels.
|
||||||
* @return the reference to the IBuildEnvironmentVariable interface representing
|
* @return The reference to the IBuildEnvironmentVariable interface representing
|
||||||
* the variable of a given name
|
* the variable of a given name or {@code null} if the variable is not defined.
|
||||||
*/
|
*/
|
||||||
IBuildEnvironmentVariable getVariable(String variableName,
|
IBuildEnvironmentVariable getVariable(String variableName, IConfiguration configuration, IEnvironmentVariableProvider provider);
|
||||||
IConfiguration configuration,
|
|
||||||
IEnvironmentVariableProvider provider);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param configuration configuration
|
* @param configuration - configuration.
|
||||||
* @param provider the instance of the environment variable provider to be used for querying the
|
* @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
|
* 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
|
* the already defined environment instead of using the "default" provider returned by the
|
||||||
* ManagedBuildManager.getEnvironmentVariableProvider().
|
* ManagedBuildManager.getEnvironmentVariableProvider().
|
||||||
* The provider passed to a supplier will ignore searching the variables for the levels
|
* 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
|
* 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.
|
* 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
|
* 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
|
* 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.
|
* about the environment variables defined for the higher levels.
|
||||||
* @return the array of IBuildEnvironmentVariable that represents the environment variables
|
* @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,
|
IBuildEnvironmentVariable[] getVariables(IConfiguration configuration, IEnvironmentVariableProvider provider);
|
||||||
IEnvironmentVariableProvider provider);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.managedbuilder.core.IFileInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
import org.eclipse.cdt.managedbuilder.core.IFolderInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
import org.eclipse.cdt.managedbuilder.core.IResourceInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
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.ManagedBuildManager;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||||
|
@ -39,7 +40,7 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
public BuildConfigurationData(IConfiguration cfg){
|
public BuildConfigurationData(IConfiguration cfg){
|
||||||
fCfg = (Configuration)cfg;
|
fCfg = (Configuration)cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IConfiguration getConfiguration(){
|
public IConfiguration getConfiguration(){
|
||||||
return fCfg;
|
return fCfg;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +52,7 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
IFileInfo info = fCfg.createFileInfo(path, ((BuildFileData)base).getFileInfo(), id, path.lastSegment());
|
IFileInfo info = fCfg.createFileInfo(path, ((BuildFileData)base).getFileInfo(), id, path.lastSegment());
|
||||||
return info.getFileData();
|
return info.getFileData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CFileData createFileData(IPath path, CFolderData base, CLanguageData baseLangData)
|
public CFileData createFileData(IPath path, CFolderData base, CLanguageData baseLangData)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
@ -67,7 +68,7 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CFolderData createFolderData(IPath path, CFolderData base)
|
public CFolderData createFolderData(IPath path, CFolderData base)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
@ -153,7 +154,7 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
// return fCdtVars;
|
// return fCdtVars;
|
||||||
return new BuildVariablesContributor(this);
|
return new BuildVariablesContributor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearCachedData(){
|
void clearCachedData(){
|
||||||
fCfg.clearCachedData();
|
fCfg.clearCachedData();
|
||||||
CResourceData[] datas = getResourceDatas();
|
CResourceData[] datas = getResourceDatas();
|
||||||
|
@ -161,7 +162,7 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
// BuildLanguageData lData;
|
// BuildLanguageData lData;
|
||||||
// BuildLanguageData[] lDatas;
|
// BuildLanguageData[] lDatas;
|
||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < datas.length; i++){
|
for(int i = 0; i < datas.length; i++){
|
||||||
data = datas[i];
|
data = datas[i];
|
||||||
if(data.getType() == ICSettingBase.SETTING_FOLDER){
|
if(data.getType() == ICSettingBase.SETTING_FOLDER){
|
||||||
|
@ -178,16 +179,17 @@ public class BuildConfigurationData extends CConfigurationData {
|
||||||
String msg = null;
|
String msg = null;
|
||||||
if(!fCfg.isSupported()){
|
if(!fCfg.isSupported()){
|
||||||
flags |= CConfigurationStatus.TOOLCHAIN_NOT_SUPPORTED;
|
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){
|
} else if (ManagedBuildManager.getExtensionConfiguration(fCfg)==null){
|
||||||
flags |= CConfigurationStatus.SETTINGS_INVALID;
|
flags |= CConfigurationStatus.SETTINGS_INVALID;
|
||||||
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), fCfg.getId()); //$NON-NLS-1$
|
msg = NLS.bind(DataProviderMessages.getString("BuildConfigurationData.OrphanedConfiguration"), fCfg.getId()); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flags != 0)
|
if(flags != 0)
|
||||||
return new CConfigurationStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), flags, msg, null);
|
return new CConfigurationStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), flags, msg, null);
|
||||||
|
|
||||||
return CConfigurationStatus.CFG_STATUS_OK;
|
return CConfigurationStatus.CFG_STATUS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,5 +21,5 @@ ProjectConverter.6=the project conversion failed
|
||||||
ProjectConverter.7=targets conversion
|
ProjectConverter.7=targets conversion
|
||||||
ProjectConverter.8=the project conversion failed due to unknown reason
|
ProjectConverter.8=the project conversion failed due to unknown reason
|
||||||
ProjectConverter.9=the given project is not a valid CDT project
|
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}
|
BuildConfigurationData.OrphanedConfiguration=Orphaned configuration. No base extension cfg exists for {0}
|
||||||
|
|
Loading…
Add table
Reference in a new issue