mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Merge branch 'cdt/master' into sd90
This commit is contained in:
commit
4f2cea1002
334 changed files with 8918 additions and 8128 deletions
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/test1DepCalc2.zip
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/test1DepCalc2.zip
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/test1DepCalc3.zip
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/test1DepCalc3.zip
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/test1DepCalcPreBuild.zip
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/test1DepCalcPreBuild.zip
Executable file → Normal file
|
@ -1774,8 +1774,27 @@ If this attribute is not specified, MBS will assume that there are no reserved m
|
||||||
<attribute name="parallelBuildCmd" type="string">
|
<attribute name="parallelBuildCmd" type="string">
|
||||||
<annotation>
|
<annotation>
|
||||||
<documentation>
|
<documentation>
|
||||||
specifies the "parallel build" builder option.
|
Specifies the command for "parallel build".
|
||||||
If the builder supports specifying custom number of parallel jobs, the option definition may contain "*" the Build System sill substitute the "*" with the number of parallel threads to be used.
|
If the builder supports specifying custom number of parallel jobs the option definition may contain "*". The Build System will substitute the "*" with the number of parallel threads to be used. In case of "unlimited" jobs jobs number will be omitted.
|
||||||
|
For example, builder representing GNU make would define parallelBuildCmd as "-j*".
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="parallelBuildOn" type="boolean">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Defines if the parallel build is enabled in newly created project by default (when parallel build is supported). The number of jobs is defined by "parallelizationNumber" attribute. If "parallelizationNumber" is not defined "optimal" value will be used.
|
||||||
|
</documentation>
|
||||||
|
</annotation>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="parallelizationNumber" type="string">
|
||||||
|
<annotation>
|
||||||
|
<documentation>
|
||||||
|
Sets maximum number of parallel threads/jobs to be used by builder (that value can be changed after creation of project by user).
|
||||||
|
A positive number or value "optimal" or "unlimited" are recognized:
|
||||||
|
- number 1 will cause parallel build to be turned off,
|
||||||
|
- "optimal" will set maximum number of jobs to number of processors on the system,
|
||||||
|
- "unlimited" will make builder to run as many threads/jobs as possible.
|
||||||
</documentation>
|
</documentation>
|
||||||
</annotation>
|
</annotation>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
|
|
@ -76,13 +76,16 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
|
||||||
static final String ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS = "customizedErrorParsers"; //$NON-NLS-1$
|
static final String ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS = "customizedErrorParsers"; //$NON-NLS-1$
|
||||||
static final String ATTRIBUTE_CUSTOM_PROPS = "customBuilderProperties"; //$NON-NLS-1$
|
static final String ATTRIBUTE_CUSTOM_PROPS = "customBuilderProperties"; //$NON-NLS-1$
|
||||||
|
|
||||||
// static final String ATTRIBUTE_CUSTOMIZED_ERROR_PARSERS = "customizedErrorParsers"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
static final String ATTRIBUTE_IGNORE_ERR_CMD = "ignoreErrCmd"; //$NON-NLS-1$
|
static final String ATTRIBUTE_IGNORE_ERR_CMD = "ignoreErrCmd"; //$NON-NLS-1$
|
||||||
static final String ATTRIBUTE_STOP_ON_ERR = "stopOnErr"; //$NON-NLS-1$
|
static final String ATTRIBUTE_STOP_ON_ERR = "stopOnErr"; //$NON-NLS-1$
|
||||||
|
|
||||||
static final String ATTRIBUTE_PARALLEL_BUILD_CMD = "parallelBuildCmd"; //$NON-NLS-1$
|
static final String ATTRIBUTE_PARALLEL_BUILD_CMD = "parallelBuildCmd"; //$NON-NLS-1$
|
||||||
static final String ATTRIBUTE_PARALLELIZATION_NUMBER = "parallelizationNumber"; //$NON-NLS-1$
|
|
||||||
static final String ATTRIBUTE_PARALLEL_BUILD_ON = "parallelBuildOn"; //$NON-NLS-1$
|
static final String ATTRIBUTE_PARALLEL_BUILD_ON = "parallelBuildOn"; //$NON-NLS-1$
|
||||||
|
static final String ATTRIBUTE_PARALLELIZATION_NUMBER = "parallelizationNumber"; //$NON-NLS-1$
|
||||||
|
/** @since 8.1 */
|
||||||
|
static final String VALUE_OPTIMAL = "optimal"; //$NON-NLS-1$
|
||||||
|
/** @since 8.1 */
|
||||||
|
static final String VALUE_UNLIMITED = "unlimited"; //$NON-NLS-1$
|
||||||
static final String PARALLEL_PATTERN_NUM = "*"; //$NON-NLS-1$
|
static final String PARALLEL_PATTERN_NUM = "*"; //$NON-NLS-1$
|
||||||
static final String PARALLEL_PATTERN_NUM_START = "["; //$NON-NLS-1$
|
static final String PARALLEL_PATTERN_NUM_START = "["; //$NON-NLS-1$
|
||||||
static final String PARALLEL_PATTERN_NUM_END = "]"; //$NON-NLS-1$
|
static final String PARALLEL_PATTERN_NUM_END = "]"; //$NON-NLS-1$
|
||||||
|
@ -92,15 +95,9 @@ public interface IBuilder extends IHoldsOptions, IMakeBuilderInfo {
|
||||||
static final String DEFAULT_TARGET_INCREMENTAL = "all"; //$NON-NLS-1$
|
static final String DEFAULT_TARGET_INCREMENTAL = "all"; //$NON-NLS-1$
|
||||||
static final String DEFAULT_TARGET_CLEAN = "clean"; //$NON-NLS-1$
|
static final String DEFAULT_TARGET_CLEAN = "clean"; //$NON-NLS-1$
|
||||||
static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$
|
static final String DEFAULT_TARGET_AUTO = "all"; //$NON-NLS-1$
|
||||||
|
/** @since 6.0 */
|
||||||
/**
|
|
||||||
* @since 6.0
|
|
||||||
*/
|
|
||||||
static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$
|
static final String ATTRIBUTE_COMMAND_LAUNCHER = "commandLauncher"; //$NON-NLS-1$
|
||||||
|
/** @since 8.0 */
|
||||||
/**
|
|
||||||
* @since 8.0
|
|
||||||
*/
|
|
||||||
static final String ATTRIBUTE_BUILD_RUNNER = "buildRunner"; //$NON-NLS-1$
|
static final String ATTRIBUTE_BUILD_RUNNER = "buildRunner"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
* Copyright (c) 2007, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -13,19 +13,56 @@ package org.eclipse.cdt.managedbuilder.core;
|
||||||
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildProperty;
|
||||||
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
import org.eclipse.cdt.managedbuilder.buildproperties.IBuildPropertyValue;
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This class is to combine multiple configurations to one to support
|
||||||
|
* selection of multiple configurations on property pages.
|
||||||
|
*
|
||||||
* @noextend This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface IMultiConfiguration extends IConfiguration, ICMultiItemsHolder {
|
public interface IMultiConfiguration extends IConfiguration, ICMultiItemsHolder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if all configurations' builders are operating in parallel mode.
|
||||||
|
* @return {@code true} if parallel mode is enabled for all configurations,
|
||||||
|
* {@code false} otherwise.
|
||||||
|
*/
|
||||||
boolean getParallelDef();
|
boolean getParallelDef();
|
||||||
void setParallelDef(boolean def);
|
/**
|
||||||
|
* Set same parallel execution mode for all configurations' builders.
|
||||||
|
* @see Builder#setParallelBuildOn(boolean)
|
||||||
|
*
|
||||||
|
* @param parallel - the flag to enable or disable parallel mode.
|
||||||
|
*/
|
||||||
|
void setParallelDef(boolean parallel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns maximum number of parallel threads/jobs used by the configurations' builders.
|
||||||
|
* @see #setParallelDef(boolean)
|
||||||
|
*
|
||||||
|
* @return - maximum number of parallel threads or jobs used by each builder or 0 if the numbers
|
||||||
|
* don't match.
|
||||||
|
*/
|
||||||
int getParallelNumber();
|
int getParallelNumber();
|
||||||
void setParallelNumber(int num);
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets maximum number of parallel threads/jobs to be used by each builder.
|
||||||
|
*
|
||||||
|
* @param jobs - maximum number of jobs or threads, see for more details
|
||||||
|
* {@link Builder#getOptimalParallelJobNum()}.
|
||||||
|
*/
|
||||||
|
void setParallelNumber(int jobs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if all configurations' internal builders are operating in parallel mode.
|
||||||
|
* @return {@code true} if parallel mode is enabled for all configurations,
|
||||||
|
* {@code false} otherwise.
|
||||||
|
*
|
||||||
|
* @deprecated since CDT 9.0. Use {@link #getParallelDef()}
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
boolean getInternalBuilderParallel();
|
boolean getInternalBuilderParallel();
|
||||||
|
|
||||||
boolean isInternalBuilderEnabled();
|
boolean isInternalBuilderEnabled();
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class InternalBuildRunner extends AbstractBuildRunner {
|
||||||
public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
|
public boolean invokeBuild(int kind, IProject project, IConfiguration configuration,
|
||||||
IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
|
IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
|
||||||
IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {
|
IncrementalProjectBuilder projectBuilder, IProgressMonitor monitor) throws CoreException {
|
||||||
boolean isParallel = builder.isParallelBuildOn() && builder.getParallelizationNum() > 1;
|
boolean isParallel = builder.getParallelizationNum() > 1;
|
||||||
// boolean buildIncrementaly = true;
|
// boolean buildIncrementaly = true;
|
||||||
boolean resumeOnErr = !builder.isStopOnError();
|
boolean resumeOnErr = !builder.isStopOnError();
|
||||||
|
|
||||||
|
@ -226,8 +226,7 @@ public class InternalBuildRunner extends AbstractBuildRunner {
|
||||||
break;
|
break;
|
||||||
case IBuildModelBuilder.STATUS_ERROR_LAUNCH:
|
case IBuildModelBuilder.STATUS_ERROR_LAUNCH:
|
||||||
default:
|
default:
|
||||||
buf.append(ManagedMakeMessages
|
buf.append(ManagedMakeMessages.getResourceString(BUILD_FAILED_ERR));
|
||||||
.getResourceString(BUILD_FAILED_ERR));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
|
buf.append(System.getProperty("line.separator", "\n")); //$NON-NLS-1$//$NON-NLS-2$
|
||||||
|
@ -248,8 +247,7 @@ public class InternalBuildRunner extends AbstractBuildRunner {
|
||||||
epmOutputStream = null;
|
epmOutputStream = null;
|
||||||
|
|
||||||
// Generate any error markers that the build has discovered
|
// Generate any error markers that the build has discovered
|
||||||
monitor.subTask(ManagedMakeMessages
|
monitor.subTask(ManagedMakeMessages.getResourceString(MARKERS));
|
||||||
.getResourceString(MARKERS));
|
|
||||||
|
|
||||||
bsMngr.setProjectBuildState(project, pBS);
|
bsMngr.setProjectBuildState(project, pBS);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -153,13 +153,13 @@ import org.w3c.dom.ProcessingInstruction;
|
||||||
public class ManagedBuildManager extends AbstractCExtension {
|
public class ManagedBuildManager extends AbstractCExtension {
|
||||||
|
|
||||||
public static final String MBS_LANGUAGE_SETTINGS_PROVIDER = "org.eclipse.cdt.managedbuilder.core.LanguageSettingsProvider";
|
public static final String MBS_LANGUAGE_SETTINGS_PROVIDER = "org.eclipse.cdt.managedbuilder.core.LanguageSettingsProvider";
|
||||||
// private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.getUniqueIdentifier(), "managedBuildInfo"); //$NON-NLS-1$
|
// private static final QualifiedName buildInfoProperty = new QualifiedName(ManagedBuilderCorePlugin.PLUGIN_ID, "managedBuildInfo"); //$NON-NLS-1$
|
||||||
private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
|
private static final String ROOT_NODE_NAME = "ManagedProjectBuildInfo"; //$NON-NLS-1$
|
||||||
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
public static final String SETTINGS_FILE_NAME = ".cdtbuild"; //$NON-NLS-1$
|
||||||
private static final ITarget[] emptyTargets = new ITarget[0];
|
private static final ITarget[] emptyTargets = new ITarget[0];
|
||||||
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildManager"; //$NON-NLS-1$
|
public static final String INTERFACE_IDENTITY = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildManager"; //$NON-NLS-1$
|
||||||
public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".buildDefinitions"; //$NON-NLS-1$
|
public static final String EXTENSION_POINT_ID = ManagedBuilderCorePlugin.PLUGIN_ID + ".buildDefinitions"; //$NON-NLS-1$
|
||||||
public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".ManagedBuildInfo"; //$NON-NLS-1$
|
public static final String EXTENSION_POINT_ID_V2 = ManagedBuilderCorePlugin.PLUGIN_ID + ".ManagedBuildInfo"; //$NON-NLS-1$
|
||||||
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
|
private static final String REVISION_ELEMENT_NAME = "managedBuildRevision"; //$NON-NLS-1$
|
||||||
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
|
private static final String VERSION_ELEMENT_NAME = "fileVersion"; //$NON-NLS-1$
|
||||||
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
|
private static final String MANIFEST_VERSION_ERROR ="ManagedBuildManager.error.manifest.version.error"; //$NON-NLS-1$
|
||||||
|
@ -188,7 +188,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
public static final String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB = "org.eclipse.cdt.build.core.buildArtefactType.staticLib"; //$NON-NLS-1$
|
public static final String BUILD_ARTEFACT_TYPE_PROPERTY_STATICLIB = "org.eclipse.cdt.build.core.buildArtefactType.staticLib"; //$NON-NLS-1$
|
||||||
public static final String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB = "org.eclipse.cdt.build.core.buildArtefactType.sharedLib"; //$NON-NLS-1$
|
public static final String BUILD_ARTEFACT_TYPE_PROPERTY_SHAREDLIB = "org.eclipse.cdt.build.core.buildArtefactType.sharedLib"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String CFG_DATA_PROVIDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".configurationDataProvider"; //$NON-NLS-1$
|
public static final String CFG_DATA_PROVIDER_ID = ManagedBuilderCorePlugin.PLUGIN_ID + ".configurationDataProvider"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -261,16 +261,19 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
private static Map<IProject, IManagedBuildInfo> fInfoMap = new HashMap<IProject, IManagedBuildInfo>();
|
private static Map<IProject, IManagedBuildInfo> fInfoMap = new HashMap<IProject, IManagedBuildInfo>();
|
||||||
|
|
||||||
private static ISorter fToolChainSorter = new ISorter(){
|
private static ISorter fToolChainSorter = new ISorter(){
|
||||||
|
@Override
|
||||||
public void sort() {
|
public void sort() {
|
||||||
resortToolChains();
|
resortToolChains();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static ISorter fToolSorter = new ISorter(){
|
private static ISorter fToolSorter = new ISorter(){
|
||||||
|
@Override
|
||||||
public void sort() {
|
public void sort() {
|
||||||
resortTools();
|
resortTools();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static ISorter fBuilderSorter = new ISorter(){
|
private static ISorter fBuilderSorter = new ISorter(){
|
||||||
|
@Override
|
||||||
public void sort() {
|
public void sort() {
|
||||||
resortBuilders();
|
resortBuilders();
|
||||||
}
|
}
|
||||||
|
@ -284,6 +287,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
static {
|
static {
|
||||||
getEnvironmentVariableProvider().subscribe(
|
getEnvironmentVariableProvider().subscribe(
|
||||||
fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
|
fEnvironmentBuildPathsChangeListener = new IEnvironmentBuildPathsChangeListener(){
|
||||||
|
@Override
|
||||||
public void buildPathsChanged(IConfiguration configuration, int buildPathType){
|
public void buildPathsChanged(IConfiguration configuration, int buildPathType){
|
||||||
// if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
|
// if(buildPathType == IEnvVarBuildPath.BUILDPATH_INCLUDE){
|
||||||
// initializePathEntries(configuration,null);
|
// initializePathEntries(configuration,null);
|
||||||
|
@ -1331,6 +1335,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
if (shell != null) {
|
if (shell != null) {
|
||||||
final String exceptionMsg = err.getMessage();
|
final String exceptionMsg = err.getMessage();
|
||||||
shell.getDisplay().syncExec( new Runnable() {
|
shell.getDisplay().syncExec( new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
MessageDialog.openError(shell,
|
MessageDialog.openError(shell,
|
||||||
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$
|
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.write_failed_title"), //$NON-NLS-1$
|
||||||
|
@ -1880,13 +1885,13 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
initBuildInfoContainer(buildInfo);
|
initBuildInfoContainer(buildInfo);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
return new Status(IStatus.ERROR,
|
return new Status(IStatus.ERROR,
|
||||||
ManagedBuilderCorePlugin.getUniqueIdentifier(),
|
ManagedBuilderCorePlugin.PLUGIN_ID,
|
||||||
IStatus.ERROR,
|
IStatus.ERROR,
|
||||||
e.getLocalizedMessage(),
|
e.getLocalizedMessage(),
|
||||||
e);
|
e);
|
||||||
}
|
}
|
||||||
return new Status(IStatus.OK,
|
return new Status(IStatus.OK,
|
||||||
ManagedBuilderCorePlugin.getUniqueIdentifier(),
|
ManagedBuilderCorePlugin.PLUGIN_ID,
|
||||||
IStatus.OK,
|
IStatus.OK,
|
||||||
ManagedMakeMessages.getFormattedString("ManagedBuildInfo.message.init.ok", resource.getName()), //$NON-NLS-1$
|
ManagedMakeMessages.getFormattedString("ManagedBuildInfo.message.init.ok", resource.getName()), //$NON-NLS-1$
|
||||||
null);
|
null);
|
||||||
|
@ -1903,7 +1908,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
// private static void initBuildInfoContainer(ManagedBuildInfo info) throws CoreException {
|
// private static void initBuildInfoContainer(ManagedBuildInfo info) throws CoreException {
|
||||||
// if (info == null) {
|
// if (info == null) {
|
||||||
// throw new CoreException(new Status(IStatus.ERROR,
|
// throw new CoreException(new Status(IStatus.ERROR,
|
||||||
// ManagedBuilderCorePlugin.getUniqueIdentifier(),
|
// ManagedBuilderCorePlugin.PLUGIN_ID,
|
||||||
// IStatus.ERROR,
|
// IStatus.ERROR,
|
||||||
// new String(),
|
// new String(),
|
||||||
// null));
|
// null));
|
||||||
|
@ -2156,6 +2161,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
final Shell shell = window.getShell();
|
final Shell shell = window.getShell();
|
||||||
final String errMsg = ManagedMakeMessages.getFormattedString(MANIFEST_VERSION_ERROR, extension.getUniqueIdentifier());
|
final String errMsg = ManagedMakeMessages.getFormattedString(MANIFEST_VERSION_ERROR, extension.getUniqueIdentifier());
|
||||||
shell.getDisplay().asyncExec( new Runnable() {
|
shell.getDisplay().asyncExec( new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
MessageDialog.openError(shell,
|
MessageDialog.openError(shell,
|
||||||
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.manifest_load_failed_title"), //$NON-NLS-1$
|
ManagedMakeMessages.getResourceString("ManagedBuildManager.error.manifest_load_failed_title"), //$NON-NLS-1$
|
||||||
|
@ -2943,7 +2949,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
if(info != null)
|
if(info != null)
|
||||||
doSetLoaddedInfo(project, info, false);
|
doSetLoaddedInfo(project, info, false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), e.getLocalizedMessage(), e));
|
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID, e.getLocalizedMessage(), e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4585,6 +4591,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
||||||
*
|
*
|
||||||
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
int ticks = 1;
|
int ticks = 1;
|
||||||
if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
|
if (buildKind==IncrementalProjectBuilder.CLEAN_BUILD) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 Intel Corporation and others.
|
* Copyright (c) 2006, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -11,42 +11,28 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
|
package org.eclipse.cdt.managedbuilder.internal.buildmodel;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
|
||||||
import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
|
|
||||||
import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class implements process pool management for internal builder
|
* This class implements process pool management for internal builder
|
||||||
*
|
|
||||||
* NOTE: This class is subject to change and discuss,
|
|
||||||
* and is currently available in experimental mode only
|
|
||||||
*/
|
*/
|
||||||
public class BuildProcessManager {
|
public class BuildProcessManager {
|
||||||
protected OutputStream out;
|
protected OutputStream out;
|
||||||
protected OutputStream err;
|
protected OutputStream err;
|
||||||
protected boolean show;
|
protected boolean show;
|
||||||
protected ProcessLauncher[] processes;
|
protected Vector<ProcessLauncher> processes;
|
||||||
protected int maxProcesses;
|
protected int maxProcesses;
|
||||||
|
|
||||||
// Number of CPUs is not dependent of object instance.
|
|
||||||
// But user can change UI settings for processes number.
|
|
||||||
// So we cannot set procNumber directly to maxProcesses.
|
|
||||||
static int procNumber = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes process manager
|
* Initializes process manager
|
||||||
*
|
*
|
||||||
|
@ -59,7 +45,7 @@ public class BuildProcessManager {
|
||||||
err = _err;
|
err = _err;
|
||||||
show = _show;
|
show = _show;
|
||||||
maxProcesses = _procNumber;
|
maxProcesses = _procNumber;
|
||||||
processes = new ProcessLauncher[maxProcesses];
|
processes = new Vector<ProcessLauncher>(Math.min(10, maxProcesses), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,18 +65,19 @@ public class BuildProcessManager {
|
||||||
* @param monitor Progress monitor for this task
|
* @param monitor Progress monitor for this task
|
||||||
*/
|
*/
|
||||||
public ProcessLauncher launchProcess(IBuildCommand cmd, IPath cwd, IProgressMonitor monitor) {
|
public ProcessLauncher launchProcess(IBuildCommand cmd, IPath cwd, IProgressMonitor monitor) {
|
||||||
if (hasEmpty()) {
|
for (int i = 0; i < maxProcesses; i++) {
|
||||||
int i = 0;
|
if (i >= processes.size()) {
|
||||||
for (; i < maxProcesses; i++) {
|
ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(), mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
|
||||||
if (processes[i] == null || processes[i].queryState() == ProcessLauncher.STATE_DONE) {
|
processes.add(process);
|
||||||
break;
|
process.launch();
|
||||||
}
|
return process;
|
||||||
}
|
|
||||||
|
|
||||||
if (i < maxProcesses) {
|
}
|
||||||
processes[i] = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(), mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
|
if (processes.get(i).queryState() == ProcessLauncher.STATE_DONE) {
|
||||||
processes[i].launch();
|
ProcessLauncher process = new ProcessLauncher(cmd.getCommand(), cmd.getArgs(), mapToStringArray(cmd.getEnvironment()), cwd, out, err, monitor, show);
|
||||||
return processes[i];
|
processes.set(i, process);
|
||||||
|
process.launch();
|
||||||
|
return process;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -102,36 +89,37 @@ public class BuildProcessManager {
|
||||||
* returned as a result. Otherwise this method returns null.
|
* returned as a result. Otherwise this method returns null.
|
||||||
*/
|
*/
|
||||||
public ProcessLauncher queryStates() {
|
public ProcessLauncher queryStates() {
|
||||||
ProcessLauncher result = null;
|
for (ProcessLauncher process : processes) {
|
||||||
|
int state = process.queryState();
|
||||||
for (int i = 0; i < maxProcesses; i++) {
|
if (state != ProcessLauncher.STATE_RUNNING && state != ProcessLauncher.STATE_DONE)
|
||||||
if (processes[i] != null) {
|
return process;
|
||||||
int state = processes[i].queryState();
|
|
||||||
if (state != ProcessLauncher.STATE_RUNNING) {
|
|
||||||
if (state != ProcessLauncher.STATE_DONE && result == null)
|
|
||||||
result = processes[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks states of all currently running processes.
|
* Checks states of all currently running processes.
|
||||||
*/
|
*/
|
||||||
public boolean hasEmpty() {
|
public boolean hasEmpty() {
|
||||||
for (int i = 0; i < maxProcesses; i++) {
|
if (processes.size() < maxProcesses)
|
||||||
if (processes[i] == null)
|
|
||||||
return true;
|
return true;
|
||||||
else {
|
|
||||||
if (processes[i].queryState() != ProcessLauncher.STATE_RUNNING)
|
for (ProcessLauncher process : processes) {
|
||||||
|
if (process.queryState() != ProcessLauncher.STATE_RUNNING)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns maximum threads used up to that point
|
||||||
|
*/
|
||||||
|
public int getThreadsUsed() {
|
||||||
|
return processes.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts map to strings array
|
* Converts map to strings array
|
||||||
|
@ -152,40 +140,10 @@ public class BuildProcessManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Number of processors detected
|
* @return Number of processors detected
|
||||||
|
* @deprecated since CDT 9.0 - just use Runtime.getRuntime().availableProcessors()
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
static public int checkCPUNumber() {
|
static public int checkCPUNumber() {
|
||||||
if (procNumber > 0) return procNumber;
|
return Runtime.getRuntime().availableProcessors();
|
||||||
|
|
||||||
procNumber = 1;
|
|
||||||
int x = 0;
|
|
||||||
String os = System.getProperty("os.name"); //$NON-NLS-1$
|
|
||||||
if (os != null) {
|
|
||||||
if (os.startsWith("Win")) { //$NON-NLS-1$
|
|
||||||
IEnvironmentVariableProvider evp = ManagedBuildManager.getEnvironmentVariableProvider();
|
|
||||||
if (evp != null) {
|
|
||||||
IBuildEnvironmentVariable var = evp.getVariable("NUMBER_OF_PROCESSORS", null, false, false); //$NON-NLS-1$
|
|
||||||
if (var != null) {
|
|
||||||
try {
|
|
||||||
x = new Integer(var.getValue()).intValue();
|
|
||||||
if (x > 0) { procNumber = x; }
|
|
||||||
} catch (NumberFormatException e) {} // fallthrough and return default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else { // linux
|
|
||||||
String p = "/proc/cpuinfo"; //$NON-NLS-1$
|
|
||||||
try {
|
|
||||||
BufferedReader r = new BufferedReader(new InputStreamReader(new FileInputStream(p)));
|
|
||||||
String s;
|
|
||||||
while ((s = r.readLine() ) != null )
|
|
||||||
{ if (s.startsWith("processor\t:")) x++; } //$NON-NLS-1$
|
|
||||||
r.close();
|
|
||||||
if (x > 0) { procNumber = x; }
|
|
||||||
}
|
|
||||||
catch (IOException e) {} // fallthrough and return default
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(DbgUtil.DEBUG)
|
|
||||||
DbgUtil.trace("Number of processors detected: " + procNumber); //$NON-NLS-1$
|
|
||||||
return procNumber;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Intel Corporation and others.
|
* Copyright (c) 2006, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,6 +17,7 @@ import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildCommand;
|
||||||
|
@ -91,6 +92,7 @@ public class ParallelBuilder {
|
||||||
return step.hashCode();
|
return step.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compareTo(BuildQueueElement elem) {
|
public int compareTo(BuildQueueElement elem) {
|
||||||
if (elem == null)
|
if (elem == null)
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
|
@ -205,18 +207,16 @@ public class ParallelBuilder {
|
||||||
if(cwd == null) cwd = des.getDefaultBuildDirLocation();
|
if(cwd == null) cwd = des.getDefaultBuildDirLocation();
|
||||||
int threads = 1;
|
int threads = 1;
|
||||||
if (cfg instanceof Configuration) {
|
if (cfg instanceof Configuration) {
|
||||||
if (((Configuration)cfg).getParallelDef())
|
|
||||||
threads = BuildProcessManager.checkCPUNumber();
|
|
||||||
else
|
|
||||||
threads = ((Configuration)cfg).getParallelNumber();
|
threads = ((Configuration)cfg).getParallelNumber();
|
||||||
}
|
}
|
||||||
ParallelBuilder builder = new ParallelBuilder(cwd, dirs, out, err, monitor, resumeOnErrors, buildIncrementally);
|
ParallelBuilder builder = new ParallelBuilder(cwd, dirs, out, err, monitor, resumeOnErrors, buildIncrementally);
|
||||||
builder.enqueueAll(des);
|
builder.enqueueAll(des);
|
||||||
builder.sortQueue();
|
builder.sortQueue();
|
||||||
monitor.beginTask("", builder.queue.size()); //$NON-NLS-1$
|
monitor.beginTask("", builder.queue.size()); //$NON-NLS-1$
|
||||||
builder.dispatch(new BuildProcessManager(out, err, true, threads));
|
BuildProcessManager buildProcessManager = new BuildProcessManager(out, err, true, threads);
|
||||||
|
builder.dispatch(buildProcessManager);
|
||||||
|
lastThreadsUsed = buildProcessManager.getThreadsUsed();
|
||||||
monitor.done();
|
monitor.done();
|
||||||
lastThreadsUsed = threads;
|
|
||||||
return IBuildModelBuilder.STATUS_OK;
|
return IBuildModelBuilder.STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,10 +295,8 @@ public class ParallelBuilder {
|
||||||
* Dispatches the build queue and returns build status
|
* Dispatches the build queue and returns build status
|
||||||
*/
|
*/
|
||||||
protected int dispatch(BuildProcessManager mgr) {
|
protected int dispatch(BuildProcessManager mgr) {
|
||||||
ActiveBuildStep[] active = new ActiveBuildStep[mgr.getMaxProcesses()];
|
int maxProcesses = mgr.getMaxProcesses();
|
||||||
for (int i = 0; i < active.length; i++) {
|
Vector<ActiveBuildStep> active = new Vector<ActiveBuildStep>(Math.min(maxProcesses, 10), 10);
|
||||||
active[i] = null; // new ActiveBuildStep();
|
|
||||||
}
|
|
||||||
|
|
||||||
int activeCount = 0;
|
int activeCount = 0;
|
||||||
int maxLevel = 0;
|
int maxLevel = 0;
|
||||||
|
@ -332,9 +330,8 @@ public class ParallelBuilder {
|
||||||
proceed = false;
|
proceed = false;
|
||||||
} else {
|
} else {
|
||||||
// Check "active steps" list for completed ones
|
// Check "active steps" list for completed ones
|
||||||
for (int i = 0; i < active.length; i++) {
|
for (ActiveBuildStep buildStep : active) {
|
||||||
if (active[i] == null) continue;
|
ProcessLauncher pl = buildStep.getLauncher();
|
||||||
ProcessLauncher pl = active[i].getLauncher();
|
|
||||||
if (pl == null) continue;
|
if (pl == null) continue;
|
||||||
if (pl.queryState() == ProcessLauncher.STATE_DONE) {
|
if (pl.queryState() == ProcessLauncher.STATE_DONE) {
|
||||||
// If process has terminated with error, break loop
|
// If process has terminated with error, break loop
|
||||||
|
@ -345,8 +342,8 @@ public class ParallelBuilder {
|
||||||
break main_loop;
|
break main_loop;
|
||||||
}
|
}
|
||||||
// Try to launch next command for the current active step
|
// Try to launch next command for the current active step
|
||||||
if (active[i].isDone()) continue;
|
if (buildStep.isDone()) continue;
|
||||||
if (active[i].launchNextCmd(mgr)) {
|
if (buildStep.launchNextCmd(mgr)) {
|
||||||
// Command has been launched. Check if process pool is not maximized yet
|
// Command has been launched. Check if process pool is not maximized yet
|
||||||
if (!mgr.hasEmpty()) {
|
if (!mgr.hasEmpty()) {
|
||||||
proceed = false;
|
proceed = false;
|
||||||
|
@ -354,7 +351,7 @@ public class ParallelBuilder {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Command has not been launched: step complete
|
// Command has not been launched: step complete
|
||||||
refreshOutputs(active[i].getStep());
|
refreshOutputs(buildStep.getStep());
|
||||||
activeCount--;
|
activeCount--;
|
||||||
monitor.worked(1);
|
monitor.worked(1);
|
||||||
}
|
}
|
||||||
|
@ -373,7 +370,7 @@ public class ParallelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we need to schedule another process
|
// Check if we need to schedule another process
|
||||||
if (queue.size() != 0 && activeCount < active.length) {
|
if (queue.size() != 0 && activeCount < maxProcesses) {
|
||||||
// Need to schedule another process
|
// Need to schedule another process
|
||||||
Iterator<BuildQueueElement> iter = queue.iterator();
|
Iterator<BuildQueueElement> iter = queue.iterator();
|
||||||
|
|
||||||
|
@ -381,8 +378,8 @@ public class ParallelBuilder {
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
BuildQueueElement elem = iter.next();
|
BuildQueueElement elem = iter.next();
|
||||||
|
|
||||||
// If "active steps" list is full, then break loop
|
// If "active steps" list reaches maximum, then break loop
|
||||||
if (activeCount == active.length)
|
if (activeCount == maxProcesses)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// If current element's level exceeds maximum level of currently built
|
// If current element's level exceeds maximum level of currently built
|
||||||
|
@ -391,14 +388,13 @@ public class ParallelBuilder {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//Check if all prerequisites are built
|
//Check if all prerequisites are built
|
||||||
IBuildResource[] res = elem.getStep().getInputResources();
|
|
||||||
boolean prereqBuilt = true;
|
boolean prereqBuilt = true;
|
||||||
for (int j = 0; j < res.length; j++) {
|
for (IBuildResource bldRes : elem.getStep().getInputResources()) {
|
||||||
IBuildStep stp = res[j].getProducerStep(); // step which produces input for curr
|
IBuildStep step = bldRes.getProducerStep(); // step which produces input for curr
|
||||||
boolean built = true;
|
boolean built = true;
|
||||||
if (stp != stp.getBuildDescription().getInputStep()) {
|
if (step != step.getBuildDescription().getInputStep()) {
|
||||||
for (int k = 0; k < active.length; k++) {
|
for (ActiveBuildStep buildStep : active) {
|
||||||
if (active[k] != null && active[k].getStep().equals(stp) && !active[k].isDone()) {
|
if (buildStep != null && buildStep.getStep().equals(step) && !buildStep.isDone()) {
|
||||||
built = false;
|
built = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -417,10 +413,21 @@ public class ParallelBuilder {
|
||||||
// Remove element from the build queue and add it to the
|
// Remove element from the build queue and add it to the
|
||||||
// "active steps" list.
|
// "active steps" list.
|
||||||
iter.remove();
|
iter.remove();
|
||||||
for (int i = 0; i < active.length; i++) {
|
for (int i = 0; i < maxProcesses; i++) {
|
||||||
if (active[i] == null || active[i].isDone()) {
|
if (i >= active.size()) {
|
||||||
active[i] = new ActiveBuildStep(step);
|
// add new item
|
||||||
if (active[i].launchNextCmd(mgr)) activeCount++;
|
ActiveBuildStep buildStep = new ActiveBuildStep(step);
|
||||||
|
active.add(buildStep);
|
||||||
|
if (buildStep.launchNextCmd(mgr))
|
||||||
|
activeCount++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (active.get(i).isDone()) {
|
||||||
|
// replace old item
|
||||||
|
ActiveBuildStep buildStep = new ActiveBuildStep(step);
|
||||||
|
active.set(i, buildStep);
|
||||||
|
if (buildStep.launchNextCmd(mgr))
|
||||||
|
activeCount++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -753,7 +753,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
|
* E L E M E N T A T T R I B U T E R E A D E R S A N D W R I T E R S
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* Initialize the configuration information from an element in the
|
* Initialize the configuration information from an element in the
|
||||||
* manifest file or provided by a dynamicElementProvider
|
* manifest file or provided by a dynamicElementProvider
|
||||||
*
|
*
|
||||||
|
@ -807,7 +807,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
isTest = Boolean.valueOf(tmp).booleanValue();
|
isTest = Boolean.valueOf(tmp).booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* Initialize the configuration information from the XML element
|
* Initialize the configuration information from the XML element
|
||||||
* specified in the argument
|
* specified in the argument
|
||||||
*
|
*
|
||||||
|
@ -974,6 +974,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getParent()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getParent()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfiguration getParent() {
|
public IConfiguration getParent() {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
@ -981,6 +982,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getOwner()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getOwner()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResource getOwner() {
|
public IResource getOwner() {
|
||||||
if (managedProject != null)
|
if (managedProject != null)
|
||||||
return managedProject.getOwner();
|
return managedProject.getOwner();
|
||||||
|
@ -992,6 +994,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getProjectType()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getProjectType()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IProjectType getProjectType() {
|
public IProjectType getProjectType() {
|
||||||
return projectType;
|
return projectType;
|
||||||
}
|
}
|
||||||
|
@ -999,6 +1002,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getManagedProject()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getManagedProject()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IManagedProject getManagedProject() {
|
public IManagedProject getManagedProject() {
|
||||||
return managedProject;
|
return managedProject;
|
||||||
}
|
}
|
||||||
|
@ -1006,6 +1010,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getToolChain(IToolChain, String, String, boolean)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getToolChain(IToolChain, String, String, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement) {
|
public IToolChain createToolChain(IToolChain superClass, String Id, String name, boolean isExtensionElement) {
|
||||||
if(rootFolderInfo == null){
|
if(rootFolderInfo == null){
|
||||||
createRootFolderInfo();
|
createRootFolderInfo();
|
||||||
|
@ -1034,6 +1039,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getToolChain()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getToolChain()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IToolChain getToolChain() {
|
public IToolChain getToolChain() {
|
||||||
return rootFolderInfo.getToolChain();
|
return rootFolderInfo.getToolChain();
|
||||||
}
|
}
|
||||||
|
@ -1041,6 +1047,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getResourceConfigurations()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getResourceConfigurations()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration[] getResourceConfigurations() {
|
public IResourceConfiguration[] getResourceConfigurations() {
|
||||||
return (IResourceConfiguration[])rcInfos.getResourceInfos(ICSettingBase.SETTING_FILE, IResourceConfiguration.class);
|
return (IResourceConfiguration[])rcInfos.getResourceInfos(ICSettingBase.SETTING_FILE, IResourceConfiguration.class);
|
||||||
}
|
}
|
||||||
|
@ -1048,6 +1055,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfiguration(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfiguration(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration getResourceConfiguration(String resPath) {
|
public IResourceConfiguration getResourceConfiguration(String resPath) {
|
||||||
return rcInfos.getFileInfo(new Path(resPath).removeFirstSegments(1));
|
return rcInfos.getFileInfo(new Path(resPath).removeFirstSegments(1));
|
||||||
}
|
}
|
||||||
|
@ -1055,6 +1063,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getFilteredTools() {
|
public ITool[] getFilteredTools() {
|
||||||
return rootFolderInfo.getFilteredTools();
|
return rootFolderInfo.getFilteredTools();
|
||||||
}
|
}
|
||||||
|
@ -1062,6 +1071,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getTools()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getTools() {
|
public ITool[] getTools() {
|
||||||
return rootFolderInfo.getTools();
|
return rootFolderInfo.getTools();
|
||||||
}
|
}
|
||||||
|
@ -1069,6 +1079,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTool(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTool(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getTool(String id) {
|
public ITool getTool(String id) {
|
||||||
return rootFolderInfo.getTool(id);
|
return rootFolderInfo.getTool(id);
|
||||||
}
|
}
|
||||||
|
@ -1076,6 +1087,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getToolsBySuperClassId(String id) {
|
public ITool[] getToolsBySuperClassId(String id) {
|
||||||
return rootFolderInfo.getToolsBySuperClassId(id);
|
return rootFolderInfo.getToolsBySuperClassId(id);
|
||||||
}
|
}
|
||||||
|
@ -1083,6 +1095,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getTargetTool() {
|
public ITool getTargetTool() {
|
||||||
String[] targetToolIds = rootFolderInfo.getToolChain().getTargetToolList();
|
String[] targetToolIds = rootFolderInfo.getToolChain().getTargetToolList();
|
||||||
if (targetToolIds == null || targetToolIds.length == 0) return null;
|
if (targetToolIds == null || targetToolIds.length == 0) return null;
|
||||||
|
@ -1110,6 +1123,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getToolCommand(ITool tool) {
|
public String getToolCommand(ITool tool) {
|
||||||
// TODO: Do we need to verify that the tool is part of the configuration?
|
// TODO: Do we need to verify that the tool is part of the configuration?
|
||||||
return tool.getToolCommand();
|
return tool.getToolCommand();
|
||||||
|
@ -1118,6 +1132,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setToolCommand(ITool tool, String command) {
|
public void setToolCommand(ITool tool, String command) {
|
||||||
// TODO: Do we need to verify that the tool is part of the configuration?
|
// TODO: Do we need to verify that the tool is part of the configuration?
|
||||||
tool.setToolCommand(command);
|
tool.setToolCommand(command);
|
||||||
|
@ -1126,6 +1141,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, boolean)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions holder, IOption option, boolean value) throws BuildException {
|
public IOption setOption(IHoldsOptions holder, IOption option, boolean value) throws BuildException {
|
||||||
return getRootFolderInfo().setOption(holder, option, value);
|
return getRootFolderInfo().setOption(holder, option, value);
|
||||||
}
|
}
|
||||||
|
@ -1133,6 +1149,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions holder, IOption option, String value) throws BuildException {
|
public IOption setOption(IHoldsOptions holder, IOption option, String value) throws BuildException {
|
||||||
return getRootFolderInfo().setOption(holder, option, value);
|
return getRootFolderInfo().setOption(holder, option, value);
|
||||||
}
|
}
|
||||||
|
@ -1140,6 +1157,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String[])
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setOption(org.eclipse.cdt.core.build.managed.IOption, java.lang.String[])
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions holder, IOption option, String[] value) throws BuildException {
|
public IOption setOption(IHoldsOptions holder, IOption option, String[] value) throws BuildException {
|
||||||
return getRootFolderInfo().setOption(holder, option, value);
|
return getRootFolderInfo().setOption(holder, option, value);
|
||||||
}
|
}
|
||||||
|
@ -1157,6 +1175,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
// rebuildNeeded = true;
|
// rebuildNeeded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeResourceConfiguration(IResourceInfo resConfig) {
|
public void removeResourceConfiguration(IResourceInfo resConfig) {
|
||||||
ManagedBuildManager.performValueHandlerEvent(resConfig,
|
ManagedBuildManager.performValueHandlerEvent(resConfig,
|
||||||
IManagedOptionValueHandler.EVENT_CLOSE);
|
IManagedOptionValueHandler.EVENT_CLOSE);
|
||||||
|
@ -1182,6 +1201,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactExtension()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactExtension()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getArtifactExtension() {
|
public String getArtifactExtension() {
|
||||||
String ext = getArtifactExtensionAttribute(true);
|
String ext = getArtifactExtensionAttribute(true);
|
||||||
return ext != null ? ext : EMPTY_STRING;
|
return ext != null ? ext : EMPTY_STRING;
|
||||||
|
@ -1201,6 +1221,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getArtifactName()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getArtifactName()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getArtifactName() {
|
public String getArtifactName() {
|
||||||
if (artifactName == null) {
|
if (artifactName == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1218,6 +1239,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getBuildArguments()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getBuildArguments()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getBuildArguments() {
|
public String getBuildArguments() {
|
||||||
IToolChain tc = getToolChain();
|
IToolChain tc = getToolChain();
|
||||||
IBuilder builder = tc.getBuilder();
|
IBuilder builder = tc.getBuilder();
|
||||||
|
@ -1230,6 +1252,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getBuildCommand()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getBuildCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getBuildCommand() {
|
public String getBuildCommand() {
|
||||||
IToolChain tc = getToolChain();
|
IToolChain tc = getToolChain();
|
||||||
IBuilder builder = tc.getBuilder();
|
IBuilder builder = tc.getBuilder();
|
||||||
|
@ -1244,6 +1267,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPrebuildStep()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPrebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPrebuildStep() {
|
public String getPrebuildStep() {
|
||||||
if (prebuildStep == null) {
|
if (prebuildStep == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1263,6 +1287,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostbuildStep()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostbuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPostbuildStep() {
|
public String getPostbuildStep() {
|
||||||
if (postbuildStep == null) {
|
if (postbuildStep == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1282,6 +1307,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPreannouncebuildStep()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPreannouncebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPreannouncebuildStep() {
|
public String getPreannouncebuildStep() {
|
||||||
if (preannouncebuildStep == null) {
|
if (preannouncebuildStep == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1301,6 +1327,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostannouncebuildStep()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getPostannouncebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPostannouncebuildStep() {
|
public String getPostannouncebuildStep() {
|
||||||
if (postannouncebuildStep == null) {
|
if (postannouncebuildStep == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1320,6 +1347,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getCleanCommand()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getCleanCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getCleanCommand() {
|
public String getCleanCommand() {
|
||||||
// Return the command used to remove files
|
// Return the command used to remove files
|
||||||
if (cleanCommand == null) {
|
if (cleanCommand == null) {
|
||||||
|
@ -1342,6 +1370,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getDescription()
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
if (description == null) {
|
if (description == null) {
|
||||||
// If I have a parent, ask it
|
// If I have a parent, ask it
|
||||||
|
@ -1361,6 +1390,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getErrorParserIds() {
|
public String getErrorParserIds() {
|
||||||
if (errorParserIds != null) {
|
if (errorParserIds != null) {
|
||||||
return errorParserIds;
|
return errorParserIds;
|
||||||
|
@ -1396,6 +1426,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserList()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserList()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getErrorParserList() {
|
public String[] getErrorParserList() {
|
||||||
Set<String> set = contributeErrorParsers(null, true);
|
Set<String> set = contributeErrorParsers(null, true);
|
||||||
if(set != null){
|
if(set != null){
|
||||||
|
@ -1436,6 +1467,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setArtifactExtension(String extension) {
|
public void setArtifactExtension(String extension) {
|
||||||
if (extension == null && artifactExtension == null) return;
|
if (extension == null && artifactExtension == null) return;
|
||||||
if (artifactExtension == null || extension == null || !artifactExtension.equals(extension)) {
|
if (artifactExtension == null || extension == null || !artifactExtension.equals(extension)) {
|
||||||
|
@ -1457,6 +1489,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setArtifactName(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setArtifactName(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setArtifactName(String name) {
|
public void setArtifactName(String name) {
|
||||||
if (name == null && artifactName == null) return;
|
if (name == null && artifactName == null) return;
|
||||||
if (artifactName == null || name == null || !artifactName.equals(name)) {
|
if (artifactName == null || name == null || !artifactName.equals(name)) {
|
||||||
|
@ -1498,6 +1531,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserIds()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserIds()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setErrorParserIds(String ids) {
|
public void setErrorParserIds(String ids) {
|
||||||
String currentIds = getErrorParserIds();
|
String currentIds = getErrorParserIds();
|
||||||
if (ids == null && currentIds == null) return;
|
if (ids == null && currentIds == null) return;
|
||||||
|
@ -1510,6 +1544,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setCleanCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setCleanCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCleanCommand(String command) {
|
public void setCleanCommand(String command) {
|
||||||
if (command == null && cleanCommand == null) return;
|
if (command == null && cleanCommand == null) return;
|
||||||
if (cleanCommand == null || command == null || !cleanCommand.equals(command)) {
|
if (cleanCommand == null || command == null || !cleanCommand.equals(command)) {
|
||||||
|
@ -1521,6 +1556,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setDescription(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setDescription(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
if (description == null && this.description == null) return;
|
if (description == null && this.description == null) return;
|
||||||
if (this.description == null || description == null || !description.equals(this.description)) {
|
if (this.description == null || description == null || !description.equals(this.description)) {
|
||||||
|
@ -1532,6 +1568,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArguments()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArguments()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBuildArguments(String makeArgs) {
|
public void setBuildArguments(String makeArgs) {
|
||||||
IToolChain tc = getToolChain();
|
IToolChain tc = getToolChain();
|
||||||
IBuilder builder = tc.getBuilder();
|
IBuilder builder = tc.getBuilder();
|
||||||
|
@ -1554,6 +1591,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBuildCommand(String command) {
|
public void setBuildCommand(String command) {
|
||||||
IToolChain tc = getToolChain();
|
IToolChain tc = getToolChain();
|
||||||
IBuilder builder = tc.getBuilder();
|
IBuilder builder = tc.getBuilder();
|
||||||
|
@ -1576,6 +1614,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPrebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPrebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPrebuildStep(String step) {
|
public void setPrebuildStep(String step) {
|
||||||
if (step == null && prebuildStep == null) return;
|
if (step == null && prebuildStep == null) return;
|
||||||
if (prebuildStep == null || step == null || !prebuildStep.equals(step)) {
|
if (prebuildStep == null || step == null || !prebuildStep.equals(step)) {
|
||||||
|
@ -1589,6 +1628,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostbuildStep(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostbuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPostbuildStep(String step) {
|
public void setPostbuildStep(String step) {
|
||||||
if (step == null && postbuildStep == null) return;
|
if (step == null && postbuildStep == null) return;
|
||||||
if (postbuildStep == null || step == null || !postbuildStep.equals(step)) {
|
if (postbuildStep == null || step == null || !postbuildStep.equals(step)) {
|
||||||
|
@ -1601,6 +1641,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPreannouncebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPreannouncebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPreannouncebuildStep(String announceStep) {
|
public void setPreannouncebuildStep(String announceStep) {
|
||||||
if (announceStep == null && preannouncebuildStep == null) return;
|
if (announceStep == null && preannouncebuildStep == null) return;
|
||||||
if (preannouncebuildStep == null || announceStep == null || !preannouncebuildStep.equals(announceStep)) {
|
if (preannouncebuildStep == null || announceStep == null || !preannouncebuildStep.equals(announceStep)) {
|
||||||
|
@ -1613,6 +1654,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostannouncebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.core.build.managed.IConfiguration#setPostannouncebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPostannouncebuildStep(String announceStep) {
|
public void setPostannouncebuildStep(String announceStep) {
|
||||||
if (announceStep == null && postannouncebuildStep == null) return;
|
if (announceStep == null && postannouncebuildStep == null) return;
|
||||||
if (postannouncebuildStep == null || announceStep == null || !postannouncebuildStep.equals(announceStep)) {
|
if (postannouncebuildStep == null || announceStep == null || !postannouncebuildStep.equals(announceStep)) {
|
||||||
|
@ -1625,6 +1667,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSupported()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSupported()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isSupported(){
|
public boolean isSupported(){
|
||||||
IFolderInfo foInfo = getRootFolderInfo();
|
IFolderInfo foInfo = getRootFolderInfo();
|
||||||
if(foInfo != null)
|
if(foInfo != null)
|
||||||
|
@ -1635,6 +1678,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isHeaderFile(String ext) {
|
public boolean isHeaderFile(String ext) {
|
||||||
return getRootFolderInfo().isHeaderFile(ext);
|
return getRootFolderInfo().isHeaderFile(ext);
|
||||||
}
|
}
|
||||||
|
@ -1646,6 +1690,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isExtensionElement() {
|
public boolean isExtensionElement() {
|
||||||
return isExtensionConfig;
|
return isExtensionConfig;
|
||||||
}
|
}
|
||||||
|
@ -1653,6 +1698,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isDirty()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isDirty()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
// This shouldn't be called for an extension configuration
|
// This shouldn't be called for an extension configuration
|
||||||
if (isExtensionConfig) return false;
|
if (isExtensionConfig) return false;
|
||||||
|
@ -1673,10 +1719,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsRebuild()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsRebuild()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean needsRebuild() {
|
public boolean needsRebuild() {
|
||||||
return needsRebuild(true);
|
return needsRebuild(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean needsFullRebuild() {
|
public boolean needsFullRebuild() {
|
||||||
return needsRebuild(false);
|
return needsRebuild(false);
|
||||||
}
|
}
|
||||||
|
@ -1700,6 +1748,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setDirty(boolean isDirty) {
|
public void setDirty(boolean isDirty) {
|
||||||
// Override the dirty flag
|
// Override the dirty flag
|
||||||
this.isDirty = isDirty;
|
this.isDirty = isDirty;
|
||||||
|
@ -1716,6 +1765,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setRebuildState(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setRebuildState(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setRebuildState(boolean rebuild) {
|
public void setRebuildState(boolean rebuild) {
|
||||||
if(isExtensionElement() && rebuild)
|
if(isExtensionElement() && rebuild)
|
||||||
return;
|
return;
|
||||||
|
@ -1739,6 +1789,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#hasOverriddenBuildCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#hasOverriddenBuildCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasOverriddenBuildCommand() {
|
public boolean hasOverriddenBuildCommand() {
|
||||||
IBuilder builder = getToolChain().getBuilder();
|
IBuilder builder = getToolChain().getBuilder();
|
||||||
if (builder != null) {
|
if (builder != null) {
|
||||||
|
@ -1793,21 +1844,24 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
((FolderInfo)getRootFolderInfo()).resetOptionSettings();
|
((FolderInfo)getRootFolderInfo()).resetOptionSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Create a resource configuration object for the passed-in file
|
* Create a resource configuration object for the passed-in file
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration createResourceConfiguration(IFile file)
|
public IResourceConfiguration createResourceConfiguration(IFile file)
|
||||||
{
|
{
|
||||||
return createFileInfo(file.getFullPath().removeFirstSegments(1));
|
return createFileInfo(file.getFullPath().removeFirstSegments(1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path){
|
public IFileInfo createFileInfo(IPath path){
|
||||||
String resourceName = path.lastSegment();
|
String resourceName = path.lastSegment();
|
||||||
String id = ManagedBuildManager.calculateChildId(getId(), path.toString());
|
String id = ManagedBuildManager.calculateChildId(getId(), path.toString());
|
||||||
return createFileInfo(path, id, resourceName);
|
return createFileInfo(path, id, resourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, String id, String name){
|
public IFileInfo createFileInfo(IPath path, String id, String name){
|
||||||
IResourceInfo info = getResourceInfo(path, false);
|
IResourceInfo info = getResourceInfo(path, false);
|
||||||
IFileInfo fileInfo = null;
|
IFileInfo fileInfo = null;
|
||||||
|
@ -1820,6 +1874,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return fileInfo;
|
return fileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name){
|
public IFileInfo createFileInfo(IPath path, IFolderInfo base, ITool baseTool, String id, String name){
|
||||||
if(base.getPath().equals(path))
|
if(base.getPath().equals(path))
|
||||||
return null;
|
return null;
|
||||||
|
@ -1831,6 +1886,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return fileInfo;
|
return fileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name){
|
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name){
|
||||||
if(base.getPath().equals(path))
|
if(base.getPath().equals(path))
|
||||||
return null;
|
return null;
|
||||||
|
@ -1845,6 +1901,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEnvironmentVariableSupplier()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEnvironmentVariableSupplier()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
|
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier(){
|
||||||
IToolChain toolChain = getToolChain();
|
IToolChain toolChain = getToolChain();
|
||||||
if(toolChain != null)
|
if(toolChain != null)
|
||||||
|
@ -1873,6 +1930,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier(){
|
public IConfigurationBuildMacroSupplier getBuildMacroSupplier(){
|
||||||
IToolChain toolChain = getToolChain();
|
IToolChain toolChain = getToolChain();
|
||||||
if(toolChain != null)
|
if(toolChain != null)
|
||||||
|
@ -1884,6 +1942,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isTemporary()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isTemporary()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTemporary(){
|
public boolean isTemporary(){
|
||||||
return isTemporary;
|
return isTemporary;
|
||||||
}
|
}
|
||||||
|
@ -1910,6 +1969,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ITool calculateTargetTool(){
|
public ITool calculateTargetTool(){
|
||||||
ITool tool = getTargetTool();
|
ITool tool = getTargetTool();
|
||||||
|
|
||||||
|
@ -1932,15 +1992,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ITool getToolFromOutputExtension(String extension) {
|
public ITool getToolFromOutputExtension(String extension) {
|
||||||
return getRootFolderInfo().getToolFromOutputExtension(extension);
|
return getRootFolderInfo().getToolFromOutputExtension(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ITool getToolFromInputExtension(String sourceExtension) {
|
public ITool getToolFromInputExtension(String sourceExtension) {
|
||||||
return getRootFolderInfo().getToolFromInputExtension(sourceExtension);
|
return getRootFolderInfo().getToolFromInputExtension(sourceExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* The resource delta passed to the builder is not always up-to-date
|
* The resource delta passed to the builder is not always up-to-date
|
||||||
* for the given configuration because between two builds of the same configuration
|
* for the given configuration because between two builds of the same configuration
|
||||||
* any number of other configuration builds may occur
|
* any number of other configuration builds may occur
|
||||||
|
@ -2012,7 +2074,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
prefs.getBoolean(pref, false) : defaultValue;
|
prefs.getBoolean(pref, false) : defaultValue;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/*
|
/**
|
||||||
* this method is used for enabling/disabling the internal builder
|
* this method is used for enabling/disabling the internal builder
|
||||||
* for the given configuration
|
* for the given configuration
|
||||||
*
|
*
|
||||||
|
@ -2129,7 +2191,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* returns whether the internal builder is enabled
|
* returns whether the internal builder is enabled
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
|
@ -2137,7 +2199,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return getBuilder().isInternalBuilder();
|
return getBuilder().isInternalBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
*
|
||||||
* sets the Internal Builder mode
|
* sets the Internal Builder mode
|
||||||
*
|
*
|
||||||
|
@ -2152,7 +2214,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* returns the Internal Builder mode
|
* returns the Internal Builder mode
|
||||||
* if true, internal builder will ignore build errors while building,
|
* if true, internal builder will ignore build errors while building,
|
||||||
* otherwise it will stop at the first build error
|
* otherwise it will stop at the first build error
|
||||||
|
@ -2164,73 +2226,73 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* sets the Internal Builder Parallel mode
|
* sets the Internal Builder Parallel mode
|
||||||
*
|
|
||||||
* @param parallel if true, internal builder will use parallel mode
|
* @param parallel if true, internal builder will use parallel mode
|
||||||
|
*
|
||||||
|
* @deprecated since CDT 9.0. Use {@link #setParallelDef(boolean)}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public void setInternalBuilderParallel(boolean parallel){
|
public void setInternalBuilderParallel(boolean parallel){
|
||||||
if(getInternalBuilderParallel() == parallel)
|
setParallelDef(parallel);
|
||||||
return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
getEditableBuilder().setParallelBuildOn(parallel);
|
|
||||||
} catch (CoreException e) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the Internal Builder parallel mode
|
* returns the Internal Builder parallel mode
|
||||||
* if true, internal builder will work in parallel mode
|
* if true, internal builder will work in parallel mode
|
||||||
* otherwise it will use only one thread
|
* otherwise it will use only one thread
|
||||||
*
|
|
||||||
* @return boolean
|
* @return boolean
|
||||||
|
*
|
||||||
|
* @deprecated since CDT 9.0. Use {@link #getParallelDef()}
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public boolean getInternalBuilderParallel(){
|
public boolean getInternalBuilderParallel(){
|
||||||
return getBuilder().isParallelBuildOn();
|
return getParallelDef();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parallel if true, internal builder will use parallel mode
|
* Set parallel execution mode for the configuration's builder.
|
||||||
|
* @see Builder#setParallelBuildOn(boolean)
|
||||||
|
*
|
||||||
|
* @param parallel - the flag to enable or disable parallel mode.
|
||||||
*/
|
*/
|
||||||
public void setParallelDef(boolean parallel){
|
public void setParallelDef(boolean parallel){
|
||||||
if(getParallelDef() == parallel)
|
if(getParallelDef() == parallel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int num = getParallelNumber();
|
try {
|
||||||
if(num != 0){
|
getEditableBuilder().setParallelBuildOn(parallel);
|
||||||
setParallelNumber(-num);
|
} catch (CoreException e) {
|
||||||
} else {
|
ManagedBuilderCorePlugin.log(e);
|
||||||
if(parallel){
|
|
||||||
setParallelNumber(-1);
|
|
||||||
} else {
|
|
||||||
setParallelNumber(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return boolean
|
* Check if the configuration's builder is operating in parallel mode.
|
||||||
|
* @return {@code true} if parallel mode is enabled, {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean getParallelDef(){
|
public boolean getParallelDef(){
|
||||||
int num = getBuilder().getParallelizationNum();
|
return getBuilder().isParallelBuildOn();
|
||||||
return num <= 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets number of Parallel threads
|
* Sets maximum number of parallel threads/jobs to be used by builder.
|
||||||
*/
|
|
||||||
public void setParallelNumber(int n){
|
|
||||||
try {
|
|
||||||
getEditableBuilder().setParallelizationNum(n);
|
|
||||||
} catch (CoreException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* returns number of Parallel threads
|
|
||||||
*
|
*
|
||||||
* @return int
|
* @param jobs - maximum number of jobs or threads. For details how
|
||||||
|
* the number is interpreted see {@link Builder#setParallelizationNum(int)}.
|
||||||
|
*/
|
||||||
|
public void setParallelNumber(int jobs){
|
||||||
|
try {
|
||||||
|
getEditableBuilder().setParallelizationNum(jobs);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
ManagedBuilderCorePlugin.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns maximum number of parallel threads/jobs used by the configuration's builder.
|
||||||
|
* @see #setParallelDef(boolean)
|
||||||
|
*
|
||||||
|
* @return - maximum number of parallel threads or jobs used by the builder.
|
||||||
*/
|
*/
|
||||||
public int getParallelNumber(){
|
public int getParallelNumber(){
|
||||||
return getBuilder().getParallelizationNum();
|
return getBuilder().getParallelizationNum();
|
||||||
|
@ -2254,14 +2316,17 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
// return prefs;
|
// return prefs;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@Override
|
||||||
public IResourceInfo[] getResourceInfos() {
|
public IResourceInfo[] getResourceInfos() {
|
||||||
return rcInfos.getResourceInfos();
|
return rcInfos.getResourceInfos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
|
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
|
||||||
return rcInfos.getResourceInfo(path, exactPath);
|
return rcInfos.getResourceInfo(path, exactPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IResourceInfo getResourceInfoById(String id) {
|
public IResourceInfo getResourceInfoById(String id) {
|
||||||
IResourceInfo infos[] = rcInfos.getResourceInfos();
|
IResourceInfo infos[] = rcInfos.getResourceInfos();
|
||||||
for(int i = 0; i < infos.length; i++){
|
for(int i = 0; i < infos.length; i++){
|
||||||
|
@ -2271,6 +2336,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFolderInfo getRootFolderInfo() {
|
public IFolderInfo getRootFolderInfo() {
|
||||||
return rootFolderInfo;
|
return rootFolderInfo;
|
||||||
}
|
}
|
||||||
|
@ -2280,22 +2346,26 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return new ResourceInfoContainer(cr, false);
|
return new ResourceInfoContainer(cr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CConfigurationData getConfigurationData(){
|
public CConfigurationData getConfigurationData(){
|
||||||
return fCfgData;
|
return fCfgData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeResourceInfo(IPath path) {
|
public void removeResourceInfo(IPath path) {
|
||||||
IResourceInfo info = getResourceInfo(path, true);
|
IResourceInfo info = getResourceInfo(path, true);
|
||||||
if(info != null)
|
if(info != null)
|
||||||
removeResourceConfiguration(info);
|
removeResourceConfiguration(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path) {
|
public IFolderInfo createFolderInfo(IPath path) {
|
||||||
String resourceName = path.lastSegment();
|
String resourceName = path.lastSegment();
|
||||||
String id = ManagedBuildManager.calculateChildId(getId(), path.toString());
|
String id = ManagedBuildManager.calculateChildId(getId(), path.toString());
|
||||||
return createFolderInfo(path, id, resourceName);
|
return createFolderInfo(path, id, resourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
|
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
|
||||||
IResourceInfo info = getResourceInfo(path, false);
|
IResourceInfo info = getResourceInfo(path, false);
|
||||||
IFolderInfo folderInfo = null;
|
IFolderInfo folderInfo = null;
|
||||||
|
@ -2308,6 +2378,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return folderInfo;
|
return folderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
|
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
|
||||||
if(base.getPath().equals(path))
|
if(base.getPath().equals(path))
|
||||||
return null;
|
return null;
|
||||||
|
@ -2320,6 +2391,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return folderInfo;
|
return folderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public ICSourceEntry[] getSourceEntries() {
|
public ICSourceEntry[] getSourceEntries() {
|
||||||
if(sourceEntries == null || sourceEntries.length == 0){
|
if(sourceEntries == null || sourceEntries.length == 0){
|
||||||
if(parent != null && sourceEntries == null)
|
if(parent != null && sourceEntries == null)
|
||||||
|
@ -2330,6 +2402,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return sourceEntries.clone();
|
return sourceEntries.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setSourceEntries(ICSourceEntry[] entries) {
|
public void setSourceEntries(ICSourceEntry[] entries) {
|
||||||
setSourceEntries(entries, true);
|
setSourceEntries(entries, true);
|
||||||
}
|
}
|
||||||
|
@ -2363,6 +2436,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setErrorParserList(String[] ids) {
|
public void setErrorParserList(String[] ids) {
|
||||||
if(ids == null){
|
if(ids == null){
|
||||||
//reset
|
//reset
|
||||||
|
@ -2402,10 +2476,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public CBuildData getBuildData() {
|
public CBuildData getBuildData() {
|
||||||
return getEditableBuilder().getBuildData();
|
return getEditableBuilder().getBuildData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBuilder getEditableBuilder(){
|
public IBuilder getEditableBuilder(){
|
||||||
IToolChain tc = getToolChain();
|
IToolChain tc = getToolChain();
|
||||||
IBuilder builder = tc.getBuilder();
|
IBuilder builder = tc.getBuilder();
|
||||||
|
@ -2417,10 +2493,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBuilder getBuilder(){
|
public IBuilder getBuilder(){
|
||||||
return getToolChain().getBuilder();
|
return getToolChain().getBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getOutputPrefix(String outputExtension) {
|
public String getOutputPrefix(String outputExtension) {
|
||||||
// Treat null extensions as empty string
|
// Treat null extensions as empty string
|
||||||
String ext = outputExtension == null ? new String() : outputExtension;
|
String ext = outputExtension == null ? new String() : outputExtension;
|
||||||
|
@ -2445,6 +2523,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
fCfgDes = cfgDes;
|
fCfgDes = cfgDes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBuildObjectProperties getBuildProperties() {
|
public IBuildObjectProperties getBuildProperties() {
|
||||||
if(buildProperties == null){
|
if(buildProperties == null){
|
||||||
BuildObjectProperties parentProps = findBuildProperties();
|
BuildObjectProperties parentProps = findBuildProperties();
|
||||||
|
@ -2475,6 +2554,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return supportsValue(type.getId(), value.getId());
|
return supportsValue(type.getId(), value.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void propertiesChanged() {
|
public void propertiesChanged() {
|
||||||
if(isExtensionConfig)
|
if(isExtensionConfig)
|
||||||
return;
|
return;
|
||||||
|
@ -2498,6 +2578,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return booleanExpressionCalculator;
|
return booleanExpressionCalculator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isSystemObject() {
|
public boolean isSystemObject() {
|
||||||
if(isTest)
|
if(isTest)
|
||||||
return true;
|
return true;
|
||||||
|
@ -2508,10 +2589,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getOutputExtension(String resourceExtension) {
|
public String getOutputExtension(String resourceExtension) {
|
||||||
return getRootFolderInfo().getOutputExtension(resourceExtension);
|
return getRootFolderInfo().getOutputExtension(resourceExtension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getOutputFlag(String outputExt) {
|
public String getOutputFlag(String outputExt) {
|
||||||
// Treat null extension as an empty string
|
// Treat null extension as an empty string
|
||||||
String ext = outputExt == null ? new String() : outputExt;
|
String ext = outputExt == null ? new String() : outputExt;
|
||||||
|
@ -2529,6 +2612,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
public IManagedCommandLineInfo generateToolCommandLineInfo( String sourceExtension, String[] flags,
|
||||||
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
|
String outputFlag, String outputPrefix, String outputName, String[] inputResources, IPath inputLocation, IPath outputLocation ){
|
||||||
ITool[] tools = getFilteredTools();
|
ITool[] tools = getFilteredTools();
|
||||||
|
@ -2581,6 +2665,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getUserObjects(String extension) {
|
public String[] getUserObjects(String extension) {
|
||||||
Vector<String> objs = new Vector<String>();
|
Vector<String> objs = new Vector<String>();
|
||||||
ITool tool = calculateTargetTool();
|
ITool tool = calculateTargetTool();
|
||||||
|
@ -2622,6 +2707,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return objs.toArray(new String[objs.size()]);
|
return objs.toArray(new String[objs.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getLibs(String extension) {
|
public String[] getLibs(String extension) {
|
||||||
Vector<String> libs = new Vector<String>();
|
Vector<String> libs = new Vector<String>();
|
||||||
ITool tool = calculateTargetTool();
|
ITool tool = calculateTargetTool();
|
||||||
|
@ -2676,6 +2762,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return libs.toArray(new String[libs.size()]);
|
return libs.toArray(new String[libs.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean buildsFileType(String srcExt) {
|
public boolean buildsFileType(String srcExt) {
|
||||||
return getRootFolderInfo().buildsFileType(srcExt);
|
return getRootFolderInfo().buildsFileType(srcExt);
|
||||||
}
|
}
|
||||||
|
@ -2743,6 +2830,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean supportsBuild(boolean managed) {
|
public boolean supportsBuild(boolean managed) {
|
||||||
return supportsBuild(managed, true);
|
return supportsBuild(managed, true);
|
||||||
}
|
}
|
||||||
|
@ -2763,6 +2851,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean supportsType(String typeId) {
|
public boolean supportsType(String typeId) {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
boolean supports = false;
|
boolean supports = false;
|
||||||
|
@ -2776,6 +2865,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return supports;
|
return supports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean supportsValue(String typeId, String valueId) {
|
public boolean supportsValue(String typeId, String valueId) {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
boolean supports = false;
|
boolean supports = false;
|
||||||
|
@ -2802,6 +2892,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
supportedProperties = new SupportedProperties(el);
|
supportedProperties = new SupportedProperties(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getRequiredTypeIds() {
|
public String[] getRequiredTypeIds() {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
|
@ -2814,6 +2905,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return list.toArray(new String[list.size()]);
|
return list.toArray(new String[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getSupportedTypeIds() {
|
public String[] getSupportedTypeIds() {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
|
@ -2826,6 +2918,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return list.toArray(new String[list.size()]);
|
return list.toArray(new String[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String[] getSupportedValueIds(String typeId) {
|
public String[] getSupportedValueIds(String typeId) {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
List<String> list = new ArrayList<String>();
|
List<String> list = new ArrayList<String>();
|
||||||
|
@ -2838,6 +2931,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return list.toArray(new String[list.size()]);
|
return list.toArray(new String[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean requiresType(String typeId) {
|
public boolean requiresType(String typeId) {
|
||||||
SupportedProperties props = findSupportedProperties();
|
SupportedProperties props = findSupportedProperties();
|
||||||
boolean requires = false;
|
boolean requires = false;
|
||||||
|
@ -2851,10 +2945,12 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return requires;
|
return requires;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isManagedBuildOn() {
|
public boolean isManagedBuildOn() {
|
||||||
return getBuilder().isManagedBuildOn();
|
return getBuilder().isManagedBuildOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setManagedBuildOn(boolean on) throws BuildException {
|
public void setManagedBuildOn(boolean on) throws BuildException {
|
||||||
try {
|
try {
|
||||||
getEditableBuilder().setManagedBuildOn(on);
|
getEditableBuilder().setManagedBuildOn(on);
|
||||||
|
@ -2863,6 +2959,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void changeBuilder(IBuilder newBuilder, String id, String name){
|
public void changeBuilder(IBuilder newBuilder, String id, String name){
|
||||||
changeBuilder(newBuilder, id, name, false);
|
changeBuilder(newBuilder, id, name, false);
|
||||||
}
|
}
|
||||||
|
@ -2892,6 +2989,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isBuilderCompatible(IBuilder builder){
|
public boolean isBuilderCompatible(IBuilder builder){
|
||||||
return builder.supportsBuild(isManagedBuildOn());
|
return builder.supportsBuild(isManagedBuildOn());
|
||||||
}
|
}
|
||||||
|
@ -2972,6 +3070,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return isPreferenceConfig;
|
return isPreferenceConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBuildPropertyValue getBuildArtefactType() {
|
public IBuildPropertyValue getBuildArtefactType() {
|
||||||
IBuildObjectProperties props = findBuildProperties();
|
IBuildObjectProperties props = findBuildProperties();
|
||||||
if(props != null){
|
if(props != null){
|
||||||
|
@ -2982,6 +3081,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setBuildArtefactType(String id) throws BuildException {
|
public void setBuildArtefactType(String id) throws BuildException {
|
||||||
IBuildObjectProperties props = getBuildProperties();
|
IBuildObjectProperties props = getBuildProperties();
|
||||||
try {
|
try {
|
||||||
|
@ -3034,34 +3134,42 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IRealBuildObjectAssociation getExtensionObject() {
|
public IRealBuildObjectAssociation getExtensionObject() {
|
||||||
return isExtensionConfig ? this : (Configuration)getParent();
|
return isExtensionConfig ? this : (Configuration)getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
|
public IRealBuildObjectAssociation[] getIdenticBuildObjects() {
|
||||||
return new Configuration[]{(Configuration)getExtensionObject()};
|
return new Configuration[]{(Configuration)getExtensionObject()};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IRealBuildObjectAssociation getRealBuildObject() {
|
public IRealBuildObjectAssociation getRealBuildObject() {
|
||||||
return getExtensionObject();
|
return getExtensionObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IRealBuildObjectAssociation getSuperClassObject() {
|
public IRealBuildObjectAssociation getSuperClassObject() {
|
||||||
return (IRealBuildObjectAssociation)getParent();
|
return (IRealBuildObjectAssociation)getParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return OBJECT_CONFIGURATION;
|
return OBJECT_CONFIGURATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isRealBuildObject() {
|
public boolean isRealBuildObject() {
|
||||||
return getRealBuildObject() == this;
|
return getRealBuildObject() == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getUniqueRealName() {
|
public String getUniqueRealName() {
|
||||||
return getName();
|
return getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isExtensionBuildObject() {
|
public boolean isExtensionBuildObject() {
|
||||||
return isExtensionElement();
|
return isExtensionElement();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2010 IBM Corporation and others.
|
* Copyright (c) 2002, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -151,6 +151,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
return fullBuildNeeded;
|
return fullBuildNeeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(IResourceDelta delta) throws CoreException {
|
public boolean visit(IResourceDelta delta) throws CoreException {
|
||||||
IResource resource = delta.getResource();
|
IResource resource = delta.getResource();
|
||||||
// If the project has changed, then a build is needed and we can stop
|
// If the project has changed, then a build is needed and we can stop
|
||||||
|
@ -231,6 +232,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(IResourceDelta delta) throws CoreException {
|
public boolean visit(IResourceDelta delta) throws CoreException {
|
||||||
|
|
||||||
IResource rc = delta.getResource();
|
IResource rc = delta.getResource();
|
||||||
|
@ -906,7 +908,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
IPath makeCommand = new Path(makeCmd);
|
IPath makeCommand = new Path(makeCmd);
|
||||||
if (makeCommand != null) {
|
|
||||||
String[] msgs = new String[2];
|
String[] msgs = new String[2];
|
||||||
msgs[0] = makeCommand.toString();
|
msgs[0] = makeCommand.toString();
|
||||||
msgs[1] = currentProject.getName();
|
msgs[1] = currentProject.getName();
|
||||||
|
@ -1144,7 +1145,6 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
addBuilderMarkers(epm);
|
addBuilderMarkers(epm);
|
||||||
consoleOutStream.close();
|
consoleOutStream.close();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
forgetLastBuiltState();
|
forgetLastBuiltState();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -1196,7 +1196,7 @@ public class GeneratedMakefileBuilder extends ACBuilder {
|
||||||
boolean resumeOnErr,
|
boolean resumeOnErr,
|
||||||
IProgressMonitor monitor) {
|
IProgressMonitor monitor) {
|
||||||
|
|
||||||
boolean isParallel = ((Configuration)cfg).getInternalBuilderParallel();
|
boolean isParallel = ((Configuration)cfg).getParallelDef();
|
||||||
|
|
||||||
// Get the project and make sure there's a monitor to cancel the build
|
// Get the project and make sure there's a monitor to cancel the build
|
||||||
IProject currentProject = cfg.getOwner().getProject();
|
IProject currentProject = cfg.getOwner().getProject();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
* Copyright (c) 2007, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -44,6 +44,7 @@ import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSu
|
||||||
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
import org.eclipse.cdt.managedbuilder.macros.IConfigurationBuildMacroSupplier;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
import org.eclipse.core.runtime.Assert;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.osgi.framework.Version;
|
import org.osgi.framework.Version;
|
||||||
|
@ -91,6 +92,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#buildsFileType(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#buildsFileType(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean buildsFileType(String srcExt) {
|
public boolean buildsFileType(String srcExt) {
|
||||||
return curr().buildsFileType(srcExt);
|
return curr().buildsFileType(srcExt);
|
||||||
}
|
}
|
||||||
|
@ -98,6 +100,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#calculateTargetTool()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#calculateTargetTool()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool calculateTargetTool() {
|
public ITool calculateTargetTool() {
|
||||||
return curr().calculateTargetTool();
|
return curr().calculateTargetTool();
|
||||||
}
|
}
|
||||||
|
@ -105,6 +108,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#changeBuilder(org.eclipse.cdt.managedbuilder.core.IBuilder, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#changeBuilder(org.eclipse.cdt.managedbuilder.core.IBuilder, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void changeBuilder(IBuilder newBuilder, String id, String name) {
|
public void changeBuilder(IBuilder newBuilder, String id, String name) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].changeBuilder(newBuilder, id, name);
|
fCfgs[i].changeBuilder(newBuilder, id, name);
|
||||||
|
@ -113,6 +117,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path) {
|
public IFileInfo createFileInfo(IPath path) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.createFileInfo(1)"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.createFileInfo(1)"); //$NON-NLS-1$
|
||||||
|
@ -122,6 +127,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, String id, String name) {
|
public IFileInfo createFileInfo(IPath path, String id, String name) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.createFileInfo(3)"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.createFileInfo(3)"); //$NON-NLS-1$
|
||||||
|
@ -131,6 +137,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFolderInfo, org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFolderInfo, org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, IFolderInfo base,
|
public IFileInfo createFileInfo(IPath path, IFolderInfo base,
|
||||||
ITool baseTool, String id, String name) {
|
ITool baseTool, String id, String name) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
|
@ -141,6 +148,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFileInfo, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFileInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFileInfo, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name) {
|
public IFileInfo createFileInfo(IPath path, IFileInfo base, String id, String name) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(4)"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.createFileInfo(4)"); //$NON-NLS-1$
|
||||||
|
@ -150,6 +158,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path) {
|
public IFolderInfo createFolderInfo(IPath path) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo()"); //$NON-NLS-1$
|
||||||
|
@ -159,6 +168,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
|
public IFolderInfo createFolderInfo(IPath path, String id, String name) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(3)"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(3)"); //$NON-NLS-1$
|
||||||
|
@ -168,6 +178,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFolderInfo, java.lang.String, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createFolderInfo(org.eclipse.core.runtime.IPath, org.eclipse.cdt.managedbuilder.core.IFolderInfo, java.lang.String, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
|
public IFolderInfo createFolderInfo(IPath path, IFolderInfo base, String id, String name) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(4)"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.createFolderInfo(4)"); //$NON-NLS-1$
|
||||||
|
@ -177,6 +188,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createResourceConfiguration(org.eclipse.core.resources.IFile)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createResourceConfiguration(org.eclipse.core.resources.IFile)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration createResourceConfiguration(IFile file) {
|
public IResourceConfiguration createResourceConfiguration(IFile file) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.createResourceConfiguration()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.createResourceConfiguration()"); //$NON-NLS-1$
|
||||||
|
@ -186,6 +198,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createToolChain(org.eclipse.cdt.managedbuilder.core.IToolChain, java.lang.String, java.lang.String, boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#createToolChain(org.eclipse.cdt.managedbuilder.core.IToolChain, java.lang.String, java.lang.String, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IToolChain createToolChain(IToolChain superClass, String Id,
|
public IToolChain createToolChain(IToolChain superClass, String Id,
|
||||||
String name, boolean isExtensionElement) {
|
String name, boolean isExtensionElement) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
|
@ -196,6 +209,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#generateToolCommandLineInfo(java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[], org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#generateToolCommandLineInfo(java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String, java.lang.String[], org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IManagedCommandLineInfo generateToolCommandLineInfo(
|
public IManagedCommandLineInfo generateToolCommandLineInfo(
|
||||||
String sourceExtension,
|
String sourceExtension,
|
||||||
String[] flags,
|
String[] flags,
|
||||||
|
@ -221,6 +235,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactExtension()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactExtension()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getArtifactExtension() {
|
public String getArtifactExtension() {
|
||||||
String s = fCfgs[0].getArtifactExtension();
|
String s = fCfgs[0].getArtifactExtension();
|
||||||
for (int i=1; i<fCfgs.length; i++)
|
for (int i=1; i<fCfgs.length; i++)
|
||||||
|
@ -239,6 +254,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactName()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getArtifactName()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getArtifactName() {
|
public String getArtifactName() {
|
||||||
String s = fCfgs[0].getArtifactName();
|
String s = fCfgs[0].getArtifactName();
|
||||||
for (int i=1; i<fCfgs.length; i++)
|
for (int i=1; i<fCfgs.length; i++)
|
||||||
|
@ -253,20 +269,30 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildArguments()
|
* @return build arguments if the arguments for all configurations match
|
||||||
|
* or {@code null} otherwise.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getBuildArguments() {
|
public String getBuildArguments() {
|
||||||
String s = fCfgs[0].getBuildArguments();
|
String args0 = fCfgs[0].getBuildArguments();
|
||||||
for (int i=1; i<fCfgs.length; i++)
|
if (args0 == null)
|
||||||
if (! s.equals(fCfgs[i].getBuildArguments()))
|
args0 = EMPTY_STR;
|
||||||
return EMPTY_STR;
|
|
||||||
return s;
|
for (IConfiguration cfg : fCfgs) {
|
||||||
|
String args = cfg.getBuildArguments();
|
||||||
|
if (args == null)
|
||||||
|
args = EMPTY_STR;
|
||||||
|
if (!args0.equals(args))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return args0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildArtefactType()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildArtefactType()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IBuildPropertyValue getBuildArtefactType() {
|
public IBuildPropertyValue getBuildArtefactType() {
|
||||||
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
|
IBuildPropertyValue b = fCfgs[0].getBuildArtefactType();
|
||||||
if (b == null)
|
if (b == null)
|
||||||
|
@ -280,6 +306,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getBuildCommand() {
|
public String getBuildCommand() {
|
||||||
String s = fCfgs[0].getBuildCommand();
|
String s = fCfgs[0].getBuildCommand();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -293,6 +320,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildData()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildData()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public CBuildData getBuildData() {
|
public CBuildData getBuildData() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getBuildData()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getBuildData()"); //$NON-NLS-1$
|
||||||
|
@ -302,6 +330,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuildMacroSupplier()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfigurationBuildMacroSupplier getBuildMacroSupplier() {
|
public IConfigurationBuildMacroSupplier getBuildMacroSupplier() {
|
||||||
IConfigurationBuildMacroSupplier ms = fCfgs[0].getBuildMacroSupplier();
|
IConfigurationBuildMacroSupplier ms = fCfgs[0].getBuildMacroSupplier();
|
||||||
if (ms == null)
|
if (ms == null)
|
||||||
|
@ -315,6 +344,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuilder()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getBuilder()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IBuilder getBuilder() {
|
public IBuilder getBuilder() {
|
||||||
IBuilder b = fCfgs[0].getBuilder();
|
IBuilder b = fCfgs[0].getBuilder();
|
||||||
if (b == null)
|
if (b == null)
|
||||||
|
@ -328,6 +358,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getCleanCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getCleanCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getCleanCommand() {
|
public String getCleanCommand() {
|
||||||
String s = fCfgs[0].getCleanCommand();
|
String s = fCfgs[0].getCleanCommand();
|
||||||
for (int i=1; i<fCfgs.length; i++)
|
for (int i=1; i<fCfgs.length; i++)
|
||||||
|
@ -339,6 +370,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getConfigurationData()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getConfigurationData()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public CConfigurationData getConfigurationData() {
|
public CConfigurationData getConfigurationData() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getConfigurationData()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getConfigurationData()"); //$NON-NLS-1$
|
||||||
|
@ -348,6 +380,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getDescription()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getDescription()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
String s = fCfgs[0].getDescription();
|
String s = fCfgs[0].getDescription();
|
||||||
for (int i=1; i<fCfgs.length; i++)
|
for (int i=1; i<fCfgs.length; i++)
|
||||||
|
@ -359,6 +392,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEditableBuilder()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEditableBuilder()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IBuilder getEditableBuilder() {
|
public IBuilder getEditableBuilder() {
|
||||||
return curr().getEditableBuilder();
|
return curr().getEditableBuilder();
|
||||||
}
|
}
|
||||||
|
@ -366,6 +400,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEnvironmentVariableSupplier()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getEnvironmentVariableSupplier()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier() {
|
public IConfigurationEnvironmentVariableSupplier getEnvironmentVariableSupplier() {
|
||||||
IConfigurationEnvironmentVariableSupplier vs = fCfgs[0].getEnvironmentVariableSupplier();
|
IConfigurationEnvironmentVariableSupplier vs = fCfgs[0].getEnvironmentVariableSupplier();
|
||||||
if (vs == null)
|
if (vs == null)
|
||||||
|
@ -380,6 +415,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserIds()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getErrorParserIds() {
|
public String getErrorParserIds() {
|
||||||
String s = fCfgs[0].getErrorParserIds();
|
String s = fCfgs[0].getErrorParserIds();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -393,6 +429,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserList()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getErrorParserList()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getErrorParserList() {
|
public String[] getErrorParserList() {
|
||||||
String[] s = fCfgs[0].getErrorParserList();
|
String[] s = fCfgs[0].getErrorParserList();
|
||||||
if (s == null || s.length == 0)
|
if (s == null || s.length == 0)
|
||||||
|
@ -411,6 +448,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getFilteredTools()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getFilteredTools() {
|
public ITool[] getFilteredTools() {
|
||||||
ITool[] ts = curr().getFilteredTools();
|
ITool[] ts = curr().getFilteredTools();
|
||||||
return ts;
|
return ts;
|
||||||
|
@ -419,6 +457,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getLibs(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getLibs(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getLibs(String extension) {
|
public String[] getLibs(String extension) {
|
||||||
String[] s = fCfgs[0].getLibs(extension);
|
String[] s = fCfgs[0].getLibs(extension);
|
||||||
if (s == null || s.length == 0)
|
if (s == null || s.length == 0)
|
||||||
|
@ -432,6 +471,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getManagedProject()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getManagedProject()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IManagedProject getManagedProject() {
|
public IManagedProject getManagedProject() {
|
||||||
IManagedProject s = fCfgs[0].getManagedProject();
|
IManagedProject s = fCfgs[0].getManagedProject();
|
||||||
if (s == null)
|
if (s == null)
|
||||||
|
@ -445,6 +485,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputExtension(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputExtension(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getOutputExtension(String resourceExtension) {
|
public String getOutputExtension(String resourceExtension) {
|
||||||
String s = fCfgs[0].getOutputExtension(resourceExtension);
|
String s = fCfgs[0].getOutputExtension(resourceExtension);
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -458,6 +499,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputFlag(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputFlag(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getOutputFlag(String outputExt) {
|
public String getOutputFlag(String outputExt) {
|
||||||
String s = fCfgs[0].getOutputFlag(outputExt);
|
String s = fCfgs[0].getOutputFlag(outputExt);
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -471,6 +513,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputPrefix(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOutputPrefix(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getOutputPrefix(String outputExtension) {
|
public String getOutputPrefix(String outputExtension) {
|
||||||
String s = fCfgs[0].getOutputPrefix(outputExtension);
|
String s = fCfgs[0].getOutputPrefix(outputExtension);
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -484,6 +527,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOwner()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getOwner()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResource getOwner() {
|
public IResource getOwner() {
|
||||||
IResource s = fCfgs[0].getOwner();
|
IResource s = fCfgs[0].getOwner();
|
||||||
if (s == null)
|
if (s == null)
|
||||||
|
@ -497,6 +541,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getParent()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getParent()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IConfiguration getParent() {
|
public IConfiguration getParent() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.getParent()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.getParent()"); //$NON-NLS-1$
|
||||||
|
@ -506,6 +551,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPostannouncebuildStep()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPostannouncebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPostannouncebuildStep() {
|
public String getPostannouncebuildStep() {
|
||||||
String s = fCfgs[0].getPostannouncebuildStep();
|
String s = fCfgs[0].getPostannouncebuildStep();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -519,6 +565,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPostbuildStep()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPostbuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPostbuildStep() {
|
public String getPostbuildStep() {
|
||||||
String s = fCfgs[0].getPostbuildStep();
|
String s = fCfgs[0].getPostbuildStep();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -532,6 +579,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPreannouncebuildStep()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPreannouncebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPreannouncebuildStep() {
|
public String getPreannouncebuildStep() {
|
||||||
String s = fCfgs[0].getPreannouncebuildStep();
|
String s = fCfgs[0].getPreannouncebuildStep();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -545,6 +593,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPrebuildStep()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getPrebuildStep()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getPrebuildStep() {
|
public String getPrebuildStep() {
|
||||||
String s = fCfgs[0].getPrebuildStep();
|
String s = fCfgs[0].getPrebuildStep();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -558,6 +607,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getProjectType()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getProjectType()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IProjectType getProjectType() {
|
public IProjectType getProjectType() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getProjectType()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getProjectType()"); //$NON-NLS-1$
|
||||||
|
@ -567,6 +617,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfiguration(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfiguration(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration getResourceConfiguration(String path) {
|
public IResourceConfiguration getResourceConfiguration(String path) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfiguration()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.getResourceConfiguration()"); //$NON-NLS-1$
|
||||||
|
@ -576,6 +627,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfigurations()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceConfigurations()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceConfiguration[] getResourceConfigurations() {
|
public IResourceConfiguration[] getResourceConfigurations() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.getResourceConfigurations()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.getResourceConfigurations()"); //$NON-NLS-1$
|
||||||
|
@ -585,6 +637,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfo(org.eclipse.core.runtime.IPath, boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfo(org.eclipse.core.runtime.IPath, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
|
public IResourceInfo getResourceInfo(IPath path, boolean exactPath) {
|
||||||
IResourceInfo ris[] = new IResourceInfo[fCfgs.length];
|
IResourceInfo ris[] = new IResourceInfo[fCfgs.length];
|
||||||
boolean isFolder = true;
|
boolean isFolder = true;
|
||||||
|
@ -604,6 +657,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfoById(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfoById(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceInfo getResourceInfoById(String id) {
|
public IResourceInfo getResourceInfoById(String id) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Bad multi access: MultiConfiguration.getResourceInfoById()"); //$NON-NLS-1$
|
System.out.println("Bad multi access: MultiConfiguration.getResourceInfoById()"); //$NON-NLS-1$
|
||||||
|
@ -613,6 +667,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfos()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getResourceInfos()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IResourceInfo[] getResourceInfos() {
|
public IResourceInfo[] getResourceInfos() {
|
||||||
ArrayList<IResourceInfo> ri = new ArrayList<IResourceInfo>();
|
ArrayList<IResourceInfo> ri = new ArrayList<IResourceInfo>();
|
||||||
for (int i=0; i<fCfgs.length; i++) {
|
for (int i=0; i<fCfgs.length; i++) {
|
||||||
|
@ -625,6 +680,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getRootFolderInfo()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getRootFolderInfo()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IFolderInfo getRootFolderInfo() {
|
public IFolderInfo getRootFolderInfo() {
|
||||||
IFolderInfo ris[] = new IFolderInfo[fCfgs.length];
|
IFolderInfo ris[] = new IFolderInfo[fCfgs.length];
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
|
@ -635,6 +691,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getSourceEntries()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getSourceEntries()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICSourceEntry[] getSourceEntries() {
|
public ICSourceEntry[] getSourceEntries() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getSourceEntries()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getSourceEntries()"); //$NON-NLS-1$
|
||||||
|
@ -644,6 +701,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTargetTool()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getTargetTool() {
|
public ITool getTargetTool() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getTargetTool()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getTargetTool()"); //$NON-NLS-1$
|
||||||
|
@ -653,6 +711,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTool(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTool(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getTool(String id) {
|
public ITool getTool(String id) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getTool()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getTool()"); //$NON-NLS-1$
|
||||||
|
@ -662,6 +721,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolChain()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolChain()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IToolChain getToolChain() {
|
public IToolChain getToolChain() {
|
||||||
return curr().getToolChain();
|
return curr().getToolChain();
|
||||||
}
|
}
|
||||||
|
@ -669,6 +729,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolCommand(org.eclipse.cdt.managedbuilder.core.ITool)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolCommand(org.eclipse.cdt.managedbuilder.core.ITool)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getToolCommand(ITool tool) {
|
public String getToolCommand(ITool tool) {
|
||||||
return curr().getToolCommand(tool);
|
return curr().getToolCommand(tool);
|
||||||
}
|
}
|
||||||
|
@ -676,6 +737,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromInputExtension(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromInputExtension(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getToolFromInputExtension(String sourceExtension) {
|
public ITool getToolFromInputExtension(String sourceExtension) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getToolFromInputExtension()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getToolFromInputExtension()"); //$NON-NLS-1$
|
||||||
|
@ -685,6 +747,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromOutputExtension(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolFromOutputExtension(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool getToolFromOutputExtension(String extension) {
|
public ITool getToolFromOutputExtension(String extension) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getToolFromOutputExtension()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getToolFromOutputExtension()"); //$NON-NLS-1$
|
||||||
|
@ -694,6 +757,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTools()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getTools()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getTools() {
|
public ITool[] getTools() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getTools()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getTools()"); //$NON-NLS-1$
|
||||||
|
@ -703,6 +767,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getToolsBySuperClassId(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ITool[] getToolsBySuperClassId(String id) {
|
public ITool[] getToolsBySuperClassId(String id) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getToolsBySuperClassId()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getToolsBySuperClassId()"); //$NON-NLS-1$
|
||||||
|
@ -712,6 +777,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getUserObjects(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#getUserObjects(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getUserObjects(String extension) {
|
public String[] getUserObjects(String extension) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getUserObjects()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getUserObjects()"); //$NON-NLS-1$
|
||||||
|
@ -721,6 +787,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#hasOverriddenBuildCommand()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#hasOverriddenBuildCommand()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasOverriddenBuildCommand() {
|
public boolean hasOverriddenBuildCommand() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i].hasOverriddenBuildCommand())
|
if (fCfgs[i].hasOverriddenBuildCommand())
|
||||||
|
@ -731,6 +798,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isBuilderCompatible(org.eclipse.cdt.managedbuilder.core.IBuilder)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isBuilderCompatible(org.eclipse.cdt.managedbuilder.core.IBuilder)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isBuilderCompatible(IBuilder builder) {
|
public boolean isBuilderCompatible(IBuilder builder) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (! fCfgs[i].isBuilderCompatible(builder))
|
if (! fCfgs[i].isBuilderCompatible(builder))
|
||||||
|
@ -741,6 +809,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isDirty()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isDirty()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i].isDirty())
|
if (fCfgs[i].isDirty())
|
||||||
|
@ -751,6 +820,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isExtensionElement()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isExtensionElement() {
|
public boolean isExtensionElement() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.isExtensionElement()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.isExtensionElement()"); //$NON-NLS-1$
|
||||||
|
@ -760,6 +830,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isHeaderFile(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isHeaderFile(String ext) {
|
public boolean isHeaderFile(String ext) {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.isHeaderFile()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.isHeaderFile()"); //$NON-NLS-1$
|
||||||
|
@ -769,6 +840,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isManagedBuildOn()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isManagedBuildOn()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isManagedBuildOn() {
|
public boolean isManagedBuildOn() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (! fCfgs[i].isManagedBuildOn())
|
if (! fCfgs[i].isManagedBuildOn())
|
||||||
|
@ -786,6 +858,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSupported()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSupported()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isSupported() {
|
public boolean isSupported() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i].isSupported())
|
if (fCfgs[i].isSupported())
|
||||||
|
@ -796,6 +869,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSystemObject()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isSystemObject()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isSystemObject() {
|
public boolean isSystemObject() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (! fCfgs[i].isSystemObject())
|
if (! fCfgs[i].isSystemObject())
|
||||||
|
@ -806,6 +880,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isTemporary()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#isTemporary()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTemporary() {
|
public boolean isTemporary() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (! fCfgs[i].isTemporary())
|
if (! fCfgs[i].isTemporary())
|
||||||
|
@ -816,6 +891,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsFullRebuild()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsFullRebuild()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean needsFullRebuild() {
|
public boolean needsFullRebuild() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i].needsFullRebuild())
|
if (fCfgs[i].needsFullRebuild())
|
||||||
|
@ -826,6 +902,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsRebuild()
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#needsRebuild()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean needsRebuild() {
|
public boolean needsRebuild() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i].needsRebuild())
|
if (fCfgs[i].needsRebuild())
|
||||||
|
@ -836,6 +913,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#removeResourceConfiguration(org.eclipse.cdt.managedbuilder.core.IResourceInfo)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#removeResourceConfiguration(org.eclipse.cdt.managedbuilder.core.IResourceInfo)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void removeResourceConfiguration(IResourceInfo resConfig) {
|
public void removeResourceConfiguration(IResourceInfo resConfig) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].removeResourceConfiguration(resConfig);
|
fCfgs[i].removeResourceConfiguration(resConfig);
|
||||||
|
@ -844,6 +922,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#removeResourceInfo(org.eclipse.core.runtime.IPath)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#removeResourceInfo(org.eclipse.core.runtime.IPath)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void removeResourceInfo(IPath path) {
|
public void removeResourceInfo(IPath path) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].removeResourceInfo(path);
|
fCfgs[i].removeResourceInfo(path);
|
||||||
|
@ -852,6 +931,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactExtension(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setArtifactExtension(String extension) {
|
public void setArtifactExtension(String extension) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setArtifactExtension(extension);
|
fCfgs[i].setArtifactExtension(extension);
|
||||||
|
@ -860,6 +940,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactName(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setArtifactName(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setArtifactName(String name) {
|
public void setArtifactName(String name) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setArtifactName(name);
|
fCfgs[i].setArtifactName(name);
|
||||||
|
@ -868,6 +949,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArguments(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArguments(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBuildArguments(String makeArgs) {
|
public void setBuildArguments(String makeArgs) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setBuildArguments(makeArgs);
|
fCfgs[i].setBuildArguments(makeArgs);
|
||||||
|
@ -876,6 +958,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArtefactType(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildArtefactType(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBuildArtefactType(String id) throws BuildException {
|
public void setBuildArtefactType(String id) throws BuildException {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setBuildArtefactType(id);
|
fCfgs[i].setBuildArtefactType(id);
|
||||||
|
@ -884,6 +967,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildCommand(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setBuildCommand(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBuildCommand(String command) {
|
public void setBuildCommand(String command) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setBuildCommand(command);
|
fCfgs[i].setBuildCommand(command);
|
||||||
|
@ -892,6 +976,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setCleanCommand(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setCleanCommand(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setCleanCommand(String command) {
|
public void setCleanCommand(String command) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setCleanCommand(command);
|
fCfgs[i].setCleanCommand(command);
|
||||||
|
@ -900,6 +985,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDescription(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDescription(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setDescription(description);
|
fCfgs[i].setDescription(description);
|
||||||
|
@ -908,6 +994,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setDirty(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setDirty(boolean isDirty) {
|
public void setDirty(boolean isDirty) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setDirty(isDirty);
|
fCfgs[i].setDirty(isDirty);
|
||||||
|
@ -916,6 +1003,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserIds(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserIds(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setErrorParserIds(String ids) {
|
public void setErrorParserIds(String ids) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setErrorParserIds(ids);
|
fCfgs[i].setErrorParserIds(ids);
|
||||||
|
@ -924,6 +1012,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserList(java.lang.String[])
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setErrorParserList(java.lang.String[])
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setErrorParserList(String[] ids) {
|
public void setErrorParserList(String[] ids) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setErrorParserList(ids);
|
fCfgs[i].setErrorParserList(ids);
|
||||||
|
@ -932,6 +1021,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setManagedBuildOn(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setManagedBuildOn(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setManagedBuildOn(boolean on) throws BuildException {
|
public void setManagedBuildOn(boolean on) throws BuildException {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setManagedBuildOn(on);
|
fCfgs[i].setManagedBuildOn(on);
|
||||||
|
@ -940,11 +1030,13 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setName(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setName(String name) {} // do nothing
|
public void setName(String name) {} // do nothing
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
public IOption setOption(IHoldsOptions parent, IOption option, boolean value)
|
||||||
throws BuildException {
|
throws BuildException {
|
||||||
IOption op = null;
|
IOption op = null;
|
||||||
|
@ -956,6 +1048,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions parent, IOption option, String value)
|
public IOption setOption(IHoldsOptions parent, IOption option, String value)
|
||||||
throws BuildException {
|
throws BuildException {
|
||||||
IOption op = null;
|
IOption op = null;
|
||||||
|
@ -967,6 +1060,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String[])
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setOption(org.eclipse.cdt.managedbuilder.core.IHoldsOptions, org.eclipse.cdt.managedbuilder.core.IOption, java.lang.String[])
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IOption setOption(IHoldsOptions parent, IOption option,
|
public IOption setOption(IHoldsOptions parent, IOption option,
|
||||||
String[] value) throws BuildException {
|
String[] value) throws BuildException {
|
||||||
IOption op = null;
|
IOption op = null;
|
||||||
|
@ -978,6 +1072,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPostannouncebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPostannouncebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPostannouncebuildStep(String announceStep) {
|
public void setPostannouncebuildStep(String announceStep) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setPostannouncebuildStep(announceStep);
|
fCfgs[i].setPostannouncebuildStep(announceStep);
|
||||||
|
@ -986,6 +1081,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPostbuildStep(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPostbuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPostbuildStep(String step) {
|
public void setPostbuildStep(String step) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setPostbuildStep(step);
|
fCfgs[i].setPostbuildStep(step);
|
||||||
|
@ -994,6 +1090,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPreannouncebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPreannouncebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPreannouncebuildStep(String announceStep) {
|
public void setPreannouncebuildStep(String announceStep) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setPreannouncebuildStep(announceStep);
|
fCfgs[i].setPreannouncebuildStep(announceStep);
|
||||||
|
@ -1002,6 +1099,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPrebuildStep(java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setPrebuildStep(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPrebuildStep(String step) {
|
public void setPrebuildStep(String step) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setPrebuildStep(step);
|
fCfgs[i].setPrebuildStep(step);
|
||||||
|
@ -1010,6 +1108,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setRebuildState(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setRebuildState(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setRebuildState(boolean rebuild) {
|
public void setRebuildState(boolean rebuild) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setRebuildState(rebuild);
|
fCfgs[i].setRebuildState(rebuild);
|
||||||
|
@ -1018,6 +1117,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setSourceEntries(org.eclipse.cdt.core.settings.model.ICSourceEntry[])
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setSourceEntries(org.eclipse.cdt.core.settings.model.ICSourceEntry[])
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSourceEntries(ICSourceEntry[] entries) {
|
public void setSourceEntries(ICSourceEntry[] entries) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setSourceEntries(entries);
|
fCfgs[i].setSourceEntries(entries);
|
||||||
|
@ -1026,6 +1126,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#setToolCommand(org.eclipse.cdt.managedbuilder.core.ITool, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setToolCommand(ITool tool, String command) {
|
public void setToolCommand(ITool tool, String command) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].setToolCommand(tool, command);
|
fCfgs[i].setToolCommand(tool, command);
|
||||||
|
@ -1034,6 +1135,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#supportsBuild(boolean)
|
* @see org.eclipse.cdt.managedbuilder.core.IConfiguration#supportsBuild(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean supportsBuild(boolean managed) {
|
public boolean supportsBuild(boolean managed) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (! fCfgs[i].supportsBuild(managed))
|
if (! fCfgs[i].supportsBuild(managed))
|
||||||
|
@ -1044,6 +1146,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getBaseId()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getBaseId() {
|
public String getBaseId() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getBaseId()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getBaseId()"); //$NON-NLS-1$
|
||||||
|
@ -1053,6 +1156,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getId()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return curr().getId() + "_etc"; //$NON-NLS-1$
|
return curr().getId() + "_etc"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -1060,6 +1164,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getManagedBuildRevision()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getManagedBuildRevision() {
|
public String getManagedBuildRevision() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getMngBuildRevision()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getMngBuildRevision()"); //$NON-NLS-1$
|
||||||
|
@ -1069,6 +1174,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getName()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "Multiple configurations"; //$NON-NLS-1$
|
return "Multiple configurations"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -1076,6 +1182,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#getVersion()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Version getVersion() {
|
public Version getVersion() {
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
System.out.println("Strange multi access: MultiConfiguration.getVersion()"); //$NON-NLS-1$
|
System.out.println("Strange multi access: MultiConfiguration.getVersion()"); //$NON-NLS-1$
|
||||||
|
@ -1085,61 +1192,69 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObject#setVersion(org.eclipse.core.runtime.PluginVersionIdentifier)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setVersion(Version version) {} // do nothing
|
public void setVersion(Version version) {} // do nothing
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IBuildObjectPropertiesContainer#getBuildProperties()
|
* @see org.eclipse.cdt.managedbuilder.core.IBuildObjectPropertiesContainer#getBuildProperties()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IBuildObjectProperties getBuildProperties() {
|
public IBuildObjectProperties getBuildProperties() {
|
||||||
return curr().getBuildProperties();
|
return curr().getBuildProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getParallelDef() {
|
public boolean getParallelDef() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (IConfiguration cfg : fCfgs) {
|
||||||
if (fCfgs[i] instanceof Configuration) {
|
if (cfg instanceof Configuration) {
|
||||||
if (!((Configuration)fCfgs[i]).getParallelDef())
|
if (!((Configuration)cfg).getParallelDef())
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true; // all cfgs report true
|
return true; // all cfgs report true
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParallelDef(boolean def) {
|
@Override
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
public void setParallelDef(boolean parallel) {
|
||||||
if (fCfgs[i] instanceof Configuration)
|
for (IConfiguration cfg : fCfgs) {
|
||||||
((Configuration)fCfgs[i]).setParallelDef(def);
|
if (cfg instanceof Configuration)
|
||||||
|
((Configuration)cfg).setParallelDef(parallel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getParallelNumber() {
|
public int getParallelNumber() {
|
||||||
int res = -1;
|
int res = 0;
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (IConfiguration cfg : fCfgs) {
|
||||||
if (fCfgs[i] instanceof Configuration) {
|
if (cfg instanceof Configuration) {
|
||||||
int x = ((Configuration)fCfgs[i]).getParallelNumber();
|
int num = ((Configuration)cfg).getParallelNumber();
|
||||||
if (res == -1)
|
Assert.isTrue(num != 0); // can't be 0, see IMakeCommonBuildInfo.getParallelizationNum()
|
||||||
res = x;
|
|
||||||
else if (res != x)
|
if (res == 0)
|
||||||
|
res = num;
|
||||||
|
else if (res != num)
|
||||||
return 0; // values are different !
|
return 0; // values are different !
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
return (res == -1 ? 0: res); // all cfgs report true
|
}
|
||||||
|
return res; // all cfgs report same value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setParallelNumber(int num) {
|
public void setParallelNumber(int num) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (IConfiguration cfg : fCfgs) {
|
||||||
if (fCfgs[i] instanceof Configuration)
|
if (cfg instanceof Configuration)
|
||||||
((Configuration)fCfgs[i]).setParallelNumber(num);
|
((Configuration)cfg).setParallelNumber(num);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean getInternalBuilderParallel() {
|
public boolean getInternalBuilderParallel() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
return getParallelDef();
|
||||||
if (fCfgs[i] instanceof Configuration) {
|
|
||||||
if (!((Configuration)fCfgs[i]).getInternalBuilderParallel())
|
|
||||||
return false;
|
|
||||||
} else
|
|
||||||
return false;
|
|
||||||
return true; // all cfgs report true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isInternalBuilderEnabled() {
|
public boolean isInternalBuilderEnabled() {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i] instanceof Configuration) {
|
if (fCfgs[i] instanceof Configuration) {
|
||||||
|
@ -1150,6 +1265,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
return true; // all cfgs report true
|
return true; // all cfgs report true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean canEnableInternalBuilder(boolean v) {
|
public boolean canEnableInternalBuilder(boolean v) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i] instanceof Configuration) {
|
if (fCfgs[i] instanceof Configuration) {
|
||||||
|
@ -1160,6 +1276,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
return true; // all cfgs report true
|
return true; // all cfgs report true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void enableInternalBuilder(boolean v) {
|
public void enableInternalBuilder(boolean v) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
if (fCfgs[i] instanceof Configuration)
|
if (fCfgs[i] instanceof Configuration)
|
||||||
|
@ -1173,6 +1290,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
return fCfgs[curr];
|
return fCfgs[curr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getToolOutputPrefix() {
|
public String getToolOutputPrefix() {
|
||||||
String s = fCfgs[0].calculateTargetTool().getOutputPrefix();
|
String s = fCfgs[0].calculateTargetTool().getOutputPrefix();
|
||||||
if (s == null || s.length() == 0)
|
if (s == null || s.length() == 0)
|
||||||
|
@ -1183,11 +1301,13 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setOutputPrefixForPrimaryOutput(String pref) {
|
public void setOutputPrefixForPrimaryOutput(String pref) {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
fCfgs[i].calculateTargetTool().setOutputPrefixForPrimaryOutput(pref);
|
fCfgs[i].calculateTargetTool().setOutputPrefixForPrimaryOutput(pref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IBuildProperty getBuildProperty(String id) {
|
public IBuildProperty getBuildProperty(String id) {
|
||||||
IBuildProperty b = fCfgs[0].getBuildProperties().getProperty(id);
|
IBuildProperty b = fCfgs[0].getBuildProperties().getProperty(id);
|
||||||
if (b == null )
|
if (b == null )
|
||||||
|
@ -1201,6 +1321,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
}
|
}
|
||||||
|
|
||||||
// Performing conjunction of supported values for each cfg
|
// Performing conjunction of supported values for each cfg
|
||||||
|
@Override
|
||||||
public IBuildPropertyValue[] getSupportedValues(String id) {
|
public IBuildPropertyValue[] getSupportedValues(String id) {
|
||||||
IBuildPropertyValue[] a = fCfgs[0].getBuildProperties().getSupportedValues(id);
|
IBuildPropertyValue[] a = fCfgs[0].getBuildProperties().getSupportedValues(id);
|
||||||
if (a == null || a.length == 0)
|
if (a == null || a.length == 0)
|
||||||
|
@ -1237,6 +1358,7 @@ public class MultiConfiguration extends MultiItemsHolder implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setBuildProperty(String id, String val) {
|
public void setBuildProperty(String id, String val) {
|
||||||
try {
|
try {
|
||||||
for (int i=0; i<fCfgs.length; i++)
|
for (int i=0; i<fCfgs.length; i++)
|
||||||
|
|
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCalculator.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyCommands.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyGeneratorType.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyInfo.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/IManagedDependencyPreBuild.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator2.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/DefaultGCCDependencyCalculator3.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java
Executable file → Normal file
0
build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuDependencyGroupInfo.java
Executable file → Normal file
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2010 QNX Software Systems and others.
|
* Copyright (c) 2004, 2011 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.newmake.core;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
|
|
||||||
|
@ -42,10 +43,39 @@ public interface IMakeCommonBuildInfo {
|
||||||
void setStopOnError(boolean on) throws CoreException;
|
void setStopOnError(boolean on) throws CoreException;
|
||||||
boolean supportsStopOnError(boolean on);
|
boolean supportsStopOnError(boolean on);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the maximum number of parallel jobs to be used for build.
|
||||||
|
*/
|
||||||
int getParallelizationNum();
|
int getParallelizationNum();
|
||||||
void setParallelizationNum(int num) throws CoreException;
|
|
||||||
|
/**
|
||||||
|
* Sets maximum number of parallel threads/jobs to be used by builder.
|
||||||
|
* Note that this number can be interpreted by builder in a special way.
|
||||||
|
* @see Builder#setParallelizationNum(int)
|
||||||
|
*
|
||||||
|
* @param jobs - maximum number of jobs.
|
||||||
|
*/
|
||||||
|
void setParallelizationNum(int jobs) throws CoreException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if builder supports parallel build,
|
||||||
|
* {@code false} otherwise.
|
||||||
|
*/
|
||||||
|
|
||||||
boolean supportsParallelBuild();
|
boolean supportsParallelBuild();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@code true} if builder support for parallel build is enabled,
|
||||||
|
* {@code false} otherwise.
|
||||||
|
*/
|
||||||
boolean isParallelBuildOn();
|
boolean isParallelBuildOn();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set parallel execution mode for the builder.
|
||||||
|
* @see Builder#setParallelBuildOn(boolean)
|
||||||
|
*
|
||||||
|
* @param on - the flag to enable or disable parallel mode.
|
||||||
|
*/
|
||||||
void setParallelBuildOn(boolean on) throws CoreException;
|
void setParallelBuildOn(boolean on) throws CoreException;
|
||||||
|
|
||||||
boolean isDefaultBuildCmd();
|
boolean isDefaultBuildCmd();
|
||||||
|
|
|
@ -27,9 +27,10 @@ public class Messages extends NLS {
|
||||||
public static String BuilderSettingsTab_0;
|
public static String BuilderSettingsTab_0;
|
||||||
public static String BuilderSettingsTab_1;
|
public static String BuilderSettingsTab_1;
|
||||||
public static String BuilderSettingsTab_10;
|
public static String BuilderSettingsTab_10;
|
||||||
public static String BuilderSettingsTab_11;
|
public static String BuilderSettingsTab_EnableParallelBuild;
|
||||||
public static String BuilderSettingsTab_12;
|
public static String BuilderSettingsTab_UseOptimalJobs;
|
||||||
public static String BuilderSettingsTab_13;
|
public static String BuilderSettingsTab_UseUnlimitedJobs;
|
||||||
|
public static String BuilderSettingsTab_UseParallelJobs;
|
||||||
public static String BuilderSettingsTab_14;
|
public static String BuilderSettingsTab_14;
|
||||||
public static String BuilderSettingsTab_15;
|
public static String BuilderSettingsTab_15;
|
||||||
public static String BuilderSettingsTab_16;
|
public static String BuilderSettingsTab_16;
|
||||||
|
|
|
@ -31,9 +31,10 @@ BuilderSettingsTab_7=&Generate Makefiles automatically
|
||||||
BuilderSettingsTab_8=&Expand Env. Variable Refs in Makefiles
|
BuilderSettingsTab_8=&Expand Env. Variable Refs in Makefiles
|
||||||
BuilderSettingsTab_9=Build settings
|
BuilderSettingsTab_9=Build settings
|
||||||
BuilderSettingsTab_10=Stop on first build error
|
BuilderSettingsTab_10=Stop on first build error
|
||||||
BuilderSettingsTab_11=Use parallel build
|
BuilderSettingsTab_EnableParallelBuild=Enable parallel build
|
||||||
BuilderSettingsTab_12=Use optimal jobs number
|
BuilderSettingsTab_UseOptimalJobs=Use number of processors ({0})
|
||||||
BuilderSettingsTab_13=Use parallel jobs:
|
BuilderSettingsTab_UseParallelJobs=Use parallel jobs:
|
||||||
|
BuilderSettingsTab_UseUnlimitedJobs=Use unlimited jobs
|
||||||
BuilderSettingsTab_14=Workbench Build Behavior
|
BuilderSettingsTab_14=Workbench Build Behavior
|
||||||
BuilderSettingsTab_15=Workbench build type:
|
BuilderSettingsTab_15=Workbench build type:
|
||||||
BuilderSettingsTab_16=Make build target:
|
BuilderSettingsTab_16=Make build target:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007, 2010 Intel Corporation and others.
|
* Copyright (c) 2007, 2011 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -11,6 +11,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.ui.properties;
|
package org.eclipse.cdt.managedbuilder.ui.properties;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
|
import org.eclipse.cdt.core.settings.model.ICMultiConfigDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
import org.eclipse.cdt.core.settings.model.ICMultiItemsHolder;
|
||||||
|
@ -18,7 +20,6 @@ import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
import org.eclipse.cdt.managedbuilder.core.IBuilder;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IMultiConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.buildmodel.BuildProcessManager;
|
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
import org.eclipse.cdt.managedbuilder.internal.core.Builder;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
|
||||||
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
|
||||||
|
@ -51,6 +52,8 @@ import org.eclipse.swt.widgets.Widget;
|
||||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
|
private static final int SPINNER_MAX_VALUE = 10000;
|
||||||
|
private static final int SPINNER_MIN_VALUE = 2;
|
||||||
|
|
||||||
private static final int TRI_STATES_SIZE = 4;
|
private static final int TRI_STATES_SIZE = 4;
|
||||||
// Widgets
|
// Widgets
|
||||||
|
@ -58,9 +61,10 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
private Button b_stopOnError; // 3
|
private Button b_stopOnError; // 3
|
||||||
private Button b_parallel; // 3
|
private Button b_parallel; // 3
|
||||||
|
|
||||||
private Button b_parallelOpt;
|
private Button b_parallelOptimal;
|
||||||
private Button b_parallelNum;
|
private Button b_parallelSpecific;
|
||||||
private Spinner parallelProcesses;
|
private Button b_parallelUnlimited;
|
||||||
|
private Spinner s_parallelNumber;
|
||||||
|
|
||||||
private Label title2;
|
private Label title2;
|
||||||
private Button b_autoBuild; //3
|
private Button b_autoBuild; //3
|
||||||
|
@ -70,11 +74,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
private Button b_cmdClean; // 3
|
private Button b_cmdClean; // 3
|
||||||
private Text t_cmdClean;
|
private Text t_cmdClean;
|
||||||
|
|
||||||
private IBuilder bldr;
|
private Builder bldr;
|
||||||
private IConfiguration icfg;
|
private IConfiguration icfg;
|
||||||
private boolean canModify = true;
|
private boolean canModify = true;
|
||||||
|
|
||||||
protected final int cpuNumber = BuildProcessManager.checkCPUNumber();
|
protected final int cpuNumber = Runtime.getRuntime().availableProcessors();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
|
@ -110,7 +114,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
gl.marginHeight = 0;
|
gl.marginHeight = 0;
|
||||||
c2.setLayout(gl);
|
c2.setLayout(gl);
|
||||||
|
|
||||||
b_parallel = setupCheck(c2, Messages.BuilderSettingsTab_11, 1, GridData.BEGINNING);
|
b_parallel = setupCheck(c2, Messages.BuilderSettingsTab_EnableParallelBuild, 1, GridData.BEGINNING);
|
||||||
|
|
||||||
Composite c3 = new Composite(g3, SWT.NONE);
|
Composite c3 = new Composite(g3, SWT.NONE);
|
||||||
setupControl(c3, 1, GridData.FILL_BOTH);
|
setupControl(c3, 1, GridData.FILL_BOTH);
|
||||||
|
@ -120,39 +124,60 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
gl.marginHeight = 0;
|
gl.marginHeight = 0;
|
||||||
c3.setLayout(gl);
|
c3.setLayout(gl);
|
||||||
|
|
||||||
b_parallelOpt= new Button(c3, SWT.RADIO);
|
b_parallelOptimal= new Button(c3, SWT.RADIO);
|
||||||
b_parallelOpt.setText(Messages.BuilderSettingsTab_12);
|
b_parallelOptimal.setText(MessageFormat.format(Messages.BuilderSettingsTab_UseOptimalJobs, 1));
|
||||||
setupControl(b_parallelOpt, 2, GridData.BEGINNING);
|
setupControl(b_parallelOptimal, 2, GridData.BEGINNING);
|
||||||
((GridData)(b_parallelOpt.getLayoutData())).horizontalIndent = 15;
|
((GridData)(b_parallelOptimal.getLayoutData())).horizontalIndent = 15;
|
||||||
b_parallelOpt.addSelectionListener(new SelectionAdapter() {
|
b_parallelOptimal.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
setParallelDef(b_parallelOpt.getSelection());
|
if (b_parallelOptimal.getSelection()) {
|
||||||
|
setParallelDef(true);
|
||||||
|
setParallelNumber(-1);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
}
|
||||||
}});
|
}});
|
||||||
|
|
||||||
b_parallelNum= new Button(c3, SWT.RADIO);
|
b_parallelSpecific= new Button(c3, SWT.RADIO);
|
||||||
b_parallelNum.setText(Messages.BuilderSettingsTab_13);
|
b_parallelSpecific.setText(Messages.BuilderSettingsTab_UseParallelJobs);
|
||||||
setupControl(b_parallelNum, 1, GridData.BEGINNING);
|
setupControl(b_parallelSpecific, 1, GridData.BEGINNING);
|
||||||
((GridData)(b_parallelNum.getLayoutData())).horizontalIndent = 15;
|
((GridData)(b_parallelSpecific.getLayoutData())).horizontalIndent = 15;
|
||||||
b_parallelNum.addSelectionListener(new SelectionAdapter() {
|
b_parallelSpecific.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
setParallelDef(!b_parallelNum.getSelection());
|
if (b_parallelSpecific.getSelection()) {
|
||||||
|
setParallelDef(true);
|
||||||
|
setParallelNumber(s_parallelNumber.getSelection());
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
}
|
||||||
}});
|
}});
|
||||||
|
|
||||||
parallelProcesses = new Spinner(c3, SWT.BORDER);
|
s_parallelNumber = new Spinner(c3, SWT.BORDER);
|
||||||
setupControl(parallelProcesses, 1, GridData.BEGINNING);
|
setupControl(s_parallelNumber, 1, GridData.BEGINNING);
|
||||||
parallelProcesses.setValues(cpuNumber, 1, 10000, 0, 1, 10);
|
s_parallelNumber.setValues(cpuNumber, SPINNER_MIN_VALUE, SPINNER_MAX_VALUE, 0, 1, 10);
|
||||||
parallelProcesses.addSelectionListener(new SelectionAdapter () {
|
s_parallelNumber.addSelectionListener(new SelectionAdapter () {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
setParallelNumber(parallelProcesses.getSelection());
|
setParallelDef(true);
|
||||||
|
setParallelNumber(s_parallelNumber.getSelection());
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b_parallelUnlimited= new Button(c3, SWT.RADIO);
|
||||||
|
b_parallelUnlimited.setText(Messages.BuilderSettingsTab_UseUnlimitedJobs);
|
||||||
|
setupControl(b_parallelUnlimited, 2, GridData.BEGINNING);
|
||||||
|
((GridData)(b_parallelUnlimited.getLayoutData())).horizontalIndent = 15;
|
||||||
|
b_parallelUnlimited.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
if (b_parallelUnlimited.getSelection()) {
|
||||||
|
setParallelDef(true);
|
||||||
|
setParallelNumber(Builder.UNLIMITED_JOBS);
|
||||||
|
updateButtons();
|
||||||
|
}
|
||||||
|
}});
|
||||||
|
|
||||||
// Workbench behaviour group
|
// Workbench behaviour group
|
||||||
AccessibleListener makeTargetLabelAccessibleListener = new AccessibleAdapter() {
|
AccessibleListener makeTargetLabelAccessibleListener = new AccessibleAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -166,6 +191,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
b_autoBuild = setupCheck(g4, Messages.BuilderSettingsTab_17, 1, GridData.BEGINNING);
|
b_autoBuild = setupCheck(g4, Messages.BuilderSettingsTab_17, 1, GridData.BEGINNING);
|
||||||
t_autoBuild = setupBlock(g4, b_autoBuild);
|
t_autoBuild = setupBlock(g4, b_autoBuild);
|
||||||
t_autoBuild.addModifyListener(new ModifyListener() {
|
t_autoBuild.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
if (canModify)
|
if (canModify)
|
||||||
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, t_autoBuild.getText());
|
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_AUTO, t_autoBuild.getText());
|
||||||
|
@ -175,6 +201,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
b_cmdBuild = setupCheck(g4, Messages.BuilderSettingsTab_19, 1, GridData.BEGINNING);
|
b_cmdBuild = setupCheck(g4, Messages.BuilderSettingsTab_19, 1, GridData.BEGINNING);
|
||||||
t_cmdBuild = setupBlock(g4, b_cmdBuild);
|
t_cmdBuild = setupBlock(g4, b_cmdBuild);
|
||||||
t_cmdBuild.addModifyListener(new ModifyListener() {
|
t_cmdBuild.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
if (canModify)
|
if (canModify)
|
||||||
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, t_cmdBuild.getText());
|
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_INCREMENTAL, t_cmdBuild.getText());
|
||||||
|
@ -183,6 +210,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
b_cmdClean = setupCheck(g4, Messages.BuilderSettingsTab_20, 1, GridData.BEGINNING);
|
b_cmdClean = setupCheck(g4, Messages.BuilderSettingsTab_20, 1, GridData.BEGINNING);
|
||||||
t_cmdClean = setupBlock(g4, b_cmdClean);
|
t_cmdClean = setupBlock(g4, b_cmdClean);
|
||||||
t_cmdClean.addModifyListener(new ModifyListener() {
|
t_cmdClean.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
if (canModify)
|
if (canModify)
|
||||||
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, t_cmdClean.getText());
|
setBuildAttribute(IMakeBuilderInfo.BUILD_TARGET_CLEAN, t_cmdClean.getText());
|
||||||
|
@ -191,6 +219,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Calculate enablements when multiple configurations selected on property page.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* Mode 0:
|
* Mode 0:
|
||||||
|
@ -202,55 +231,51 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
* 0: isStopOnError
|
* 0: isStopOnError
|
||||||
* 1: supportsStopOnError(true)
|
* 1: supportsStopOnError(true)
|
||||||
* 2: bld.supportsStopOnError(false)
|
* 2: bld.supportsStopOnError(false)
|
||||||
* 3: cfg.getInternalBuilderParallel()
|
* 3: N/A
|
||||||
* Mode 2:
|
* Mode 2:
|
||||||
* 0: b.isAutoBuildEnable()
|
* 0: b.isAutoBuildEnable()
|
||||||
* 1: b.isIncrementalBuildEnabled()
|
* 1: b.isIncrementalBuildEnabled()
|
||||||
* 2: b.isCleanBuildEnabled()
|
* 2: b.isCleanBuildEnabled()
|
||||||
* 3: getParallelDef()
|
* 3: N/A
|
||||||
*/
|
*/
|
||||||
static int[] calc3states(ICPropertyProvider p,
|
static int[] calc3states(ICPropertyProvider p, IConfiguration mcfg, int mode) {
|
||||||
IConfiguration c,
|
if (p.isMultiCfg() && mcfg instanceof ICMultiItemsHolder) {
|
||||||
int mode) {
|
boolean m0 = (mode == 0);
|
||||||
if (p.isMultiCfg() &&
|
boolean m1 = (mode == 1);
|
||||||
c instanceof ICMultiItemsHolder)
|
|
||||||
{
|
|
||||||
boolean p0 = (mode == 0);
|
|
||||||
boolean p1 = (mode == 1);
|
|
||||||
|
|
||||||
IConfiguration[] cfs = (IConfiguration[])((ICMultiItemsHolder)c).getItems();
|
IConfiguration[] cfgs = (IConfiguration[])((ICMultiItemsHolder)mcfg).getItems();
|
||||||
IBuilder b = cfs[0].getBuilder();
|
IBuilder bldr0 = cfgs[0].getBuilder();
|
||||||
int[] res = new int[TRI_STATES_SIZE];
|
int[] res = new int[TRI_STATES_SIZE];
|
||||||
boolean[] x = new boolean[TRI_STATES_SIZE];
|
boolean[] b = new boolean[TRI_STATES_SIZE];
|
||||||
x[0] = p0 ? b.isManagedBuildOn() :
|
b[0] = m0 ? bldr0.isManagedBuildOn() :
|
||||||
(p1 ? b.isStopOnError() : b.isAutoBuildEnable());
|
(m1 ? bldr0.isStopOnError() : bldr0.isAutoBuildEnable());
|
||||||
x[1] = p0 ? b.isDefaultBuildCmd():
|
b[1] = m0 ? bldr0.isDefaultBuildCmd():
|
||||||
(p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled() );
|
(m1 ? bldr0.supportsStopOnError(true) : bldr0.isIncrementalBuildEnabled() );
|
||||||
x[2] = p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
b[2] = m0 ? bldr0.canKeepEnvironmentVariablesInBuildfile() :
|
||||||
(p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled());
|
(m1 ? bldr0.supportsStopOnError(false) : bldr0.isCleanBuildEnabled());
|
||||||
x[3] = p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
b[3] = m0 ? bldr0.keepEnvironmentVariablesInBuildfile() : false;
|
||||||
( p1 ? ((Configuration)cfs[0]).getInternalBuilderParallel() : getParallelDef(c));
|
for (int i=1; i<cfgs.length; i++) {
|
||||||
for (int i=1; i<cfs.length; i++) {
|
IBuilder bldr = cfgs[i].getBuilder();
|
||||||
b = cfs[i].getBuilder();
|
if (b[0] != (m0 ? bldr.isManagedBuildOn() :
|
||||||
if (x[0] != (p0 ? b.isManagedBuildOn() :
|
(m1 ? bldr.isStopOnError() : bldr.isAutoBuildEnable())))
|
||||||
(p1 ? b.isStopOnError() : b.isAutoBuildEnable())))
|
|
||||||
res[0] = TRI_UNKNOWN;
|
res[0] = TRI_UNKNOWN;
|
||||||
if (x[1] != (p0 ? b.isDefaultBuildCmd() :
|
if (b[1] != (m0 ? bldr.isDefaultBuildCmd() :
|
||||||
(p1 ? b.supportsStopOnError(true) : b.isIncrementalBuildEnabled())))
|
(m1 ? bldr.supportsStopOnError(true) : bldr.isIncrementalBuildEnabled())))
|
||||||
res[1] = TRI_UNKNOWN;
|
res[1] = TRI_UNKNOWN;
|
||||||
if (x[2] != (p0 ? b.canKeepEnvironmentVariablesInBuildfile() :
|
if (b[2] != (m0 ? bldr.canKeepEnvironmentVariablesInBuildfile() :
|
||||||
(p1 ? b.supportsStopOnError(false) : b.isCleanBuildEnabled())))
|
(m1 ? bldr.supportsStopOnError(false) : bldr.isCleanBuildEnabled())))
|
||||||
res[2] = TRI_UNKNOWN;
|
res[2] = TRI_UNKNOWN;
|
||||||
if (x[3] != (p0 ? b.keepEnvironmentVariablesInBuildfile() :
|
if (b[3] != (m0 ? bldr.keepEnvironmentVariablesInBuildfile() : false)) {
|
||||||
(p1 ? ((Configuration)cfs[i]).getInternalBuilderParallel() : getParallelDef(c))))
|
|
||||||
res[3] = TRI_UNKNOWN;
|
res[3] = TRI_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
for (int i=0; i<TRI_STATES_SIZE; i++) {
|
||||||
if (res[i] != TRI_UNKNOWN)
|
if (res[i] != TRI_UNKNOWN)
|
||||||
res[i] = x[i] ? TRI_YES : TRI_NO;
|
res[i] = b[i] ? TRI_YES : TRI_NO;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
} else
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,10 +284,11 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void updateButtons() {
|
protected void updateButtons() {
|
||||||
bldr = icfg.getEditableBuilder();
|
bldr = (Builder) icfg.getEditableBuilder();
|
||||||
canModify = false;
|
canModify = false;
|
||||||
int[] extStates = calc3states(page, icfg, 1);
|
int[] extStates = calc3states(page, icfg, 1);
|
||||||
|
|
||||||
|
// Stop on error
|
||||||
if (extStates != null) {
|
if (extStates != null) {
|
||||||
setTriSelection(b_stopOnError, extStates[0]);
|
setTriSelection(b_stopOnError, extStates[0]);
|
||||||
b_stopOnError.setEnabled(
|
b_stopOnError.setEnabled(
|
||||||
|
@ -274,39 +300,21 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
bldr.supportsStopOnError(true) &&
|
bldr.supportsStopOnError(true) &&
|
||||||
bldr.supportsStopOnError(false));
|
bldr.supportsStopOnError(false));
|
||||||
}
|
}
|
||||||
// parallel
|
|
||||||
if (extStates == null) // no extended states
|
|
||||||
setTriSelection(b_parallel, getInternalBuilderParallel());
|
|
||||||
else
|
|
||||||
setTriSelection(b_parallel, extStates[3]);
|
|
||||||
|
|
||||||
int n = getParallelNumber();
|
|
||||||
if (n < 0) n = -n;
|
|
||||||
parallelProcesses.setSelection(n);
|
|
||||||
|
|
||||||
b_parallel.setVisible(bldr.supportsParallelBuild());
|
updateParallelBlock();
|
||||||
b_parallelOpt.setVisible(bldr.supportsParallelBuild());
|
|
||||||
b_parallelNum.setVisible(bldr.supportsParallelBuild());
|
|
||||||
parallelProcesses.setVisible(bldr.supportsParallelBuild());
|
|
||||||
|
|
||||||
|
// Build commands
|
||||||
extStates = calc3states(page, icfg, 2);
|
extStates = calc3states(page, icfg, 2);
|
||||||
if (extStates == null) {
|
if (extStates != null) {
|
||||||
setTriSelection(b_autoBuild, bldr.isAutoBuildEnable());
|
// multiple configurations selected
|
||||||
setTriSelection(b_cmdBuild, bldr.isIncrementalBuildEnabled());
|
|
||||||
setTriSelection(b_cmdClean, bldr.isCleanBuildEnabled());
|
|
||||||
b_parallelOpt.setSelection(getParallelDef(icfg));
|
|
||||||
b_parallelNum.setSelection(!getParallelDef(icfg));
|
|
||||||
} else {
|
|
||||||
setTriSelection(b_autoBuild, extStates[0]);
|
setTriSelection(b_autoBuild, extStates[0]);
|
||||||
setTriSelection(b_cmdBuild, extStates[1]);
|
setTriSelection(b_cmdBuild, extStates[1]);
|
||||||
setTriSelection(b_cmdClean, extStates[2]);
|
setTriSelection(b_cmdClean, extStates[2]);
|
||||||
if (extStates[3] == TRI_UNKNOWN) {
|
|
||||||
b_parallelOpt.setSelection(false);
|
|
||||||
b_parallelNum.setSelection(false);
|
|
||||||
} else {
|
} else {
|
||||||
b_parallelOpt.setSelection(getParallelDef(icfg));
|
setTriSelection(b_autoBuild, bldr.isAutoBuildEnable());
|
||||||
b_parallelNum.setSelection(!getParallelDef(icfg));
|
setTriSelection(b_cmdBuild, bldr.isIncrementalBuildEnabled());
|
||||||
}
|
setTriSelection(b_cmdClean, bldr.isCleanBuildEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.isMultiCfg()) {
|
if (page.isMultiCfg()) {
|
||||||
|
@ -321,12 +329,6 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean external = ! isInternalBuilderEnabled();
|
boolean external = ! isInternalBuilderEnabled();
|
||||||
boolean parallel = b_parallel.getSelection();
|
|
||||||
|
|
||||||
b_parallelNum.setEnabled(parallel);
|
|
||||||
b_parallelOpt.setEnabled(parallel);
|
|
||||||
parallelProcesses.setEnabled(parallel & b_parallelNum.getSelection());
|
|
||||||
|
|
||||||
title2.setVisible(external);
|
title2.setVisible(external);
|
||||||
t_autoBuild.setVisible(external);
|
t_autoBuild.setVisible(external);
|
||||||
((Control)t_autoBuild.getData()).setVisible(external);
|
((Control)t_autoBuild.getData()).setVisible(external);
|
||||||
|
@ -343,6 +345,79 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
canModify = true;
|
canModify = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateParallelBlock() {
|
||||||
|
// note: for multi-config selection bldr is from Active cfg
|
||||||
|
|
||||||
|
boolean isParallelSupported = bldr.supportsParallelBuild();
|
||||||
|
boolean isParallelOn = bldr.isParallelBuildOn();
|
||||||
|
int triSelection = isParallelOn ? TRI_YES : TRI_NO;
|
||||||
|
|
||||||
|
int parallelizationNumInternal = bldr.getParallelizationNumAttribute();
|
||||||
|
int optimalParallelNumber = bldr.getOptimalParallelJobNum();
|
||||||
|
int parallelNumber = bldr.getParallelizationNum();
|
||||||
|
|
||||||
|
if (icfg instanceof ICMultiItemsHolder) {
|
||||||
|
IConfiguration[] cfgs = (IConfiguration[])((ICMultiItemsHolder)icfg).getItems();
|
||||||
|
boolean isAnyParallelOn = isParallelOn;
|
||||||
|
boolean isAnyParallelSupported = isParallelSupported;
|
||||||
|
boolean isParallelDiffers = false;
|
||||||
|
for (IConfiguration cfg : cfgs) {
|
||||||
|
Builder builder = (Builder) cfg.getBuilder();
|
||||||
|
isParallelDiffers = isParallelDiffers
|
||||||
|
|| builder.isParallelBuildOn() != isParallelOn
|
||||||
|
|| builder.getParallelizationNumAttribute() != parallelizationNumInternal;
|
||||||
|
|
||||||
|
isAnyParallelOn = isAnyParallelOn || builder.isParallelBuildOn();
|
||||||
|
isAnyParallelSupported = isAnyParallelSupported || builder.supportsParallelBuild();
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset initial display to "optimal" to enhance user experience:
|
||||||
|
if ((!isParallelSupported && isAnyParallelSupported) // parallel is supported by other than Active cfg
|
||||||
|
|| (!isParallelOn && isAnyParallelOn) // prevent showing the 1 job as parallel in the spinner
|
||||||
|
) {
|
||||||
|
isParallelSupported = true;
|
||||||
|
parallelizationNumInternal = -optimalParallelNumber;
|
||||||
|
parallelNumber = optimalParallelNumber;
|
||||||
|
}
|
||||||
|
if (isParallelSupported && isParallelDiffers) {
|
||||||
|
triSelection = TRI_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
b_parallel.setVisible(isParallelSupported);
|
||||||
|
b_parallelOptimal.setVisible(isParallelSupported);
|
||||||
|
b_parallelSpecific.setVisible(isParallelSupported);
|
||||||
|
b_parallelUnlimited.setVisible(isParallelSupported);
|
||||||
|
s_parallelNumber.setVisible(isParallelSupported);
|
||||||
|
|
||||||
|
if (isParallelSupported) {
|
||||||
|
setTriSelection(b_parallel, triSelection);
|
||||||
|
boolean isParallelSelected = b_parallel.getSelection();
|
||||||
|
|
||||||
|
b_parallelOptimal.setText(MessageFormat.format(Messages.BuilderSettingsTab_UseOptimalJobs, optimalParallelNumber));
|
||||||
|
b_parallelOptimal.setEnabled(isParallelSelected);
|
||||||
|
b_parallelSpecific.setEnabled(isParallelSelected);
|
||||||
|
b_parallelUnlimited.setEnabled(isParallelSelected);
|
||||||
|
|
||||||
|
if (isParallelSelected) {
|
||||||
|
boolean isOptimal = parallelizationNumInternal <= 0;
|
||||||
|
boolean isUnlimited = parallelizationNumInternal == Builder.UNLIMITED_JOBS;
|
||||||
|
|
||||||
|
b_parallelOptimal.setSelection(isOptimal);
|
||||||
|
b_parallelSpecific.setSelection(!isOptimal && !isUnlimited);
|
||||||
|
b_parallelUnlimited.setSelection(isUnlimited);
|
||||||
|
s_parallelNumber.setEnabled(b_parallelSpecific.getEnabled() && b_parallelSpecific.getSelection());
|
||||||
|
s_parallelNumber.setSelection(s_parallelNumber.isEnabled() ? parallelNumber : optimalParallelNumber);
|
||||||
|
} else {
|
||||||
|
b_parallelOptimal.setSelection(true);
|
||||||
|
b_parallelSpecific.setSelection(false);
|
||||||
|
b_parallelUnlimited.setSelection(false);
|
||||||
|
s_parallelNumber.setEnabled(false);
|
||||||
|
s_parallelNumber.setSelection(optimalParallelNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets up text + corresponding button
|
* Sets up text + corresponding button
|
||||||
* Checkbox can be implemented either by Button or by TriButton
|
* Checkbox can be implemented either by Button or by TriButton
|
||||||
|
@ -446,7 +521,7 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
}
|
}
|
||||||
b2.setStopOnError(b1.isStopOnError());
|
b2.setStopOnError(b1.isStopOnError());
|
||||||
b2.setParallelBuildOn(b1.isParallelBuildOn());
|
b2.setParallelBuildOn(b1.isParallelBuildOn());
|
||||||
b2.setParallelizationNum(b1.getParallelizationNum());
|
b2.setParallelizationNum(((Builder) b1).getParallelizationNumAttribute());
|
||||||
if (b2.canKeepEnvironmentVariablesInBuildfile())
|
if (b2.canKeepEnvironmentVariablesInBuildfile())
|
||||||
b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
|
b2.setKeepEnvironmentVariablesInBuildfile(b1.keepEnvironmentVariablesInBuildfile());
|
||||||
((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
|
((Builder)b2).setBuildPath(((Builder)b1).getBuildPathAttribute());
|
||||||
|
@ -488,14 +563,6 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
updateData(getResDesc());
|
updateData(getResDesc());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean getParallelDef(IConfiguration cfg) {
|
|
||||||
if (cfg instanceof Configuration)
|
|
||||||
return ((Configuration)cfg).getParallelDef();
|
|
||||||
if (cfg instanceof IMultiConfiguration)
|
|
||||||
return ((IMultiConfiguration)cfg).getParallelDef();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setParallelDef(boolean def) {
|
private void setParallelDef(boolean def) {
|
||||||
if (icfg instanceof Configuration)
|
if (icfg instanceof Configuration)
|
||||||
((Configuration)icfg).setParallelDef(def);
|
((Configuration)icfg).setParallelDef(def);
|
||||||
|
@ -503,13 +570,6 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
((IMultiConfiguration)icfg).setParallelDef(def);
|
((IMultiConfiguration)icfg).setParallelDef(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getParallelNumber() {
|
|
||||||
if (icfg instanceof Configuration)
|
|
||||||
return ((Configuration)icfg).getParallelNumber();
|
|
||||||
if (icfg instanceof IMultiConfiguration)
|
|
||||||
return ((IMultiConfiguration)icfg).getParallelNumber();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
private void setParallelNumber(int num) {
|
private void setParallelNumber(int num) {
|
||||||
if (icfg instanceof Configuration)
|
if (icfg instanceof Configuration)
|
||||||
((Configuration)icfg).setParallelNumber(num);
|
((Configuration)icfg).setParallelNumber(num);
|
||||||
|
@ -517,14 +577,6 @@ public class BuildBehaviourTab extends AbstractCBuildPropertyTab {
|
||||||
((IMultiConfiguration)icfg).setParallelNumber(num);
|
((IMultiConfiguration)icfg).setParallelNumber(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getInternalBuilderParallel() {
|
|
||||||
if (icfg instanceof Configuration)
|
|
||||||
return ((Configuration)icfg).getInternalBuilderParallel();
|
|
||||||
if (icfg instanceof IMultiConfiguration)
|
|
||||||
return ((IMultiConfiguration)icfg).getInternalBuilderParallel();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isInternalBuilderEnabled() {
|
private boolean isInternalBuilderEnabled() {
|
||||||
if (icfg instanceof Configuration)
|
if (icfg instanceof Configuration)
|
||||||
return ((Configuration)icfg).isInternalBuilderEnabled();
|
return ((Configuration)icfg).isInternalBuilderEnabled();
|
||||||
|
|
|
@ -87,6 +87,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
setupLabel(g1, Messages.BuilderSettingsTab_5, 1, GridData.BEGINNING);
|
setupLabel(g1, Messages.BuilderSettingsTab_5, 1, GridData.BEGINNING);
|
||||||
t_buildCmd = setupBlock(g1, b_useDefault);
|
t_buildCmd = setupBlock(g1, b_useDefault);
|
||||||
t_buildCmd.addModifyListener(new ModifyListener() {
|
t_buildCmd.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
if (! canModify)
|
if (! canModify)
|
||||||
return;
|
return;
|
||||||
|
@ -111,6 +112,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
setupLabel(group_dir, Messages.BuilderSettingsTab_22, 1, GridData.BEGINNING);
|
setupLabel(group_dir, Messages.BuilderSettingsTab_22, 1, GridData.BEGINNING);
|
||||||
t_dir = setupText(group_dir, 1, GridData.FILL_HORIZONTAL);
|
t_dir = setupText(group_dir, 1, GridData.FILL_HORIZONTAL);
|
||||||
t_dir.addModifyListener(new ModifyListener() {
|
t_dir.addModifyListener(new ModifyListener() {
|
||||||
|
@Override
|
||||||
public void modifyText(ModifyEvent e) {
|
public void modifyText(ModifyEvent e) {
|
||||||
if (canModify)
|
if (canModify)
|
||||||
setBuildPath(t_dir.getText());
|
setBuildPath(t_dir.getText());
|
||||||
|
@ -171,7 +173,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
canEnableInternalBuilder(true) &&
|
canEnableInternalBuilder(true) &&
|
||||||
canEnableInternalBuilder(false));
|
canEnableInternalBuilder(false));
|
||||||
|
|
||||||
t_buildCmd.setText(getMC());
|
t_buildCmd.setText(getMakeCommand());
|
||||||
|
|
||||||
if (page.isMultiCfg()) {
|
if (page.isMultiCfg()) {
|
||||||
group_dir.setVisible(false);
|
group_dir.setVisible(false);
|
||||||
|
@ -293,11 +295,14 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
||||||
/**
|
/**
|
||||||
* @return make command
|
* @return make command
|
||||||
*/
|
*/
|
||||||
private String getMC() {
|
private String getMakeCommand() {
|
||||||
String makeCommand = bldr.getCommand();
|
String makeCommand = icfg.getBuildCommand();
|
||||||
String makeArgs = bldr.getArguments();
|
String makeArgs = icfg.getBuildArguments();
|
||||||
if (makeArgs != null) { makeCommand += " " + makeArgs; } //$NON-NLS-1$
|
|
||||||
return makeCommand;
|
if (!makeCommand.isEmpty() && makeArgs != null) {
|
||||||
|
return makeCommand + " " + makeArgs; //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
return EMPTY_STR;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Performs common settings for all controls
|
* Performs common settings for all controls
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2010, 2011 Tomasz Wesolowski and others
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Tomasz Wesolowski - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
|
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
|
||||||
|
|
||||||
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
||||||
|
@ -18,7 +28,7 @@ public class CaseBreakQuickFixTest extends QuickFixTestCase {
|
||||||
// case 2:
|
// case 2:
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
public void testMiddleCase() {
|
public void testMiddleCase() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("break; case 2:", result);
|
assertContainedIn("break; case 2:", result);
|
||||||
|
@ -31,11 +41,12 @@ public class CaseBreakQuickFixTest extends QuickFixTestCase {
|
||||||
// hello();
|
// hello();
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
public void testLastCase() {
|
public void testLastCase() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("break; }", result);
|
assertContainedIn("break; }", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void func() {
|
// void func() {
|
||||||
// int a;
|
// int a;
|
||||||
// switch(a) {
|
// switch(a) {
|
||||||
|
@ -44,9 +55,9 @@ public class CaseBreakQuickFixTest extends QuickFixTestCase {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
public void testLastCaseComp() {
|
public void testLastCaseComp() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("hello(); break;", result);
|
assertContainedIn("hello();\t\tbreak;", result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,5 +93,4 @@ public class CatchByReferenceQuickFixTest extends QuickFixTestCase {
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("catch (const C &)", result); //$NON-NLS-1$
|
assertContainedIn("catch (const C &)", result); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase {
|
||||||
// void func() {
|
// void func() {
|
||||||
// aChar = 'a';
|
// aChar = 'a';
|
||||||
// }
|
// }
|
||||||
public void testChar() {
|
public void testChar() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("char aChar;", result); //$NON-NLS-1$
|
assertContainedIn("char aChar;", result); //$NON-NLS-1$
|
||||||
|
@ -52,7 +52,7 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase {
|
||||||
// void func() {
|
// void func() {
|
||||||
// aDouble = 40.;
|
// aDouble = 40.;
|
||||||
// }
|
// }
|
||||||
public void testDouble() {
|
public void testDouble() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("double aDouble;", result); //$NON-NLS-1$
|
assertContainedIn("double aDouble;", result); //$NON-NLS-1$
|
||||||
|
@ -61,25 +61,25 @@ public class CreateLocalVariableQuickFixTest extends QuickFixTestCase {
|
||||||
// void func() {
|
// void func() {
|
||||||
// aString = "foo";
|
// aString = "foo";
|
||||||
// }
|
// }
|
||||||
public void testString() {
|
public void testString() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("const char *aString;", result); //$NON-NLS-1$
|
assertContainedIn("const char* aString;", result); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
// void func() {
|
// void func() {
|
||||||
// aWString = L"foo";
|
// aWString = L"foo";
|
||||||
// }
|
// }
|
||||||
public void testWString() {
|
public void testWString() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("const wchar_t *aWString;", result); //$NON-NLS-1$
|
assertContainedIn("const wchar_t* aWString;", result); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
// void func() {
|
// void func() {
|
||||||
// aFuncPtr = func;
|
// aFuncPtr = func;
|
||||||
// }
|
// }
|
||||||
public void testFuncPtr() {
|
public void testFuncPtr() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("void (*aFuncPtr)();", result); //$NON-NLS-1$
|
assertContainedIn("void (*aFuncPtr)();", result); //$NON-NLS-1$
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.eclipse.cdt.codan.core.test.CheckerTestCase;
|
||||||
import org.eclipse.cdt.codan.core.test.TestUtils;
|
import org.eclipse.cdt.codan.core.test.TestUtils;
|
||||||
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
|
import org.eclipse.cdt.codan.internal.ui.CodanUIActivator;
|
||||||
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
@ -27,12 +26,12 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.PartInitException;
|
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: add description
|
* Abstract base class for Quck Fix tests.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public abstract class QuickFixTestCase extends CheckerTestCase {
|
public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
AbstractCodanCMarkerResolution quickFix;
|
AbstractCodanCMarkerResolution quickFix;
|
||||||
Display display;
|
Display display;
|
||||||
|
@ -60,7 +59,7 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||||
IWorkbenchPage activePage = window.getActivePage();
|
IWorkbenchPage activePage = window.getActivePage();
|
||||||
IWorkbenchPart activePart = activePage.getActivePart();
|
IWorkbenchPart activePart = activePage.getActivePart();
|
||||||
if (activePart.getTitle().equals("Welcome")) {
|
if (activePart.getTitle().equals("Welcome")) { //$NON-NLS-1$
|
||||||
//activePage.close();
|
//activePage.close();
|
||||||
activePart.dispose();
|
activePart.dispose();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +68,6 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
@ -77,7 +75,7 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
display = PlatformUI.getWorkbench().getDisplay();
|
display = PlatformUI.getWorkbench().getDisplay();
|
||||||
closeWelcome();
|
closeWelcome();
|
||||||
IPreferenceStore store = CodanUIActivator.getDefault().getPreferenceStore(cproject.getProject());
|
IPreferenceStore store = CodanUIActivator.getDefault().getPreferenceStore(cproject.getProject());
|
||||||
// turn off editor reconsiler
|
// turn off editor reconciler
|
||||||
store.setValue(PreferenceConstants.P_RUN_IN_EDITOR, false);
|
store.setValue(PreferenceConstants.P_RUN_IN_EDITOR, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,31 +103,15 @@ public abstract class QuickFixTestCase extends CheckerTestCase {
|
||||||
return new TextSelection(code.indexOf(string), string.length());
|
return new TextSelection(code.indexOf(string), string.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public String runQuickFixOneFile() throws IOException, CoreException {
|
||||||
* @return
|
|
||||||
* @throws CModelException
|
|
||||||
* @throws PartInitException
|
|
||||||
* @throws IOException
|
|
||||||
* @throws CoreException
|
|
||||||
*/
|
|
||||||
public String runQuickFixOneFile() {
|
|
||||||
// need to load before running codan because otherwise marker is lost when doing quick fix 8[]
|
// need to load before running codan because otherwise marker is lost when doing quick fix 8[]
|
||||||
try {
|
|
||||||
runCodan();
|
runCodan();
|
||||||
doRunQuickFix();
|
doRunQuickFix();
|
||||||
dispatch(500);
|
dispatch(500);
|
||||||
String result = TestUtils.loadFile(currentIFile.getContents());
|
String result = TestUtils.loadFile(currentIFile.getContents());
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
fail(e.getMessage());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public void doRunQuickFix() {
|
public void doRunQuickFix() {
|
||||||
for (int i = 0; i < markers.length; i++) {
|
for (int i = 0; i < markers.length; i++) {
|
||||||
IMarker marker = markers[i];
|
IMarker marker = markers[i];
|
||||||
|
|
|
@ -10,21 +10,18 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
|
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
|
||||||
import org.eclipse.cdt.codan.core.test.TestUtils;
|
import org.eclipse.cdt.codan.core.test.TestUtils;
|
||||||
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
|
||||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for quick fix for suggested parenthesis
|
* Test for quick fix for suggested parenthesis
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("restriction")
|
||||||
public class SuggestedParenthesisQuickFixTest extends QuickFixTestCase {
|
public class SuggestedParenthesisQuickFixTest extends QuickFixTestCase {
|
||||||
@SuppressWarnings("restriction")
|
|
||||||
@Override
|
@Override
|
||||||
public AbstractCodanCMarkerResolution createQuickFix() {
|
public AbstractCodanCMarkerResolution createQuickFix() {
|
||||||
return new SuggestedParenthesisQuickFix();
|
return new SuggestedParenthesisQuickFix();
|
||||||
|
@ -34,7 +31,7 @@ public class SuggestedParenthesisQuickFixTest extends QuickFixTestCase {
|
||||||
// int a=1,b=3;
|
// int a=1,b=3;
|
||||||
// if (b+a && a>b || b-a) b--; // error here
|
// if (b+a && a>b || b-a) b--; // error here
|
||||||
// }
|
// }
|
||||||
public void testSimple() throws IOException, CoreException {
|
public void testSimple() throws Exception {
|
||||||
loadcode(getAboveComment());
|
loadcode(getAboveComment());
|
||||||
String result = runQuickFixOneFile();
|
String result = runQuickFixOneFile();
|
||||||
assertContainedIn("(b+a && a>b)", result); //$NON-NLS-1$
|
assertContainedIn("(b+a && a>b)", result); //$NON-NLS-1$
|
||||||
|
@ -52,13 +49,12 @@ public class SuggestedParenthesisQuickFixTest extends QuickFixTestCase {
|
||||||
* this test is using two files, there was not actually bugs here so
|
* this test is using two files, there was not actually bugs here so
|
||||||
* quick fix is not called
|
* quick fix is not called
|
||||||
*/
|
*/
|
||||||
public void test2FilesExample() throws FileNotFoundException, IOException {
|
public void test2FilesExample() throws Exception {
|
||||||
CharSequence[] code = getContents(2);
|
CharSequence[] code = getContents(2);
|
||||||
File f1 = loadcode(code[0].toString());
|
File f1 = loadcode(code[0].toString());
|
||||||
File f2 = loadcode(code[1].toString());
|
File f2 = loadcode(code[1].toString());
|
||||||
// lets pretend marker is found in main.c but fixes go in both files,
|
// lets pretend marker is found in main.c but fixes go in both files,
|
||||||
// to check do something like this
|
// to check do something like this
|
||||||
try {
|
|
||||||
EditorUtility.openInEditor(f2);
|
EditorUtility.openInEditor(f2);
|
||||||
runCodan();
|
runCodan();
|
||||||
doRunQuickFix();
|
doRunQuickFix();
|
||||||
|
@ -66,9 +62,5 @@ public class SuggestedParenthesisQuickFixTest extends QuickFixTestCase {
|
||||||
String result_header = TestUtils.loadFile(new FileInputStream(f1));
|
String result_header = TestUtils.loadFile(new FileInputStream(f1));
|
||||||
assertContainedIn("foo", result_main); //$NON-NLS-1$
|
assertContainedIn("foo", result_main); //$NON-NLS-1$
|
||||||
assertContainedIn("foo", result_header); //$NON-NLS-1$
|
assertContainedIn("foo", result_header); //$NON-NLS-1$
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
fail(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
0
core/org.eclipse.cdt.core.macosx/os/macosx/x86/libpty.jnilib
Executable file → Normal file
0
core/org.eclipse.cdt.core.macosx/os/macosx/x86/libpty.jnilib
Executable file → Normal file
0
core/org.eclipse.cdt.core.macosx/os/macosx/x86/libspawner.jnilib
Executable file → Normal file
0
core/org.eclipse.cdt.core.macosx/os/macosx/x86/libspawner.jnilib
Executable file → Normal file
|
@ -266,8 +266,7 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
assertNoProblemBindings(col);
|
assertNoProblemBindings(col);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IASTTranslationUnit parseAndCheckBindings(String code) throws Exception
|
protected IASTTranslationUnit parseAndCheckBindings(String code) throws Exception {
|
||||||
{
|
|
||||||
IASTTranslationUnit tu = parse(code, ParserLanguage.CPP);
|
IASTTranslationUnit tu = parse(code, ParserLanguage.CPP);
|
||||||
CPPNameCollector col = new CPPNameCollector();
|
CPPNameCollector col = new CPPNameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
@ -285,8 +284,7 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
return new BindingAssertionHelper(code, true);
|
return new BindingAssertionHelper(code, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBug40422() throws Exception
|
public void testBug40422() throws Exception {
|
||||||
{
|
|
||||||
IASTTranslationUnit tu = parse("class A { int y; }; int A::* x = 0;", ParserLanguage.CPP); //$NON-NLS-1$
|
IASTTranslationUnit tu = parse("class A { int y; }; int A::* x = 0;", ParserLanguage.CPP); //$NON-NLS-1$
|
||||||
CPPNameCollector col = new CPPNameCollector();
|
CPPNameCollector col = new CPPNameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
|
|
@ -5574,4 +5574,13 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testDependentUsingDeclaration() throws Exception {
|
public void testDependentUsingDeclaration() throws Exception {
|
||||||
parseAndCheckBindings();
|
parseAndCheckBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// template <int> void* foo(int);
|
||||||
|
// template <typename T> void f(T t) {
|
||||||
|
// if (T* i = foo<0>(0))
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
public void testDirectlyNestedAmbiguity_362976() throws Exception {
|
||||||
|
parseAndCheckBindings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2011 Google, Inc and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Sergey Prigogin (Google) - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
|
||||||
|
import org.eclipse.cdt.internal.core.parser.ParserException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for ClassTypeHelper class.
|
||||||
|
*/
|
||||||
|
public class ClassTypeHelperTests extends AST2BaseTest {
|
||||||
|
|
||||||
|
public ClassTypeHelperTests() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClassTypeHelperTests(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TestSuite suite() {
|
||||||
|
return suite(ClassTypeHelperTests.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected BindingAssertionHelper getAssertionHelper() throws ParserException, IOException {
|
||||||
|
String code= getAboveComment();
|
||||||
|
return new BindingAssertionHelper(code, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// struct A {
|
||||||
|
// A(const A& a);
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class B {
|
||||||
|
// public:
|
||||||
|
// B();
|
||||||
|
// int x;
|
||||||
|
// A* y;
|
||||||
|
// const A& z;
|
||||||
|
// static A s;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class C {
|
||||||
|
// public:
|
||||||
|
// A a;
|
||||||
|
// };
|
||||||
|
public void testHasTrivialCopyCtor() throws Exception {
|
||||||
|
BindingAssertionHelper helper = getAssertionHelper();
|
||||||
|
ICPPClassType classA = helper.assertNonProblem("A {", 1, ICPPClassType.class);
|
||||||
|
assertFalse(ClassTypeHelper.hasTrivialCopyCtor(classA));
|
||||||
|
ICPPClassType classB = helper.assertNonProblem("B {", 1, ICPPClassType.class);
|
||||||
|
assertTrue(ClassTypeHelper.hasTrivialCopyCtor(classB));
|
||||||
|
ICPPClassType classC = helper.assertNonProblem("C {", 1, ICPPClassType.class);
|
||||||
|
assertFalse(ClassTypeHelper.hasTrivialCopyCtor(classC));
|
||||||
|
}
|
||||||
|
|
||||||
|
// struct A {
|
||||||
|
// ~A();
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class B {
|
||||||
|
// public:
|
||||||
|
// B();
|
||||||
|
// B(const B& a);
|
||||||
|
// int x;
|
||||||
|
// B* y;
|
||||||
|
// const B& z;
|
||||||
|
// static A s;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class C {
|
||||||
|
// public:
|
||||||
|
// A a;
|
||||||
|
// };
|
||||||
|
public void testHasTrivialDestructor() throws Exception {
|
||||||
|
BindingAssertionHelper helper = getAssertionHelper();
|
||||||
|
ICPPClassType classA = helper.assertNonProblem("A {", 1, ICPPClassType.class);
|
||||||
|
assertFalse(ClassTypeHelper.hasTrivialDestructor(classA));
|
||||||
|
ICPPClassType classB = helper.assertNonProblem("B {", 1, ICPPClassType.class);
|
||||||
|
assertTrue(ClassTypeHelper.hasTrivialDestructor(classB));
|
||||||
|
ICPPClassType classC = helper.assertNonProblem("C {", 1, ICPPClassType.class);
|
||||||
|
assertFalse(ClassTypeHelper.hasTrivialDestructor(classC));
|
||||||
|
}
|
||||||
|
|
||||||
|
// struct A {
|
||||||
|
// virtual void m();
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class B {
|
||||||
|
// public:
|
||||||
|
// B();
|
||||||
|
// B(const B& a);
|
||||||
|
// void m();
|
||||||
|
// int x;
|
||||||
|
// B* y;
|
||||||
|
// const B& z;
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// class C : public A {
|
||||||
|
// };
|
||||||
|
public void testIsPolymorphic() throws Exception {
|
||||||
|
BindingAssertionHelper helper = getAssertionHelper();
|
||||||
|
ICPPClassType classA = helper.assertNonProblem("A {", 1, ICPPClassType.class);
|
||||||
|
assertTrue(ClassTypeHelper.isPolymorphic(classA));
|
||||||
|
ICPPClassType classB = helper.assertNonProblem("B {", 1, ICPPClassType.class);
|
||||||
|
assertFalse(ClassTypeHelper.isPolymorphic(classB));
|
||||||
|
ICPPClassType classC = helper.assertNonProblem("C", 1, ICPPClassType.class);
|
||||||
|
assertTrue(ClassTypeHelper.isPolymorphic(classC));
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,6 +30,7 @@ public class DOMParserTestSuite extends TestCase {
|
||||||
suite.addTest(ASTCPPSpecDefectTests.suite());
|
suite.addTest(ASTCPPSpecDefectTests.suite());
|
||||||
suite.addTest(AST2CPPImplicitNameTests.suite());
|
suite.addTest(AST2CPPImplicitNameTests.suite());
|
||||||
suite.addTest(AST2TemplateTests.suite());
|
suite.addTest(AST2TemplateTests.suite());
|
||||||
|
suite.addTest(ClassTypeHelperTests.suite());
|
||||||
suite.addTestSuite(QuickParser2Tests.class);
|
suite.addTestSuite(QuickParser2Tests.class);
|
||||||
suite.addTest(CompleteParser2Tests.suite());
|
suite.addTest(CompleteParser2Tests.suite());
|
||||||
suite.addTest(DOMLocationTests.suite());
|
suite.addTest(DOMLocationTests.suite());
|
||||||
|
|
|
@ -27,7 +27,6 @@ import org.eclipse.jface.text.TextSelection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Guido Zgraggen IFS
|
* @author Guido Zgraggen IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public abstract class RewriteBaseTest extends BaseTestFramework implements ILogListener{
|
public abstract class RewriteBaseTest extends BaseTestFramework implements ILogListener{
|
||||||
protected static final NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
|
protected static final NullProgressMonitor NULL_PROGRESS_MONITOR = new NullProgressMonitor();
|
||||||
|
@ -50,36 +49,36 @@ public abstract class RewriteBaseTest extends BaseTestFramework implements ILogL
|
||||||
@Override
|
@Override
|
||||||
protected abstract void runTest() throws Throwable;
|
protected abstract void runTest() throws Throwable;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
for (TestSourceFile testFile : fileMap.values()) {
|
for (TestSourceFile testFile : fileMap.values()) {
|
||||||
if(testFile.getSource().length() > 0) {
|
if (testFile.getSource().length() > 0) {
|
||||||
importFile(testFile.getName(), testFile.getSource());
|
importFile(testFile.getName(), testFile.getSource());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void assertEquals(TestSourceFile file, IFile file2) throws Exception {
|
protected void assertEquals(TestSourceFile file, IFile file2) throws Exception {
|
||||||
StringBuffer code = getCodeFromIFile(file2);
|
StringBuilder code = getCodeFromFile(file2);
|
||||||
assertEquals(file.getExpectedSource(), TestHelper.unifyNewLines(code.toString()));
|
assertEquals(file.getExpectedSource(), TestHelper.unifyNewLines(code.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void compareFiles(Map<String,TestSourceFile> testResourceFiles) throws Exception {
|
protected void compareFiles(Map<String, TestSourceFile> testResourceFiles) throws Exception {
|
||||||
for (String fileName : testResourceFiles.keySet()) {
|
for (String fileName : testResourceFiles.keySet()) {
|
||||||
TestSourceFile file = testResourceFiles.get(fileName);
|
TestSourceFile file = testResourceFiles.get(fileName);
|
||||||
IFile iFile = project.getFile(new Path(fileName));
|
IFile iFile = project.getFile(new Path(fileName));
|
||||||
StringBuffer code = getCodeFromIFile(iFile);
|
StringBuilder code = getCodeFromFile(iFile);
|
||||||
assertEquals(TestHelper.unifyNewLines(file.getExpectedSource()), TestHelper.unifyNewLines(code.toString()));
|
assertEquals(TestHelper.unifyNewLines(file.getExpectedSource()),
|
||||||
|
TestHelper.unifyNewLines(code.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StringBuffer getCodeFromIFile(IFile file) throws Exception {
|
protected StringBuilder getCodeFromFile(IFile file) throws Exception {
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(file.getContents()));
|
BufferedReader br = new BufferedReader(new InputStreamReader(file.getContents()));
|
||||||
StringBuffer code = new StringBuffer();
|
StringBuilder code = new StringBuilder();
|
||||||
String line;
|
String line;
|
||||||
while((line = br.readLine()) != null) {
|
while ((line = br.readLine()) != null) {
|
||||||
code.append(line);
|
code.append(line);
|
||||||
code.append('\n');
|
code.append('\n');
|
||||||
}
|
}
|
||||||
|
@ -96,10 +95,10 @@ public abstract class RewriteBaseTest extends BaseTestFramework implements ILogL
|
||||||
|
|
||||||
public void logging(IStatus status, String plugin) {
|
public void logging(IStatus status, String plugin) {
|
||||||
Throwable ex = status.getException();
|
Throwable ex = status.getException();
|
||||||
StringBuffer stackTrace = new StringBuffer();
|
StringBuilder stackTrace = new StringBuilder();
|
||||||
if(ex != null) {
|
if (ex != null) {
|
||||||
stackTrace.append('\n');
|
stackTrace.append('\n');
|
||||||
for(StackTraceElement ste : ex.getStackTrace()) {
|
for (StackTraceElement ste : ex.getStackTrace()) {
|
||||||
stackTrace.append(ste.toString());
|
stackTrace.append(ste.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,8 @@ import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf
|
* @author Emanuel Graf
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class RewriteTester extends TestSuite{
|
public class RewriteTester extends TestSuite {
|
||||||
|
|
||||||
enum MatcherState{skip, inTest, inSource, inExpectedResult}
|
enum MatcherState{skip, inTest, inSource, inExpectedResult}
|
||||||
|
|
||||||
private static final String classRegexp = "//#(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
private static final String classRegexp = "//#(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
||||||
|
@ -44,7 +42,7 @@ public class RewriteTester extends TestSuite{
|
||||||
private static final String fileRegexp = "//@(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
private static final String fileRegexp = "//@(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
||||||
private static final String resultRegexp = "//=.*$"; //$NON-NLS-1$
|
private static final String resultRegexp = "//=.*$"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static Test suite(String name, String file)throws Exception {
|
public static Test suite(String name, String file) throws Exception {
|
||||||
BufferedReader in = createReader(file);
|
BufferedReader in = createReader(file);
|
||||||
|
|
||||||
ArrayList<RewriteBaseTest> testCases = createTests(in);
|
ArrayList<RewriteBaseTest> testCases = createTests(in);
|
||||||
|
@ -60,7 +58,6 @@ public class RewriteTester extends TestSuite{
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
||||||
|
|
||||||
String line;
|
String line;
|
||||||
Vector<TestSourceFile> files = new Vector<TestSourceFile>();
|
Vector<TestSourceFile> files = new Vector<TestSourceFile>();
|
||||||
TestSourceFile actFile = null;
|
TestSourceFile actFile = null;
|
||||||
|
@ -70,10 +67,9 @@ public class RewriteTester extends TestSuite{
|
||||||
String className = null;
|
String className = null;
|
||||||
boolean bevorFirstTest = true;
|
boolean bevorFirstTest = true;
|
||||||
|
|
||||||
while ((line = inputReader.readLine()) != null){
|
while ((line = inputReader.readLine()) != null) {
|
||||||
|
if (lineMatchesBeginOfTest(line)) {
|
||||||
if(lineMatchesBeginOfTest(line)) {
|
if (!bevorFirstTest) {
|
||||||
if(!bevorFirstTest) {
|
|
||||||
RewriteBaseTest test = createTestClass(className, testName, files);
|
RewriteBaseTest test = createTestClass(className, testName, files);
|
||||||
testCases.add(test);
|
testCases.add(test);
|
||||||
files = new Vector<TestSourceFile>();
|
files = new Vector<TestSourceFile>();
|
||||||
|
@ -87,24 +83,24 @@ public class RewriteTester extends TestSuite{
|
||||||
} else if (lineMatchesBeginOfResult(line)) {
|
} else if (lineMatchesBeginOfResult(line)) {
|
||||||
matcherState = MatcherState.inExpectedResult;
|
matcherState = MatcherState.inExpectedResult;
|
||||||
continue;
|
continue;
|
||||||
}else if (lineMatchesFileName(line)) {
|
} else if (lineMatchesFileName(line)) {
|
||||||
matcherState = MatcherState.inSource;
|
matcherState = MatcherState.inSource;
|
||||||
actFile = new TestSourceFile(getFileName(line));
|
actFile = new TestSourceFile(getFileName(line));
|
||||||
files.add(actFile);
|
files.add(actFile);
|
||||||
continue;
|
continue;
|
||||||
}else if(lineMatchesClassName(line)) {
|
} else if (lineMatchesClassName(line)) {
|
||||||
className = getNameOfClass(line);
|
className = getNameOfClass(line);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(matcherState) {
|
switch (matcherState) {
|
||||||
case inSource:
|
case inSource:
|
||||||
if(actFile != null) {
|
if (actFile != null) {
|
||||||
actFile.addLineToSource(line);
|
actFile.addLineToSource(line);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case inExpectedResult:
|
case inExpectedResult:
|
||||||
if(actFile != null) {
|
if (actFile != null) {
|
||||||
actFile.addLineToExpectedSource(line);
|
actFile.addLineToExpectedSource(line);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -117,11 +113,8 @@ public class RewriteTester extends TestSuite{
|
||||||
return testCases;
|
return testCases;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static RewriteBaseTest createTestClass(String className, String testName,
|
||||||
|
Vector<TestSourceFile> files) throws Exception {
|
||||||
private static RewriteBaseTest createTestClass(String className, String testName, Vector<TestSourceFile> files) throws Exception {
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Class<?> refClass = Class.forName(className);
|
Class<?> refClass = Class.forName(className);
|
||||||
Class<?> paratypes[] = new Class[2];
|
Class<?> paratypes[] = new Class[2];
|
||||||
|
@ -134,7 +127,7 @@ public class RewriteTester extends TestSuite{
|
||||||
RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(arglist);
|
RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(arglist);
|
||||||
for (TestSourceFile file : files) {
|
for (TestSourceFile file : files) {
|
||||||
TextSelection sel = file.getSelection();
|
TextSelection sel = file.getSelection();
|
||||||
if(sel != null) {
|
if (sel != null) {
|
||||||
test.setFileWithSelection(file.getName());
|
test.setFileWithSelection(file.getName());
|
||||||
test.setSelection(sel);
|
test.setSelection(sel);
|
||||||
break;
|
break;
|
||||||
|
@ -142,7 +135,8 @@ public class RewriteTester extends TestSuite{
|
||||||
}
|
}
|
||||||
return test;
|
return test;
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
throw new Exception("Unknown TestClass: " + e.getMessage() + ". Make sure the test's sourcefile specifies a valid test class.");
|
throw new Exception("Unknown TestClass: " + e.getMessage() +
|
||||||
|
". Make sure the test's sourcefile specifies a valid test class.");
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
throw new Exception("Security Exception during Test creation", e);
|
throw new Exception("Security Exception during Test creation", e);
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
|
@ -160,17 +154,15 @@ public class RewriteTester extends TestSuite{
|
||||||
|
|
||||||
private static String getFileName(String line) {
|
private static String getFileName(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(fileRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(fileRegexp, line);
|
||||||
if(matcherBeginOfTest.find())
|
if (matcherBeginOfTest.find())
|
||||||
return matcherBeginOfTest.group(1);
|
return matcherBeginOfTest.group(1);
|
||||||
else
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getNameOfClass(String line) {
|
private static String getNameOfClass(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(classRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(classRegexp, line);
|
||||||
if(matcherBeginOfTest.find())
|
if (matcherBeginOfTest.find())
|
||||||
return matcherBeginOfTest.group(1);
|
return matcherBeginOfTest.group(1);
|
||||||
else
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,9 +184,8 @@ public class RewriteTester extends TestSuite{
|
||||||
|
|
||||||
private static String getNameOfTest(String line) {
|
private static String getNameOfTest(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(testRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(testRegexp, line);
|
||||||
if(matcherBeginOfTest.find())
|
if (matcherBeginOfTest.find())
|
||||||
return matcherBeginOfTest.group(1);
|
return matcherBeginOfTest.group(1);
|
||||||
else
|
|
||||||
return "Not Named";
|
return "Not Named";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +196,7 @@ public class RewriteTester extends TestSuite{
|
||||||
private static TestSuite createSuite(ArrayList<RewriteBaseTest> testCases, String name) {
|
private static TestSuite createSuite(ArrayList<RewriteBaseTest> testCases, String name) {
|
||||||
TestSuite suite = new TestSuite(name);
|
TestSuite suite = new TestSuite(name);
|
||||||
Iterator<RewriteBaseTest> it = testCases.iterator();
|
Iterator<RewriteBaseTest> it = testCases.iterator();
|
||||||
while(it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
RewriteBaseTest subject =it.next();
|
RewriteBaseTest subject =it.next();
|
||||||
suite.addTest(subject);
|
suite.addTest(subject);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,8 @@ import org.eclipse.jface.text.TextSelection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf
|
* @author Emanuel Graf
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class TestSourceFile {
|
public class TestSourceFile {
|
||||||
|
|
||||||
private static final String REPLACEMENT = ""; //$NON-NLS-1$
|
private static final String REPLACEMENT = ""; //$NON-NLS-1$
|
||||||
private String name;
|
private String name;
|
||||||
private StringBuffer source = new StringBuffer();
|
private StringBuffer source = new StringBuffer();
|
||||||
|
@ -39,29 +37,32 @@ public class TestSourceFile {
|
||||||
super();
|
super();
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExpectedSource() {
|
public String getExpectedSource() {
|
||||||
String exp = expectedSource.toString();
|
String exp = expectedSource.toString();
|
||||||
if(exp.length() == 0) {
|
if (exp.length() == 0) {
|
||||||
return getSource();
|
return getSource();
|
||||||
}else {
|
} else {
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSource() {
|
public String getSource() {
|
||||||
return source.toString();
|
return source.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLineToSource(String code) {
|
public void addLineToSource(String code) {
|
||||||
Matcher start = createMatcherFromString(selectionStartLineRegex, code);
|
Matcher start = createMatcherFromString(selectionStartLineRegex, code);
|
||||||
if(start.matches()) {
|
if (start.matches()) {
|
||||||
selectionStart = start.start(2) + source.length();
|
selectionStart = start.start(2) + source.length();
|
||||||
code = code.replaceAll(selectionStartRegex, REPLACEMENT);
|
code = code.replaceAll(selectionStartRegex, REPLACEMENT);
|
||||||
}
|
}
|
||||||
Matcher end = createMatcherFromString(selectionEndLineRegex, code);
|
Matcher end = createMatcherFromString(selectionEndLineRegex, code);
|
||||||
if(end.matches()) {
|
if (end.matches()) {
|
||||||
selectionEnd = end.start(2) + source.length();
|
selectionEnd = end.start(2) + source.length();
|
||||||
code = code.replaceAll(selectionEndRegex, REPLACEMENT);
|
code = code.replaceAll(selectionEndRegex, REPLACEMENT);
|
||||||
}
|
}
|
||||||
|
@ -75,12 +76,10 @@ public class TestSourceFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextSelection getSelection() {
|
public TextSelection getSelection() {
|
||||||
if(selectionStart < 0 || selectionEnd <0 ) {
|
if (selectionStart < 0 || selectionEnd <0 )
|
||||||
return null;
|
return null;
|
||||||
}else {
|
|
||||||
return new TextSelection(selectionStart, selectionEnd -selectionStart);
|
return new TextSelection(selectionStart, selectionEnd -selectionStart);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected static Matcher createMatcherFromString(String pattern, String line) {
|
protected static Matcher createMatcherFromString(String pattern, String line) {
|
||||||
return Pattern.compile(pattern).matcher(line);
|
return Pattern.compile(pattern).matcher(line);
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class ASTWriterTest extends RewriteBaseTest {
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
for (TestSourceFile testFile : fileMap.values()) {
|
for (TestSourceFile testFile : fileMap.values()) {
|
||||||
if(testFile.getSource().length() > 0) {
|
if (testFile.getSource().length() > 0) {
|
||||||
file = importFile(testFile.getName(), testFile.getSource());
|
file = importFile(testFile.getName(), testFile.getSource());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,11 +70,12 @@ public class ASTWriterTest extends RewriteBaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void compareFiles(Map<String,TestSourceFile> testResourceFiles) throws Exception {
|
protected void compareFiles(Map<String, TestSourceFile> testResourceFiles) throws Exception {
|
||||||
for (String fileName : testResourceFiles.keySet()) {
|
for (String fileName : testResourceFiles.keySet()) {
|
||||||
TestSourceFile testFile = testResourceFiles.get(fileName);
|
TestSourceFile testFile = testResourceFiles.get(fileName);
|
||||||
String code = generateSource(testFile);
|
String code = generateSource(testFile);
|
||||||
assertEquals(TestHelper.unifyNewLines(testFile.getExpectedSource()), TestHelper.unifyNewLines(code + System.getProperty("line.separator"))); //$NON-NLS-1$
|
assertEquals(TestHelper.unifyNewLines(testFile.getExpectedSource()),
|
||||||
|
TestHelper.unifyNewLines(code + System.getProperty("line.separator"))); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +85,7 @@ public class ASTWriterTest extends RewriteBaseTest {
|
||||||
ASTModificationMap map = new ASTModificationMap();
|
ASTModificationMap map = new ASTModificationMap();
|
||||||
map.getModificationsForNode(unit.getDeclarations()[0]);
|
map.getModificationsForNode(unit.getDeclarations()[0]);
|
||||||
ASTWriter writer = new ASTWriter();
|
ASTWriter writer = new ASTWriter();
|
||||||
return writer.write(unit, null, commentMap);
|
return writer.write(unit, commentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ISourceCodeParser getParser(TestSourceFile testFile) throws Exception {
|
protected ISourceCodeParser getParser(TestSourceFile testFile) throws Exception {
|
||||||
|
@ -97,43 +98,37 @@ public class ASTWriterTest extends RewriteBaseTest {
|
||||||
IScanner scanner = AST2BaseTest.createScanner(codeReader, language, ParserMode.COMPLETE_PARSE, scannerInfo);
|
IScanner scanner = AST2BaseTest.createScanner(codeReader, language, ParserMode.COMPLETE_PARSE, scannerInfo);
|
||||||
|
|
||||||
ISourceCodeParser parser2 = null;
|
ISourceCodeParser parser2 = null;
|
||||||
if( language == ParserLanguage.CPP ) {
|
if (language == ParserLanguage.CPP) {
|
||||||
ICPPParserExtensionConfiguration config = null;
|
ICPPParserExtensionConfiguration config = null;
|
||||||
if (useGNUExtensions){
|
if (useGNUExtensions) {
|
||||||
config = new GPPParserExtensionConfiguration();
|
config = new GPPParserExtensionConfiguration();
|
||||||
} else{
|
} else {
|
||||||
config = new ANSICPPParserExtensionConfiguration();
|
config = new ANSICPPParserExtensionConfiguration();
|
||||||
}
|
}
|
||||||
parser2 = new GNUCPPSourceParser(scanner, ParserMode.COMPLETE_PARSE, NULL_LOG, config );
|
parser2 = new GNUCPPSourceParser(scanner, ParserMode.COMPLETE_PARSE, NULL_LOG, config);
|
||||||
} else {
|
} else {
|
||||||
ICParserExtensionConfiguration config = null;
|
ICParserExtensionConfiguration config = null;
|
||||||
|
|
||||||
if (useGNUExtensions){
|
if (useGNUExtensions) {
|
||||||
config = new GCCParserExtensionConfiguration();
|
config = new GCCParserExtensionConfiguration();
|
||||||
} else{
|
} else {
|
||||||
config = new ANSICParserExtensionConfiguration();
|
config = new ANSICParserExtensionConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
parser2 = new GNUCSourceParser(scanner, ParserMode.COMPLETE_PARSE, NULL_LOG, config );
|
parser2 = new GNUCSourceParser(scanner, ParserMode.COMPLETE_PARSE, NULL_LOG, config);
|
||||||
}
|
}
|
||||||
return parser2;
|
return parser2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getGNUExtension(TestSourceFile file) {
|
private boolean getGNUExtension(TestSourceFile file) {
|
||||||
if(file instanceof ASTWriterTestSourceFile) {
|
if (file instanceof ASTWriterTestSourceFile)
|
||||||
return ((ASTWriterTestSourceFile)file).isUseGNUExtensions();
|
return ((ASTWriterTestSourceFile) file).isUseGNUExtensions();
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private ParserLanguage getLanguage(TestSourceFile file) {
|
private ParserLanguage getLanguage(TestSourceFile file) {
|
||||||
if(file instanceof ASTWriterTestSourceFile) {
|
if (file instanceof ASTWriterTestSourceFile)
|
||||||
return ((ASTWriterTestSourceFile)file).getParserLanguage();
|
return ((ASTWriterTestSourceFile) file).getParserLanguage();
|
||||||
}
|
|
||||||
else {
|
|
||||||
return ParserLanguage.CPP;
|
return ParserLanguage.CPP;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ import org.eclipse.cdt.core.parser.tests.rewrite.TestSourceFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Guido Zgraggen IFS
|
* @author Guido Zgraggen IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ASTWriterTestSourceFile extends TestSourceFile {
|
public class ASTWriterTestSourceFile extends TestSourceFile {
|
||||||
private ParserLanguage parserLanguage = ParserLanguage.CPP;
|
private ParserLanguage parserLanguage = ParserLanguage.CPP;
|
||||||
|
|
|
@ -17,7 +17,7 @@ import junit.framework.TestSuite;
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf
|
* @author Emanuel Graf
|
||||||
*/
|
*/
|
||||||
public class AstWriterTestSuite{
|
public class AstWriterTestSuite {
|
||||||
|
|
||||||
public static Test suite() throws Exception {
|
public static Test suite() throws Exception {
|
||||||
TestSuite suite = new TestSuite("AstWriterTests");
|
TestSuite suite = new TestSuite("AstWriterTests");
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
* accompanies this distribution, and is available at
|
* accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors: Pascal Kesseli (HSR) - Initial API and implementation
|
* Contributors:
|
||||||
|
* Pascal Kesseli (HSR) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.parser.tests.rewrite.astwriter;
|
package org.eclipse.cdt.core.parser.tests.rewrite.astwriter;
|
||||||
|
|
||||||
|
@ -182,8 +183,7 @@ public class ExpressionWriterTest extends TestCase {
|
||||||
ICPPASTLambdaExpression lambda = new CPPASTLambdaExpression();
|
ICPPASTLambdaExpression lambda = new CPPASTLambdaExpression();
|
||||||
CPPASTCompoundStatement stmt = new CPPASTCompoundStatement();
|
CPPASTCompoundStatement stmt = new CPPASTCompoundStatement();
|
||||||
stmt.addStatement(new CPPASTReturnStatement(new CPPASTLiteralExpression(
|
stmt.addStatement(new CPPASTReturnStatement(new CPPASTLiteralExpression(
|
||||||
IASTLiteralExpression.lk_integer_constant,
|
IASTLiteralExpression.lk_integer_constant, new char[] { '7' })));
|
||||||
new char[] { '7' })));
|
|
||||||
lambda.setBody(stmt);
|
lambda.setBody(stmt);
|
||||||
return lambda;
|
return lambda;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.eclipse.jface.text.TextSelection;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
public class SourceRewriteTester extends TestSuite {
|
public class SourceRewriteTester extends TestSuite {
|
||||||
|
|
||||||
private static final String testRegexp = "//!(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
private static final String testRegexp = "//!(.*)\\s*(\\w*)*$"; //$NON-NLS-1$
|
||||||
private static final String codeTypeRegexp = "//%(C|CPP)( GNU)?$"; //$NON-NLS-1$
|
private static final String codeTypeRegexp = "//%(C|CPP)( GNU)?$"; //$NON-NLS-1$
|
||||||
private static final String resultRegexp = "//=.*$"; //$NON-NLS-1$
|
private static final String resultRegexp = "//=.*$"; //$NON-NLS-1$
|
||||||
|
@ -56,8 +55,8 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
private static TestSuite createSuite(ArrayList<RewriteBaseTest> testCases, String name) {
|
private static TestSuite createSuite(ArrayList<RewriteBaseTest> testCases, String name) {
|
||||||
TestSuite suite = new TestSuite(name);
|
TestSuite suite = new TestSuite(name);
|
||||||
Iterator<RewriteBaseTest> it = testCases.iterator();
|
Iterator<RewriteBaseTest> it = testCases.iterator();
|
||||||
while(it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
RewriteBaseTest subject =it.next();
|
RewriteBaseTest subject = it.next();
|
||||||
suite.addTest(subject);
|
suite.addTest(subject);
|
||||||
}
|
}
|
||||||
return suite;
|
return suite;
|
||||||
|
@ -77,24 +76,25 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
|
|
||||||
protected static String getNameOfTest(String line) {
|
protected static String getNameOfTest(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(testRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(testRegexp, line);
|
||||||
if(matcherBeginOfTest.find())
|
if (matcherBeginOfTest.find()) {
|
||||||
return matcherBeginOfTest.group(1);
|
return matcherBeginOfTest.group(1);
|
||||||
else
|
} else {
|
||||||
return "Not Named";
|
return "Not Named";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected static boolean lineMatchesBeginOfResult(String line) {
|
protected static boolean lineMatchesBeginOfResult(String line) {
|
||||||
return createMatcherFromString(resultRegexp, line).find();
|
return createMatcherFromString(resultRegexp, line).find();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
private static ArrayList<RewriteBaseTest> createTests(BufferedReader inputReader) throws Exception {
|
||||||
String line;
|
|
||||||
ASTWriterTestSourceFile file = null;
|
ASTWriterTestSourceFile file = null;
|
||||||
MatcherState matcherState = MatcherState.skip;
|
MatcherState matcherState = MatcherState.skip;
|
||||||
ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>();
|
ArrayList<RewriteBaseTest> testCases = new ArrayList<RewriteBaseTest>();
|
||||||
|
|
||||||
while ((line = inputReader.readLine()) != null){
|
String line;
|
||||||
if(lineMatchesBeginOfTest(line)) {
|
while ((line = inputReader.readLine()) != null) {
|
||||||
|
if (lineMatchesBeginOfTest(line)) {
|
||||||
matcherState = MatcherState.inTest;
|
matcherState = MatcherState.inTest;
|
||||||
file = new ASTWriterTestSourceFile("ASTWritterTest.h"); //$NON-NLS-1$
|
file = new ASTWriterTestSourceFile("ASTWritterTest.h"); //$NON-NLS-1$
|
||||||
testCases.add(createTestClass(getNameOfTest(line), file));
|
testCases.add(createTestClass(getNameOfTest(line), file));
|
||||||
|
@ -102,23 +102,23 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
} else if (lineMatchesBeginOfResult(line)) {
|
} else if (lineMatchesBeginOfResult(line)) {
|
||||||
matcherState = MatcherState.inExpectedResult;
|
matcherState = MatcherState.inExpectedResult;
|
||||||
continue;
|
continue;
|
||||||
}else if (lineMatchesCodeType(line)) {
|
} else if (lineMatchesCodeType(line)) {
|
||||||
matcherState = MatcherState.inSource;
|
matcherState = MatcherState.inSource;
|
||||||
if(file != null) {
|
if (file != null) {
|
||||||
file.setParserLanguage(getParserLanguage(line));
|
file.setParserLanguage(getParserLanguage(line));
|
||||||
file.setUseGNUExtensions(useGNUExtensions(line));
|
file.setUseGNUExtensions(useGNUExtensions(line));
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(matcherState) {
|
switch (matcherState) {
|
||||||
case inSource:
|
case inSource:
|
||||||
if(file != null) {
|
if (file != null) {
|
||||||
file.addLineToSource(line);
|
file.addLineToSource(line);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case inExpectedResult:
|
case inExpectedResult:
|
||||||
if(file != null) {
|
if (file != null) {
|
||||||
file.addLineToExpectedSource(line);
|
file.addLineToExpectedSource(line);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -131,11 +131,11 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
|
|
||||||
protected static boolean useGNUExtensions(String line) {
|
protected static boolean useGNUExtensions(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(codeTypeRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(codeTypeRegexp, line);
|
||||||
if(matcherBeginOfTest.find()) {
|
if (matcherBeginOfTest.find()) {
|
||||||
String codeType = matcherBeginOfTest.group(2);
|
String codeType = matcherBeginOfTest.group(2);
|
||||||
if(codeType == null) {
|
if (codeType == null) {
|
||||||
return false;
|
return false;
|
||||||
}else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,11 +144,11 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
|
|
||||||
protected static ParserLanguage getParserLanguage(String line) {
|
protected static ParserLanguage getParserLanguage(String line) {
|
||||||
Matcher matcherBeginOfTest = createMatcherFromString(codeTypeRegexp, line);
|
Matcher matcherBeginOfTest = createMatcherFromString(codeTypeRegexp, line);
|
||||||
if(matcherBeginOfTest.find()) {
|
if (matcherBeginOfTest.find()) {
|
||||||
String codeType = matcherBeginOfTest.group(1);
|
String codeType = matcherBeginOfTest.group(1);
|
||||||
if(codeType.equalsIgnoreCase("CPP")) { //$NON-NLS-1$
|
if (codeType.equalsIgnoreCase("CPP")) { //$NON-NLS-1$
|
||||||
return ParserLanguage.CPP;
|
return ParserLanguage.CPP;
|
||||||
}else {
|
} else {
|
||||||
return ParserLanguage.C;
|
return ParserLanguage.C;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,9 +156,9 @@ public class SourceRewriteTester extends TestSuite {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RewriteBaseTest createTestClass(String testName, ASTWriterTestSourceFile file) throws Exception {
|
private static RewriteBaseTest createTestClass(String testName, ASTWriterTestSourceFile file) throws Exception {
|
||||||
ASTWriterTest test = new ASTWriterTest(testName,file);
|
ASTWriterTest test = new ASTWriterTest(testName, file);
|
||||||
TextSelection sel = file.getSelection();
|
TextSelection sel = file.getSelection();
|
||||||
if(sel != null) {
|
if (sel != null) {
|
||||||
test.setFileWithSelection(file.getName());
|
test.setFileWithSelection(file.getName());
|
||||||
test.setSelection(sel);
|
test.setSelection(sel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,10 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ChangeGeneratorTest(String name) {
|
||||||
|
super(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
CCorePlugin.getIndexManager().joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());
|
CCorePlugin.getIndexManager().joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());
|
||||||
|
@ -45,7 +49,7 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runTest() throws Exception{
|
public void runTest() throws Exception {
|
||||||
final ASTModificationStore modStore = new ASTModificationStore();
|
final ASTModificationStore modStore = new ASTModificationStore();
|
||||||
IFile testFile = importFile("source.h", source); //$NON-NLS-1$
|
IFile testFile = importFile("source.h", source); //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -65,8 +69,7 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework {
|
||||||
|
|
||||||
changegenartor.generateChange(unit);
|
changegenartor.generateChange(unit);
|
||||||
Document doc = new Document(source);
|
Document doc = new Document(source);
|
||||||
for (Change curChange : ((CompositeChange) changegenartor.getChange())
|
for (Change curChange : ((CompositeChange) changegenartor.getChange()).getChildren()) {
|
||||||
.getChildren()) {
|
|
||||||
if (curChange instanceof TextFileChange) {
|
if (curChange instanceof TextFileChange) {
|
||||||
TextFileChange textChange = (TextFileChange) curChange;
|
TextFileChange textChange = (TextFileChange) curChange;
|
||||||
textChange.getEdit().apply(doc);
|
textChange.getEdit().apply(doc);
|
||||||
|
@ -77,10 +80,6 @@ public abstract class ChangeGeneratorTest extends BaseTestFramework {
|
||||||
|
|
||||||
protected abstract ASTVisitor createModificator(ASTModificationStore modStore);
|
protected abstract ASTVisitor createModificator(ASTModificationStore modStore);
|
||||||
|
|
||||||
public ChangeGeneratorTest(String name) {
|
|
||||||
super(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
System.gc();
|
System.gc();
|
||||||
|
|
|
@ -21,7 +21,6 @@ import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace.Replace
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Thomas Corbat
|
* @author Thomas Corbat
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class ChangeGeneratorTestSuite{
|
public class ChangeGeneratorTestSuite{
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
||||||
|
@ -51,7 +52,8 @@ public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator)declarator;
|
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator)declarator;
|
||||||
arrayDeclarator.getArrayModifiers();
|
arrayDeclarator.getArrayModifiers();
|
||||||
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
||||||
IASTExpression expr = new CPPASTLiteralExpression(0, "3"); //$NON-NLS-1$
|
IASTExpression expr = new CPPASTLiteralExpression(
|
||||||
|
IASTLiteralExpression.lk_integer_constant, "3".toCharArray()); //$NON-NLS-1$
|
||||||
newModifier.setConstantExpression(expr);
|
newModifier.setConstantExpression(expr);
|
||||||
ASTModification modification = new ASTModification(ModificationKind.APPEND_CHILD, declarator, newModifier, null);
|
ASTModification modification = new ASTModification(ModificationKind.APPEND_CHILD, declarator, newModifier, null);
|
||||||
modStore.storeModification(null, modification);
|
modStore.storeModification(null, modification);
|
||||||
|
|
|
@ -13,12 +13,12 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTStandardFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
|
@ -29,26 +29,26 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emanuel Graf IFS
|
* @author Emanuel Graf IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class AddDeclarationBug extends ChangeGeneratorTest {
|
public class AddDeclarationBug extends ChangeGeneratorTest {
|
||||||
|
|
||||||
|
AddDeclarationBug() {
|
||||||
|
super("AddDeclarationBug");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new AddDeclarationBug();
|
||||||
public AddDeclarationBug() {
|
|
||||||
super("Add Declaration Bug Test");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n};"; //$NON-NLS-1$
|
source = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n};"; //$NON-NLS-1$
|
||||||
expectedSource = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n int exp(int i);\n};"; //$NON-NLS-1$
|
expectedSource = "class A\n{\npublic:\n A();\n virtual ~A();\n int foo();\n \nprivate:\n int help();\n\tint exp(int i);\n};"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,4 @@ public class AddDeclarationBug extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new AddDeclarationBug();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,34 +13,38 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ArrayModifierTest extends ChangeGeneratorTest {
|
public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ArrayModifierTest(){
|
ArrayModifierTest() {
|
||||||
super("Replace Array Modifier"); //$NON-NLS-1$
|
super("ArrayModifierTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ArrayModifierTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "int *pi[3];"; //$NON-NLS-1$
|
source = "int* pi[3];"; //$NON-NLS-1$
|
||||||
expectedSource = "int *pi[5][3];"; //$NON-NLS-1$
|
expectedSource = "int* pi[5][3];"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -49,11 +53,12 @@ public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
if (declarator instanceof IASTArrayDeclarator) {
|
if (declarator instanceof IASTArrayDeclarator) {
|
||||||
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator)declarator;
|
IASTArrayDeclarator arrayDeclarator = (IASTArrayDeclarator) declarator;
|
||||||
|
|
||||||
IASTArrayModifier[] modifiers = arrayDeclarator.getArrayModifiers();
|
IASTArrayModifier[] modifiers = arrayDeclarator.getArrayModifiers();
|
||||||
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
IASTArrayModifier newModifier = new CPPASTArrayModifier();
|
||||||
IASTExpression expr = new CPPASTLiteralExpression(0, "5"); //$NON-NLS-1$
|
IASTExpression expr =
|
||||||
|
new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, "5".toCharArray()); //$NON-NLS-1$
|
||||||
newModifier.setConstantExpression(expr);
|
newModifier.setConstantExpression(expr);
|
||||||
ASTModification modification = new ASTModification(ModificationKind.INSERT_BEFORE, modifiers[0], newModifier, null);
|
ASTModification modification = new ASTModification(ModificationKind.INSERT_BEFORE, modifiers[0], newModifier, null);
|
||||||
modStore.storeModification(null, modification);
|
modStore.storeModification(null, modification);
|
||||||
|
@ -62,8 +67,4 @@ public class ArrayModifierTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ArrayModifierTest();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,12 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTArrayModifier;
|
||||||
|
@ -25,25 +26,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTLiteralExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ArraySizeExpressionTest(){
|
ArraySizeExpressionTest() {
|
||||||
super("Insert Array Size Expression"); //$NON-NLS-1$
|
super("ArraySizeExpressionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ArraySizeExpressionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "int *values = new int[5];"; //$NON-NLS-1$
|
source = "int* values = new int[5];"; //$NON-NLS-1$
|
||||||
expectedSource = "int *values = new int[6][5];"; //$NON-NLS-1$
|
expectedSource = "int* values = new int[6][5];"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
|
@ -56,7 +57,8 @@ public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
IASTTypeId id= newExpression.getTypeId();
|
IASTTypeId id= newExpression.getTypeId();
|
||||||
IASTArrayDeclarator dtor= (IASTArrayDeclarator) id.getAbstractDeclarator();
|
IASTArrayDeclarator dtor= (IASTArrayDeclarator) id.getAbstractDeclarator();
|
||||||
IASTArrayModifier[] mods= dtor.getArrayModifiers();
|
IASTArrayModifier[] mods= dtor.getArrayModifiers();
|
||||||
IASTArrayModifier add= new CPPASTArrayModifier(new CPPASTLiteralExpression(0, "6"));
|
IASTArrayModifier add= new CPPASTArrayModifier(
|
||||||
|
new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, "6".toCharArray()));
|
||||||
ASTModification modification = new ASTModification(ASTModification.ModificationKind.INSERT_BEFORE, mods[0], add, null);
|
ASTModification modification = new ASTModification(ASTModification.ModificationKind.INSERT_BEFORE, mods[0], add, null);
|
||||||
modStore.storeModification(null, modification);
|
modStore.storeModification(null, modification);
|
||||||
}
|
}
|
||||||
|
@ -64,9 +66,4 @@ public class ArraySizeExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ArraySizeExpressionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConstructorChainInitializer;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTConstructorChainInitializer;
|
||||||
|
@ -22,25 +22,28 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public CtorChainInitializerTest(){
|
CtorChainInitializerTest() {
|
||||||
super("Insert Before Ctor Initializer"); //$NON-NLS-1$
|
super("CtorChainInitializerTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new CtorChainInitializerTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
source = "TestClass::TestClass(int a, int b):beta(b){\n}\n\n"; //$NON-NLS-1$
|
source = "TestClass::TestClass(int a, int b):beta(b) {\n}\n\n"; //$NON-NLS-1$
|
||||||
expectedSource = "TestClass::TestClass(int a, int b):alpha(a), beta(b){\n}\n\n"; //$NON-NLS-1$
|
expectedSource = "TestClass::TestClass(int a, int b) :\n\t\talpha(a), beta(b) {\n}\n\n"; //$NON-NLS-1$
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -49,7 +52,7 @@ public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTDeclarator declarator) {
|
public int visit(IASTDeclarator declarator) {
|
||||||
if (declarator instanceof CPPASTFunctionDeclarator) {
|
if (declarator instanceof CPPASTFunctionDeclarator) {
|
||||||
CPPASTFunctionDeclarator functionDeclarator = (CPPASTFunctionDeclarator)declarator;
|
CPPASTFunctionDeclarator functionDeclarator = (CPPASTFunctionDeclarator) declarator;
|
||||||
ICPPASTConstructorChainInitializer ctorInitializer = functionDeclarator.getConstructorChain()[0];
|
ICPPASTConstructorChainInitializer ctorInitializer = functionDeclarator.getConstructorChain()[0];
|
||||||
CPPASTIdExpression initExpr = new CPPASTIdExpression(new CPPASTName("a".toCharArray())); //$NON-NLS-1$
|
CPPASTIdExpression initExpr = new CPPASTIdExpression(new CPPASTName("a".toCharArray())); //$NON-NLS-1$
|
||||||
CPPASTName initName = new CPPASTName("alpha".toCharArray()); //$NON-NLS-1$
|
CPPASTName initName = new CPPASTName("alpha".toCharArray()); //$NON-NLS-1$
|
||||||
|
@ -63,9 +66,4 @@ public class CtorChainInitializerTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new CtorChainInitializerTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
|
@ -24,13 +24,17 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTypeId;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ExceptionTest extends ChangeGeneratorTest {
|
public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ExceptionTest(){
|
ExceptionTest() {
|
||||||
super("Insert Before Exception Declaration"); //$NON-NLS-1$
|
super("ExceptionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ExceptionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,8 +45,7 @@ public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -69,9 +72,4 @@ public class ExceptionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ExceptionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIdExpression;
|
||||||
|
@ -25,14 +25,14 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class ExpressionTest extends ChangeGeneratorTest {
|
public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ExpressionTest(){
|
ExpressionTest() {
|
||||||
super("Insert Expression"); //$NON-NLS-1$
|
super("ExpressionTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new ExpressionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -43,8 +43,7 @@ public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitExpressions = true;
|
shouldVisitExpressions = true;
|
||||||
|
@ -63,9 +62,4 @@ public class ExpressionTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new ExpressionTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
|
@ -24,17 +24,17 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class FirstParameterTest extends ChangeGeneratorTest {
|
public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public FirstParameterTest(){
|
FirstParameterTest() {
|
||||||
super("Insert Before First Parameter"); //$NON-NLS-1$
|
super("FirstParameterTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new FirstParameterTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,10 +44,8 @@ public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -77,9 +75,4 @@ public class FirstParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new FirstParameterTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,11 @@ import junit.framework.TestSuite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Thomas Corbat
|
* @author Thomas Corbat
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class InsertBeforeTestSuite{
|
public class InsertBeforeTestSuite {
|
||||||
|
|
||||||
public static Test suite() throws Exception {
|
public static Test suite() throws Exception {
|
||||||
TestSuite suite = new TestSuite("Changegenerator InsertBefore Tests");
|
TestSuite suite = new TestSuite("ChangeGenerator InsertBefore Tests");
|
||||||
|
|
||||||
suite.addTest(FirstParameterTest.suite());
|
suite.addTest(FirstParameterTest.suite());
|
||||||
suite.addTest(PointerParameterTest.suite());
|
suite.addTest(PointerParameterTest.suite());
|
||||||
|
|
|
@ -13,44 +13,38 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNodeFactory;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPNodeFactory;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MultilineWhitespaceHandlingTest extends ChangeGeneratorTest {
|
public class MultilineWhitespaceHandlingTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MultilineWhitespaceHandlingTest(){
|
MultilineWhitespaceHandlingTest() {
|
||||||
super("Multiline Whitespace Handling"); //$NON-NLS-1$
|
super("MultilineWhitespaceHandlingTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n int i;\r\n int j;\r\n\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MultilineWhitespaceHandlingTest();
|
return new MultilineWhitespaceHandlingTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "void foo() {\r\n\r\n\tfor(int i = 0; i < 10; i++) {\r\n\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void foo() {\r\n\r\n\tfor(int i = 0; i < 10; i++) {\r\n\t\tint i;\r\n\t\tint j;\r\n\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -13,21 +13,25 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.insertbefore;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTPointer;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTPointer;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification.ModificationKind;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class PointerParameterTest extends ChangeGeneratorTest {
|
public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public PointerParameterTest(){
|
PointerParameterTest() {
|
||||||
super("Insert Pointer for Parameter"); //$NON-NLS-1$
|
super("PointerParameterTest");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
return new PointerParameterTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,8 +42,7 @@ public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclarators = true;
|
shouldVisitDeclarators = true;
|
||||||
|
@ -63,9 +66,4 @@ public class PointerParameterTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
|
||||||
return new PointerParameterTest();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,31 +21,25 @@ import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGenerator
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class SelfInsertionTest extends ChangeGeneratorTest {
|
public class SelfInsertionTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public SelfInsertionTest(){
|
SelfInsertionTest() {
|
||||||
super("Self Insertion Test"); //$NON-NLS-1$
|
super("SelfInsertionTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void foo(){\r\n\r\n for(int i = 0; i < 10; i++){\r\n for(int i = 0;i < 10;i++){\r\n }\r\n }\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new SelfInsertionTest();
|
return new SelfInsertionTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "void foo() {\r\n\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void foo() {\r\n\r\n\tfor (int i = 0; i < 10; i++) {\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t}\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
||||||
|
@ -25,32 +25,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTSimpleDeclaration;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MoveRenameTest extends ChangeGeneratorTest {
|
public class MoveRenameTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MoveRenameTest(){
|
MoveRenameTest() {
|
||||||
super("Swap Rename Declarations"); //$NON-NLS-1$
|
super("MoveRenameTest");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
|
|
||||||
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int b;\r\n int a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int d;\r\n int b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MoveRenameTest();
|
return new MoveRenameTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint b;\r\n\tint a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint d;\r\n\tint b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclSpecifiers = true;
|
shouldVisitDeclSpecifiers = true;
|
||||||
|
@ -70,8 +63,6 @@ public class MoveRenameTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,40 +13,34 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompositeTypeSpecifier;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class MoveTest extends ChangeGeneratorTest {
|
public class MoveTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public MoveTest(){
|
MoveTest() {
|
||||||
super("Swap Declarations"); //$NON-NLS-1$
|
super("MoveTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int b;\r\n int a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n int a;\r\n int b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new MoveTest();
|
return new MoveTest();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint b;\r\n\tint a;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "#ifndef A_H_\r\n#define A_H_\r\n\r\nclass A {\r\n\r\nprivate:\r\n\tint a;\r\n\tint b;\r\n};\r\n\r\n#endif /*A_H_*/\r\n\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitDeclSpecifiers = true;
|
shouldVisitDeclSpecifiers = true;
|
||||||
|
@ -64,8 +58,6 @@ public class MoveTest extends ChangeGeneratorTest {
|
||||||
}
|
}
|
||||||
return super.visit(declSpec);
|
return super.visit(declSpec);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
|
@ -20,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
||||||
|
@ -33,43 +33,37 @@ import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public ReplaceInsertStatementTest() {
|
ReplaceInsertStatementTest() {
|
||||||
super("Replace Insert Statement Test");
|
super("ReplaceInsertStatementTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "void main(){\r\n int i = 0;\r\n ++i;\r\n}"; //$NON-NLS-1$
|
|
||||||
expectedSource = "void main(){\r\n int i = 0;\r\n i = 42;\r\n i++;\r\n}"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new ReplaceInsertStatementTest();
|
return new ReplaceInsertStatementTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest#createModificator(org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected void setUp() throws Exception {
|
||||||
final ASTModificationStore modStore) {
|
source = "void main() {\r\n\tint i = 0;\r\n\t++i;\r\n}"; //$NON-NLS-1$
|
||||||
|
expectedSource = "void main() {\r\n\tint i = 0;\r\n\ti = 42;\r\n\ti++;\r\n}"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int visit(IASTStatement statement) {
|
public int visit(IASTStatement statement) {
|
||||||
if (statement instanceof IASTCompoundStatement) {
|
if (statement instanceof IASTCompoundStatement) {
|
||||||
IASTCompoundStatement compStmt = (IASTCompoundStatement) statement;
|
IASTCompoundStatement compStmt = (IASTCompoundStatement) statement;
|
||||||
IASTStatement stmt = compStmt.getStatements()[1];
|
IASTStatement stmt = compStmt.getStatements()[1];
|
||||||
|
|
||||||
IASTIdExpression id = new CPPASTIdExpression(
|
IASTIdExpression id = new CPPASTIdExpression(new CPPASTName("i".toCharArray()));
|
||||||
new CPPASTName("i".toCharArray()));
|
|
||||||
IASTLiteralExpression value = new CPPASTLiteralExpression(
|
IASTLiteralExpression value = new CPPASTLiteralExpression(
|
||||||
IASTLiteralExpression.lk_integer_constant, "42");
|
IASTLiteralExpression.lk_integer_constant, "42".toCharArray());
|
||||||
IASTExpressionStatement insertStmt = new CPPASTExpressionStatement(
|
IASTExpressionStatement insertStmt = new CPPASTExpressionStatement(
|
||||||
new CPPASTBinaryExpression(
|
new CPPASTBinaryExpression(
|
||||||
IASTBinaryExpression.op_assign, id, value));
|
IASTBinaryExpression.op_assign, id, value));
|
||||||
|
@ -82,15 +76,12 @@ public class ReplaceInsertStatementTest extends ChangeGeneratorTest {
|
||||||
incExp);
|
incExp);
|
||||||
|
|
||||||
ASTModification replaceMod = new ASTModification(
|
ASTModification replaceMod = new ASTModification(
|
||||||
ASTModification.ModificationKind.REPLACE, stmt,
|
ASTModification.ModificationKind.REPLACE, stmt, replaceStatement, null);
|
||||||
replaceStatement, null);
|
|
||||||
modStore.storeModification(null, replaceMod);
|
modStore.storeModification(null, replaceMod);
|
||||||
|
|
||||||
ASTModification insertMod = new ASTModification(
|
ASTModification insertMod = new ASTModification(
|
||||||
ASTModification.ModificationKind.INSERT_BEFORE,
|
ASTModification.ModificationKind.INSERT_BEFORE, stmt, insertStmt, null);
|
||||||
stmt, insertStmt, null);
|
|
||||||
modStore.storeModification(null, insertMod);
|
modStore.storeModification(null, insertMod);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PROCESS_CONTINUE;
|
return PROCESS_CONTINUE;
|
||||||
|
|
|
@ -13,10 +13,10 @@ package org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.replace;
|
||||||
|
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTIfStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
import org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.ChangeGeneratorTest;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement;
|
||||||
|
@ -26,31 +26,25 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTUnaryExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModification;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
import org.eclipse.cdt.internal.core.dom.rewrite.ASTModificationStore;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class StatementTest extends ChangeGeneratorTest {
|
public class StatementTest extends ChangeGeneratorTest {
|
||||||
|
|
||||||
public StatementTest(){
|
StatementTest() {
|
||||||
super("Replace Then-Statement"); //$NON-NLS-1$
|
super("StatementTest");
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUp() throws Exception {
|
|
||||||
source = "int f()\r\n{\r\n\tint i = 0;\r\n\tif(i < 1){\r\n\t\t++i;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
expectedSource = "int f()\r\n{\r\n\tint i = 0;\r\n\tif(i < 1){\r\n\t i++;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
|
||||||
super.setUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new StatementTest();
|
return new StatementTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUp() throws Exception {
|
||||||
|
source = "int f()\r\n{\r\n\tint i = 0;\r\n\tif (i < 1) {\r\n\t\t++i;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
expectedSource = "int f()\r\n{\r\n\tint i = 0;\r\n\tif (i < 1) {\r\n\t\ti++;\r\n\t}\r\n}\r\n"; //$NON-NLS-1$
|
||||||
|
super.setUp();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ASTVisitor createModificator(
|
protected ASTVisitor createModificator(final ASTModificationStore modStore) {
|
||||||
final ASTModificationStore modStore) {
|
|
||||||
return new ASTVisitor() {
|
return new ASTVisitor() {
|
||||||
{
|
{
|
||||||
shouldVisitStatements = true;
|
shouldVisitStatements = true;
|
||||||
|
|
|
@ -33,9 +33,12 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test tests the behavoir of the class ASTCommenter. It checks if the ASTCommenter assigns the comments contained in an AST to the right ASTNodes.<br>
|
* This test tests the behavior of the class ASTCommenter. It checks if the ASTCommenter assigns
|
||||||
* The source for the CommentHandling tests is located at /resources/rewrite/CommentHandlingTestSource.rts.<br>
|
* the comments contained in an AST to the right ASTNodes.<br>
|
||||||
* This file contains the source code and the expected output for all the tests. Following a little example how such a test looks like:<br><br>
|
* The source for the CommentHandling tests is located at
|
||||||
|
* /resources/rewrite/CommentHandlingTestSource.rts.<br>
|
||||||
|
* This file contains the source code and the expected output for all the tests.
|
||||||
|
* Following a little example how such a test looks like:<br><br>
|
||||||
*
|
*
|
||||||
* <code><pre>
|
* <code><pre>
|
||||||
* //!NameOfTheTest - will be used as JUnit test name
|
* //!NameOfTheTest - will be used as JUnit test name
|
||||||
|
@ -62,12 +65,13 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
*
|
*
|
||||||
* The second line (//#org.eclipse.cdt...) indicates the test class (in this case this class).<br>
|
* The second line (//#org.eclipse.cdt...) indicates the test class (in this case this class).<br>
|
||||||
* The "//=" indicates the beginning of the expected test result.<br>
|
* The "//=" indicates the beginning of the expected test result.<br>
|
||||||
* The test result contains three sections (separated by "=>leading", "=>trailing" and "=>freestanding").<br>
|
* The test result contains three sections (separated by "=>leading", "=>trailing" and
|
||||||
* Each section contains the raw signature of the node to which a comment is assigned plus " = " and the comment. If there are several comments
|
* "=>freestanding").<br>
|
||||||
* assigned to the same node they are concatenated with a " , ".
|
* Each section contains the raw signature of the node to which a comment is assigned plus " = "
|
||||||
|
* and the comment. If there are several comments assigned to the same node they are concatenated
|
||||||
|
* with a " , ".
|
||||||
*
|
*
|
||||||
* @author Guido Zgraggen IFS, Lukas Felber IFS
|
* @author Guido Zgraggen IFS, Lukas Felber IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class CommentHandlingTest extends RewriteBaseTest {
|
public class CommentHandlingTest extends RewriteBaseTest {
|
||||||
|
|
||||||
|
@ -88,12 +92,11 @@ public class CommentHandlingTest extends RewriteBaseTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void runTest() throws Throwable {
|
protected void runTest() throws Throwable {
|
||||||
|
|
||||||
if (fileMap.size() == 0) {
|
if (fileMap.size() == 0) {
|
||||||
fail("No file for testing"); //$NON-NLS-1$
|
fail("No file for testing"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String fileName : fileMap.keySet()) {
|
for (String fileName : fileMap.keySet()) {
|
||||||
TestSourceFile file = fileMap.get(fileName);
|
TestSourceFile file = fileMap.get(fileName);
|
||||||
NodeCommentMap nodeMap = ASTCommenter.getCommentedNodeMap(getUnit(fileName));
|
NodeCommentMap nodeMap = ASTCommenter.getCommentedNodeMap(getUnit(fileName));
|
||||||
|
|
||||||
|
@ -105,8 +108,8 @@ public class CommentHandlingTest extends RewriteBaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringBuilder buildExpectedResult(TestSourceFile file) {
|
private StringBuilder buildExpectedResult(TestSourceFile file) {
|
||||||
|
Matcher matcher = Pattern.compile(CommentHandlingTest.getSeparatingRegexp(),
|
||||||
Matcher matcher = Pattern.compile(CommentHandlingTest.getSeparatingRegexp(), Pattern.MULTILINE | Pattern.DOTALL).matcher(file.getExpectedSource());
|
Pattern.MULTILINE | Pattern.DOTALL).matcher(file.getExpectedSource());
|
||||||
if (!matcher.find()) {
|
if (!matcher.find()) {
|
||||||
fail("Missing expected section. Expected result code must be of the following format:\n\"=>leading\n...\n=>trailing\n...\n=>freestanding\""); //$NON-NLS-1$
|
fail("Missing expected section. Expected result code must be of the following format:\n\"=>leading\n...\n=>trailing\n...\n=>freestanding\""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -143,7 +146,6 @@ public class CommentHandlingTest extends RewriteBaseTest {
|
||||||
StringBuilder output = new StringBuilder();
|
StringBuilder output = new StringBuilder();
|
||||||
for (IASTNode actNode : keyTree) {
|
for (IASTNode actNode : keyTree) {
|
||||||
ArrayList<IASTComment> comments = map.get(actNode);
|
ArrayList<IASTComment> comments = map.get(actNode);
|
||||||
|
|
||||||
output.append(getSignature(actNode) + " = "); //$NON-NLS-1$
|
output.append(getSignature(actNode) + " = "); //$NON-NLS-1$
|
||||||
boolean first = true;
|
boolean first = true;
|
||||||
for (IASTComment actComment : comments) {
|
for (IASTComment actComment : comments) {
|
||||||
|
@ -170,11 +172,13 @@ public class CommentHandlingTest extends RewriteBaseTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getSeparatingRegexp() {
|
private static String getSeparatingRegexp() {
|
||||||
return LEADING_COMMENT_SEPARATOR + ANY_CHAR_REGEXP + TRAILING_COMMENT_SEPARATOR + ANY_CHAR_REGEXP + FREESTANDING_COMMENT_SEPARATOR + ANY_CHAR_REGEXP;
|
return LEADING_COMMENT_SEPARATOR + ANY_CHAR_REGEXP + TRAILING_COMMENT_SEPARATOR +
|
||||||
|
ANY_CHAR_REGEXP + FREESTANDING_COMMENT_SEPARATOR + ANY_CHAR_REGEXP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IASTTranslationUnit getUnit(String fileName) throws CoreException {
|
private IASTTranslationUnit getUnit(String fileName) throws CoreException {
|
||||||
ITranslationUnit tu = (ITranslationUnit) CCorePlugin.getDefault().getCoreModel().create(project.getFile(fileName));
|
ITranslationUnit tu = (ITranslationUnit) CCorePlugin.getDefault().getCoreModel().create(
|
||||||
|
project.getFile(fileName));
|
||||||
return tu.getAST();
|
return tu.getAST();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,18 +18,14 @@ import org.eclipse.cdt.core.parser.tests.rewrite.RewriteTester;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Guido Zgraggen IFS
|
* @author Guido Zgraggen IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class CommentHandlingTestSuite extends TestSuite {
|
public class CommentHandlingTestSuite extends TestSuite {
|
||||||
|
|
||||||
public static Test suite() throws Exception {
|
public static Test suite() throws Exception {
|
||||||
TestSuite suite = new TestSuite(CommentHandlingTestSuite.class.getName());
|
TestSuite suite = new TestSuite(CommentHandlingTestSuite.class.getName());
|
||||||
|
suite.addTest(RewriteTester.suite("CommentTests",
|
||||||
suite.addTest(RewriteTester.suite("CommentTests", "resources/rewrite/CommentHandlingTestSource.rts")); //$NON-NLS-1$ //$NON-NLS-2$
|
"resources/rewrite/CommentHandlingTestSource.rts")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
suite.addTestSuite(NodeCommentMapTest.class);
|
suite.addTestSuite(NodeCommentMapTest.class);
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,8 @@ import org.eclipse.cdt.internal.core.dom.rewrite.commenthandler.NodeCommentMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Guido Zgraggen IFS
|
* @author Guido Zgraggen IFS
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class NodeCommentMapTest extends TestCase {
|
public class NodeCommentMapTest extends TestCase {
|
||||||
|
|
||||||
private NodeCommentMap map;
|
private NodeCommentMap map;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -39,7 +37,6 @@ public class NodeCommentMapTest extends TestCase {
|
||||||
|
|
||||||
public void testNoComment(){
|
public void testNoComment(){
|
||||||
ASTNode node = new CPPASTName();
|
ASTNode node = new CPPASTName();
|
||||||
|
|
||||||
assertEquals(0, map.getLeadingCommentsForNode(node).size());
|
assertEquals(0, map.getLeadingCommentsForNode(node).size());
|
||||||
assertEquals(0, map.getTrailingCommentsForNode(node).size());
|
assertEquals(0, map.getTrailingCommentsForNode(node).size());
|
||||||
assertEquals(0, map.getFreestandingCommentsForNode(node).size());
|
assertEquals(0, map.getFreestandingCommentsForNode(node).size());
|
||||||
|
@ -51,7 +48,6 @@ public class NodeCommentMapTest extends TestCase {
|
||||||
IASTComment comm2 = new Comment();
|
IASTComment comm2 = new Comment();
|
||||||
IASTComment comm3 = new Comment();
|
IASTComment comm3 = new Comment();
|
||||||
|
|
||||||
|
|
||||||
map.addLeadingCommentToNode(node, comm1);
|
map.addLeadingCommentToNode(node, comm1);
|
||||||
map.addTrailingCommentToNode(node, comm2);
|
map.addTrailingCommentToNode(node, comm2);
|
||||||
map.addFreestandingCommentToNode(node, comm3);
|
map.addFreestandingCommentToNode(node, comm3);
|
||||||
|
@ -89,7 +85,6 @@ public class NodeCommentMapTest extends TestCase {
|
||||||
assertEquals(com2, map.getFreestandingCommentsForNode(node).get(1));
|
assertEquals(com2, map.getFreestandingCommentsForNode(node).get(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testCommentOnDifferentNodes(){
|
public void testCommentOnDifferentNodes(){
|
||||||
ASTNode node1 = new CPPASTName();
|
ASTNode node1 = new CPPASTName();
|
||||||
ASTNode node2 = new CPPASTName();
|
ASTNode node2 = new CPPASTName();
|
||||||
|
@ -129,19 +124,22 @@ public class NodeCommentMapTest extends TestCase {
|
||||||
assertEquals(com3, map.getFreestandingCommentsForNode(node1).get(1));
|
assertEquals(com3, map.getFreestandingCommentsForNode(node1).get(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=== InternalComment class for testing
|
//=== InternalComment class for testing
|
||||||
private class Comment extends ASTNode implements IASTComment{
|
private class Comment extends ASTNode implements IASTComment {
|
||||||
private char[] comment;
|
private char[] comment;
|
||||||
|
|
||||||
public char[] getComment() {
|
public char[] getComment() {
|
||||||
return comment;
|
return comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setComment(char[] comment) {
|
public void setComment(char[] comment) {
|
||||||
this.comment = comment;
|
this.comment = comment;
|
||||||
}
|
}
|
||||||
//not used
|
|
||||||
public boolean isBlockComment() {return false;}
|
// not used
|
||||||
|
public boolean isBlockComment() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public IASTNode copy() {
|
public IASTNode copy() {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -11,11 +11,12 @@ const int a = 1;
|
||||||
//Test3
|
//Test3
|
||||||
volatile int b = 3;
|
volatile int b = 3;
|
||||||
//Test4
|
//Test4
|
||||||
typedef int *intp;
|
typedef int* intp;
|
||||||
//Test5
|
//Test5
|
||||||
extern int b;
|
extern int b;
|
||||||
//Test6
|
//Test6
|
||||||
static int c;
|
static int c;
|
||||||
|
|
||||||
//Test7
|
//Test7
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
|
@ -59,7 +60,7 @@ public:
|
||||||
//!Commented ElaboratedTypeSpecifier 1
|
//!Commented ElaboratedTypeSpecifier 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//Test1
|
//Test1
|
||||||
class A *A; //Test2
|
class A* A; //Test2
|
||||||
//Test3
|
//Test3
|
||||||
enum Status{ good, bad}; //Test4
|
enum Status{ good, bad}; //Test4
|
||||||
//Test5
|
//Test5
|
||||||
|
|
|
@ -76,42 +76,51 @@ extern "C" typedef void FUNC(); /*TEST 2*/
|
||||||
//!Commented NamespaceAlias 1
|
//!Commented NamespaceAlias 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace kurz = ziemlichlangernamespace; //TEST 2
|
namespace kurz = somenamespace; //TEST 2
|
||||||
|
|
||||||
//!Commented NamespaceAlias 2
|
//!Commented NamespaceAlias 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
namespace kurz = ziemlichlangernamespace; /*TEST 2*/
|
namespace kurz = somenamespace; /*TEST 2*/
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 1
|
//!Commented NamespaceDefinition 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace1
|
||||||
{
|
{
|
||||||
//TEST 2
|
|
||||||
|
//TEST 2
|
||||||
|
|
||||||
} //TEST 3
|
} //TEST 3
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 2
|
//!Commented NamespaceDefinition 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace2
|
||||||
{
|
{
|
||||||
/*TEST 2*/
|
|
||||||
|
/*TEST 2*/
|
||||||
|
|
||||||
} /*TEST 3*/
|
} /*TEST 3*/
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 3
|
//!Commented NamespaceDefinition 3
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace3
|
||||||
{
|
{
|
||||||
//TEST
|
|
||||||
|
//TEST
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Commented NamespaceDefinition 4
|
//!Commented NamespaceDefinition 4
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace namespace4
|
||||||
{
|
{
|
||||||
//TEST
|
|
||||||
|
//TEST
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void doIt()
|
void doIt()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -158,8 +167,9 @@ template<> class MyQueue<double> //TEST 2
|
||||||
{
|
{
|
||||||
//TEST 3
|
//TEST 3
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
//TEST 4
|
//TEST 4
|
||||||
|
@ -173,8 +183,9 @@ template<> class MyQueue<double> /*TEST 2*/
|
||||||
{
|
{
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
|
@ -214,9 +225,11 @@ class A
|
||||||
//TEST 1
|
//TEST 1
|
||||||
public: //TEST 2
|
public: //TEST 2
|
||||||
int hallo();
|
int hallo();
|
||||||
|
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
protected: /*TEST 4*/
|
protected: /*TEST 4*/
|
||||||
int b, c;
|
int b, c;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int p;
|
int p;
|
||||||
};
|
};
|
||||||
|
@ -231,13 +244,13 @@ int i = 2; //TEST 2
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
int i = 2; /*TEST 2*/
|
int i = 2; /*TEST 2*/
|
||||||
|
|
||||||
//!Commented typename qualfier 1
|
//!Commented typename qualifier 1
|
||||||
//%CPP
|
//%CPP
|
||||||
//TEST 1
|
//TEST 1
|
||||||
typename T::A *a6; //TEST 2
|
typename T::A* a6; //TEST 2
|
||||||
|
|
||||||
//!Commented typename qualfier 2
|
//!Commented typename qualifier 2
|
||||||
//%CPP
|
//%CPP
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
typename T::A *a6; /*TEST 2*/
|
typename T::A* a6; /*TEST 2*/
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ void foo()
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,13 +22,14 @@ void foo()
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 1
|
//!Commented CPPFunctionDeclaratorTest 1
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
//TEST 1
|
//TEST 1
|
||||||
TestClass::TestClass(int a) //TEST 2
|
TestClass::TestClass(int a) //TEST 2
|
||||||
{
|
{
|
||||||
|
@ -38,7 +39,8 @@ TestClass::TestClass(int a) //TEST 2
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 2
|
//!Commented CPPFunctionDeclaratorTest 2
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
TestClass::TestClass(int a) /*TEST 2*/
|
TestClass::TestClass(int a) /*TEST 2*/
|
||||||
{
|
{
|
||||||
|
@ -48,7 +50,8 @@ TestClass::TestClass(int a) /*TEST 2*/
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 3
|
//!Commented CPPFunctionDeclaratorTest 3
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
//TEST 1
|
//TEST 1
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a) //TEST 2
|
:alpha(a) //TEST 2
|
||||||
|
@ -59,7 +62,8 @@ TestClass::TestClass(int a)
|
||||||
|
|
||||||
//!Commented CPPFunctionDeclaratorTest 4
|
//!Commented CPPFunctionDeclaratorTest 4
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
|
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a) /*TEST 3*/
|
:alpha(a) /*TEST 3*/
|
||||||
|
@ -76,7 +80,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +94,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +108,7 @@ void foo()
|
||||||
//Test
|
//Test
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +122,7 @@ void foo()
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +136,7 @@ void foo()
|
||||||
//Test
|
//Test
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +149,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++; //Test
|
i++; //Test
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +163,7 @@ void foo()
|
||||||
i++;
|
i++;
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +176,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
} //Test
|
} //Test
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +189,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +203,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +217,7 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
|
@ -227,9 +231,9 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(Overflow oo){
|
catch (Overflow oo){
|
||||||
}
|
}
|
||||||
catch(Matherr mm){
|
catch (Matherr mm){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,9 +246,9 @@ void foo()
|
||||||
try {
|
try {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
catch(Overflow oo){
|
catch (Overflow oo){
|
||||||
}
|
}
|
||||||
catch(Matherr mm){
|
catch (Matherr mm){
|
||||||
//Test
|
//Test
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//Test
|
//Test
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//!Commented OperatorName2
|
//!Commented OperatorName2
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
class Foo
|
class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char & operator [](unsigned int); //Test
|
char& operator [](unsigned int); //Test
|
||||||
};
|
};
|
||||||
|
|
||||||
//!Commented ConversionName1
|
//!Commented ConversionName1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 1
|
//TEST 1
|
||||||
break; //TEST 2
|
break; //TEST 2
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
break; /*TEST 2*/
|
break; /*TEST 2*/
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 1
|
//TEST 1
|
||||||
continue; //TEST 2
|
continue; //TEST 2
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
continue; /*TEST 2*/
|
continue; /*TEST 2*/
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ void foo()
|
||||||
do{ //TEST 2
|
do{ //TEST 2
|
||||||
continue; //TEST 3
|
continue; //TEST 3
|
||||||
//TEST 4
|
//TEST 4
|
||||||
} while(true); //TEST 5
|
} while (true); //TEST 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ void foo()
|
||||||
//TEST 2
|
//TEST 2
|
||||||
continue; //TEST 3
|
continue; //TEST 3
|
||||||
//TEST 4
|
//TEST 4
|
||||||
} while(true); //TEST 5
|
} while (true); //TEST 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ void foo()
|
||||||
do{ /*TEST 2*/
|
do{ /*TEST 2*/
|
||||||
continue; /*TEST 3*/
|
continue; /*TEST 3*/
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
} while(true); /*TEST 5*/
|
} while (true); /*TEST 5*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ void foo()
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
continue; /*TEST 3*/
|
continue; /*TEST 3*/
|
||||||
/*TEST 4*/
|
/*TEST 4*/
|
||||||
} while(true); /*TEST 5*/
|
} while (true); /*TEST 5*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ void foo()
|
||||||
{
|
{
|
||||||
do{
|
do{
|
||||||
continue;
|
continue;
|
||||||
} while(true); /*TEST 1*/
|
} while (true); /*TEST 1*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
for(int i = 0;i < 1;++i){ //TEST 2
|
for (int i = 0;i < 1;++i){ //TEST 2
|
||||||
break; //TEST 3
|
break; //TEST 3
|
||||||
} //TEST 4
|
} //TEST 4
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
//TEST 2
|
//TEST 2
|
||||||
break; //TEST 3
|
break; //TEST 3
|
||||||
} //TEST 4
|
} //TEST 4
|
||||||
|
@ -219,7 +219,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
for(int i = 0;i < 1;++i){ /*TEST 2*/
|
for (int i = 0;i < 1;++i){ /*TEST 2*/
|
||||||
break; /*TEST 3*/
|
break; /*TEST 3*/
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
}
|
}
|
||||||
|
@ -229,7 +229,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
break; /*TEST 3*/
|
break; /*TEST 3*/
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
|
@ -240,7 +240,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
break;
|
break;
|
||||||
} /*TEST 4*/
|
} /*TEST 4*/
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
int f()
|
int f()
|
||||||
{
|
{
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} //TEST 1
|
} //TEST 1
|
||||||
return i;
|
return i;
|
||||||
|
@ -398,7 +398,7 @@ int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST 1
|
//TEST 1
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
//TEST 3
|
//TEST 3
|
||||||
++i;
|
++i;
|
||||||
//TEST 4
|
//TEST 4
|
||||||
|
@ -407,7 +407,7 @@ int f()
|
||||||
--i;
|
--i;
|
||||||
//TEST 6
|
//TEST 6
|
||||||
} //TEST 7
|
} //TEST 7
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} //TEST 8
|
} //TEST 8
|
||||||
return i;
|
return i;
|
||||||
|
@ -420,7 +420,7 @@ int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
++i;
|
++i;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
|
@ -429,7 +429,7 @@ int f()
|
||||||
--i;
|
--i;
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
} /*TEST 1*/
|
} /*TEST 1*/
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
} /*TEST 1*/
|
} /*TEST 1*/
|
||||||
return i;
|
return i;
|
||||||
|
@ -440,7 +440,7 @@ int f()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5) //TEST 1
|
if (10 > 5) //TEST 1
|
||||||
return 1; //TEST 2
|
return 1; //TEST 2
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -449,7 +449,7 @@ int g()
|
||||||
//=
|
//=
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
//TEST 1
|
//TEST 1
|
||||||
return 1; //TEST 2
|
return 1; //TEST 2
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ int g()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5) /*TEST 1*/
|
if (10 > 5) /*TEST 1*/
|
||||||
return 1; /*TEST 2*/
|
return 1; /*TEST 2*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -469,7 +469,7 @@ int g()
|
||||||
//=
|
//=
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
return 1; /*TEST 2*/
|
return 1; /*TEST 2*/
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
while(true){ //TEST 2
|
while (true){ //TEST 2
|
||||||
//TEST 3
|
//TEST 3
|
||||||
break; //TEST 4
|
break; //TEST 4
|
||||||
//TEST 5
|
//TEST 5
|
||||||
|
@ -595,7 +595,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
//TEST 1
|
//TEST 1
|
||||||
while(true){
|
while (true){
|
||||||
//TEST 2
|
//TEST 2
|
||||||
//TEST 3
|
//TEST 3
|
||||||
break; //TEST 4
|
break; //TEST 4
|
||||||
|
@ -609,7 +609,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
while(true){ /*TEST 2*/
|
while (true){ /*TEST 2*/
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
break; /*TEST 4*/
|
break; /*TEST 4*/
|
||||||
/*TEST 5*/
|
/*TEST 5*/
|
||||||
|
@ -621,7 +621,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
/*TEST 1*/
|
/*TEST 1*/
|
||||||
while(true){
|
while (true){
|
||||||
/*TEST 2*/
|
/*TEST 2*/
|
||||||
/*TEST 3*/
|
/*TEST 3*/
|
||||||
break; /*TEST 4*/
|
break; /*TEST 4*/
|
||||||
|
@ -634,7 +634,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
} /*TEST 6*/
|
} /*TEST 6*/
|
||||||
}
|
}
|
||||||
|
@ -650,10 +650,10 @@ int foo()
|
||||||
++i;
|
++i;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,7 @@
|
||||||
//!Commented TemplateFunction1
|
//!Commented TemplateFunction1
|
||||||
//%CPP
|
//%CPP
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
//Kommentar
|
//Kommentar
|
||||||
|
@ -12,7 +13,8 @@ template<typename T> int tempFunct(T p)
|
||||||
//!Commented TemplateFunction2
|
//!Commented TemplateFunction2
|
||||||
//%CPP
|
//%CPP
|
||||||
//Kommentar
|
//Kommentar
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
p + 4;
|
p + 4;
|
||||||
|
@ -22,7 +24,8 @@ template<typename T> int tempFunct(T p)
|
||||||
|
|
||||||
//!Commented TemplateFunction3
|
//!Commented TemplateFunction3
|
||||||
//%CPP
|
//%CPP
|
||||||
template<typename T> int tempFunct(T p)
|
template<typename T>
|
||||||
|
int tempFunct(T p)
|
||||||
{
|
{
|
||||||
++p;
|
++p;
|
||||||
p + 4;
|
p + 4;
|
||||||
|
|
|
@ -7,9 +7,10 @@ inline int foo()
|
||||||
|
|
||||||
const int a = 1;
|
const int a = 1;
|
||||||
volatile int b = 3;
|
volatile int b = 3;
|
||||||
typedef int *intp;
|
typedef int* intp;
|
||||||
extern int b;
|
extern int b;
|
||||||
static int c;
|
static int c;
|
||||||
|
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
@ -43,7 +44,7 @@ public:
|
||||||
|
|
||||||
//!ElaboratedTypeSpecifier
|
//!ElaboratedTypeSpecifier
|
||||||
//%CPP
|
//%CPP
|
||||||
class A *A;
|
class A* A;
|
||||||
enum Status{ good, bad};
|
enum Status{ good, bad};
|
||||||
enum Status stat;
|
enum Status stat;
|
||||||
union D
|
union D
|
||||||
|
@ -52,7 +53,7 @@ union D
|
||||||
int y;
|
int y;
|
||||||
};
|
};
|
||||||
union D d;
|
union D d;
|
||||||
struct S *S;
|
struct S* S;
|
||||||
|
|
||||||
//!EnumeratioSpecifier
|
//!EnumeratioSpecifier
|
||||||
//%CPP
|
//%CPP
|
||||||
|
|
|
@ -32,12 +32,14 @@ extern "C" typedef void FUNC();
|
||||||
|
|
||||||
//!NamespaceAlias
|
//!NamespaceAlias
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace kurz = ziemlichlangernamespace;
|
namespace kurz = somenamespace;
|
||||||
|
|
||||||
//!NamespaceDefinition
|
//!NamespaceDefinition
|
||||||
//%CPP
|
//%CPP
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//!TemplateDeclaration
|
//!TemplateDeclaration
|
||||||
|
@ -58,8 +60,9 @@ template<typename T> class MyQueue;
|
||||||
template<> class MyQueue<double>
|
template<> class MyQueue<double>
|
||||||
{
|
{
|
||||||
std::vector<double> data;
|
std::vector<double> data;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void Add(const double& );
|
void Add(const double&);
|
||||||
void Remove();
|
void Remove();
|
||||||
void Print();
|
void Print();
|
||||||
};
|
};
|
||||||
|
@ -92,9 +95,11 @@ using namespace B;
|
||||||
class A
|
class A
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int hallo();
|
int hello();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int b, c;
|
int b, c;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int p;
|
int p;
|
||||||
};
|
};
|
||||||
|
@ -104,7 +109,7 @@ private:
|
||||||
//Comment
|
//Comment
|
||||||
int i = 2;
|
int i = 2;
|
||||||
|
|
||||||
//!typename qualfier
|
//!Typename qualifier
|
||||||
//%CPP
|
//%CPP
|
||||||
typename T::A *a6;
|
typename T::A* a6;
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
//!DeclaratorTest
|
//!DeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int sd;
|
int sd;
|
||||||
int *ip;
|
int* ip;
|
||||||
int hs = 1;
|
int hs = 1;
|
||||||
char & c;
|
char& c;
|
||||||
|
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
struct B
|
struct B
|
||||||
{
|
{
|
||||||
int f();
|
int f();
|
||||||
};
|
};
|
||||||
int (B::* pb)() = &B::f;
|
int (B::*pb)() = &B::f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//!ArrayDeclaratorTest
|
//!ArrayDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int *pi[3];
|
int* pi[3];
|
||||||
int (*p3i)[3];
|
int (*p3i)[3];
|
||||||
|
|
||||||
//!FieldDeclaratorTest
|
//!FieldDeclaratorTest
|
||||||
|
@ -30,38 +31,39 @@ struct Bit
|
||||||
//%C
|
//%C
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
|
|
||||||
//!CPPStandardFunctionDeclaratorTest
|
//!CPPStandardFunctionDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun2(const char *a ...);
|
int fun2(const char* a ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
//= ,... is synonymous with ...
|
//= ,... is synonymous with ...
|
||||||
int foo();
|
int foo();
|
||||||
int bar(int a, int b);
|
int bar(int a, int b);
|
||||||
int fun(const char *a, ...);
|
int fun(const char* a, ...);
|
||||||
int fun2(const char *a, ...);
|
int fun2(const char* a, ...);
|
||||||
int fun3(int i, const char *a, ...);
|
int fun3(int i, const char* a, ...);
|
||||||
|
|
||||||
//!CPPFunctionDeclaratorTest
|
//!CPPFunctionDeclaratorTest
|
||||||
//%CPP
|
//%CPP
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
class TestClass
|
class TestClass
|
||||||
{
|
{
|
||||||
int alpha;
|
int alpha;
|
||||||
TestClass(int a);
|
TestClass(int a);
|
||||||
virtual void pure() =0;
|
virtual void pure() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
TestClass::TestClass(int a)
|
TestClass::TestClass(int a)
|
||||||
:alpha(a)
|
:alpha(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void undefPar(const char *c) throw (int);
|
void undefPar(const char* c) throw (int);
|
||||||
int getV() const;
|
int getV() const;
|
||||||
int vol() volatile;
|
int vol() volatile;
|
||||||
|
|
||||||
|
@ -72,15 +74,17 @@ class C
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
C(int, double);
|
C(int, double);
|
||||||
};
|
};
|
||||||
|
|
||||||
C::C(int ii, double id)
|
C::C(int ii, double id)
|
||||||
try
|
try
|
||||||
:i(f(ii)), d(id)
|
:i(f(ii)), d(id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +98,7 @@ int b, a;
|
||||||
|
|
||||||
//!ICPPASTDeclarator with nested declarator being a variable
|
//!ICPPASTDeclarator with nested declarator being a variable
|
||||||
//%C
|
//%C
|
||||||
int *(*var[3]);
|
int* (*var[3]);
|
||||||
|
|
||||||
//!ICPPASTDeclarator with nested declarator and redundant parentheses
|
//!ICPPASTDeclarator with nested declarator and redundant parentheses
|
||||||
//%C
|
//%C
|
||||||
|
@ -108,8 +112,8 @@ class Foo
|
||||||
};
|
};
|
||||||
//!ICPPASTReferenceOperator rvalue reference
|
//!ICPPASTReferenceOperator rvalue reference
|
||||||
//%CPP
|
//%CPP
|
||||||
int && foo(int && a)
|
int&& foo(int&& a)
|
||||||
{
|
{
|
||||||
char && b;
|
char&& b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@ int i = (int)'A';
|
||||||
|
|
||||||
//!CPPCastExpression
|
//!CPPCastExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *i = dynamic_cast<TestClass*>(tc);
|
TestClass* i = dynamic_cast<TestClass*>(tc);
|
||||||
TestClass *i = static_cast<TestClass*>(tc);
|
TestClass* i = static_cast<TestClass*>(tc);
|
||||||
TestClass *i = reinterpret_cast<TestClass*>(tc);
|
TestClass* i = reinterpret_cast<TestClass*>(tc);
|
||||||
TestClass *i = const_cast<TestClass*>(tc);
|
TestClass* i = const_cast<TestClass*>(tc);
|
||||||
|
|
||||||
//!ArraySubscrition
|
//!ArraySubscrition
|
||||||
//%C GNU
|
//%C GNU
|
||||||
|
@ -33,6 +33,7 @@ int i = 1 | x;
|
||||||
bool b = 1 && x;
|
bool b = 1 && x;
|
||||||
bool b = 1 || x;
|
bool b = 1 || x;
|
||||||
int i = x;
|
int i = x;
|
||||||
|
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
i *= x;
|
i *= x;
|
||||||
|
@ -131,7 +132,7 @@ string s = "abc";
|
||||||
|
|
||||||
//!CPPLiteralExpression
|
//!CPPLiteralExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *tc = this;
|
TestClass* tc = this;
|
||||||
bool b = true;
|
bool b = true;
|
||||||
bool b = false;
|
bool b = false;
|
||||||
|
|
||||||
|
@ -141,7 +142,7 @@ int i = ++a;
|
||||||
int i = --a;
|
int i = --a;
|
||||||
int i = +a;
|
int i = +a;
|
||||||
int i = -a;
|
int i = -a;
|
||||||
int *b = &a;
|
int* b = &a;
|
||||||
int i = *b;
|
int i = *b;
|
||||||
int i = ~b;
|
int i = ~b;
|
||||||
bool b = !false;
|
bool b = !false;
|
||||||
|
@ -167,7 +168,7 @@ void rethrow()
|
||||||
int i = 1;
|
int i = 1;
|
||||||
throw i;
|
throw i;
|
||||||
}
|
}
|
||||||
catch(int j){
|
catch (int j){
|
||||||
throw ;
|
throw ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +192,7 @@ void f()
|
||||||
|
|
||||||
//!CPPNewExpression
|
//!CPPNewExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
TestClass *tc = new TestClass();
|
TestClass* tc = new TestClass();
|
||||||
|
|
||||||
//!CPPSimpleTypeConstructorExpression
|
//!CPPSimpleTypeConstructorExpression
|
||||||
//%CPP
|
//%CPP
|
||||||
|
|
|
@ -11,7 +11,7 @@ int TestClass::Hallo;
|
||||||
class Foo
|
class Foo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char & operator [](unsigned int);
|
char& operator [](unsigned int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//!ConversionName
|
//!ConversionName
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ void foo()
|
||||||
{
|
{
|
||||||
do{
|
do{
|
||||||
continue;
|
continue;
|
||||||
} while(true);
|
} while (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,13 +79,13 @@ void foo()
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
for(int i = 0;i < 1;++i){
|
for (int i = 0;i < 1;++i){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for(;;){
|
for (;;){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for(;int c = f();){
|
for (;int c = f();){
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ void foo()
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0;i < 1;++i){
|
for (i = 0;i < 1;++i){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,12 +115,12 @@ int f()
|
||||||
int f()
|
int f()
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if(i < 1){
|
if (i < 1){
|
||||||
++i;
|
++i;
|
||||||
}else{
|
}else{
|
||||||
--i;
|
--i;
|
||||||
}
|
}
|
||||||
if(int c = f()){
|
if (int c = f()){
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
@ -131,7 +131,7 @@ int f()
|
||||||
//%CPP
|
//%CPP
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -141,7 +141,7 @@ int g()
|
||||||
//%C
|
//%C
|
||||||
int g()
|
int g()
|
||||||
{
|
{
|
||||||
if(10 > 5)
|
if (10 > 5)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -240,14 +240,14 @@ int foo(int a)
|
||||||
//%CPP
|
//%CPP
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fa()
|
void fa()
|
||||||
{
|
{
|
||||||
while(int i = f()){
|
while (int i = f()){
|
||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +255,7 @@ void fa()
|
||||||
|
|
||||||
void fb()
|
void fb()
|
||||||
{
|
{
|
||||||
while(true);
|
while (true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ void fb()
|
||||||
//%C
|
//%C
|
||||||
void foo()
|
void foo()
|
||||||
{
|
{
|
||||||
while(true){
|
while (true){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,10 +279,10 @@ int foo()
|
||||||
++i;
|
++i;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(...){
|
catch (...){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ int foo()
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if( i == ZWO)
|
if (i == ZWO)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ int foo()
|
||||||
int foo()
|
int foo()
|
||||||
{
|
{
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if( i == ZWO)
|
if (i == ZWO)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,5 +309,5 @@ int foo()
|
||||||
|
|
||||||
//!ArrayDeclarationStatementTest
|
//!ArrayDeclarationStatementTest
|
||||||
//%CPP
|
//%CPP
|
||||||
string *newElements = new string[m_capacity];
|
string* newElements = new string[m_capacity];
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
//![temp.names] examples abschnitt 4/1
|
//![temp.names] examples abschnitt 4/1
|
||||||
//%CPP
|
//%CPP
|
||||||
T *p1 = p->template alloc<100>();
|
T* p1 = p->template alloc<100>();
|
||||||
|
|
||||||
//![temp.names] examples abschnitt 4/2, didn't work cause of Bug# 164482
|
//![temp.names] examples abschnitt 4/2, didn't work cause of Bug# 164482
|
||||||
//%CPP
|
//%CPP
|
||||||
template<class T> void f(T *p)
|
template<class T>
|
||||||
|
void f(T* p)
|
||||||
{
|
{
|
||||||
T::template adjust<100>();
|
T::template adjust<100>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse0(); //Comment
|
Klasse0(); //Comment
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -170,6 +171,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse1();
|
Klasse1();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
};
|
};
|
||||||
|
@ -182,6 +184,7 @@ class Klasse0
|
||||||
public:
|
public:
|
||||||
Klasse1();
|
Klasse1();
|
||||||
std::string toString();
|
std::string toString();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int i;
|
int i;
|
||||||
}; = //Comment1
|
}; = //Comment1
|
||||||
|
@ -2779,26 +2782,26 @@ int foo = bar; = //Zweiteilig
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
//TEST 1
|
//TEST 1
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} //TEST 3
|
} //TEST 3
|
||||||
|
|
||||||
//=
|
//=
|
||||||
=>leading
|
=>leading
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 1
|
} = //TEST 1
|
||||||
|
|
||||||
=>trailing
|
=>trailing
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 3
|
} = //TEST 3
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST 2
|
//TEST 2
|
||||||
} = //TEST 2
|
} = //TEST 2
|
||||||
|
@ -2807,7 +2810,7 @@ namespace ziemlichlangernamespace
|
||||||
//!CommentRecognition215 - von ASTWriter NamesapceDefinition
|
//!CommentRecognition215 - von ASTWriter NamesapceDefinition
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST
|
//TEST
|
||||||
}
|
}
|
||||||
|
@ -2822,7 +2825,7 @@ void doIt(){
|
||||||
=>trailing
|
=>trailing
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
//TEST
|
//TEST
|
||||||
} = //TEST
|
} = //TEST
|
||||||
|
@ -2830,7 +2833,7 @@ namespace ziemlichlangernamespace
|
||||||
//!CommentRecognition216 - von ASTWriter NamesapceDefinition
|
//!CommentRecognition216 - von ASTWriter NamesapceDefinition
|
||||||
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
//#org.eclipse.cdt.core.parser.tests.rewrite.comenthandler.CommentHandlingTest
|
||||||
//@Klasse1.h
|
//@Klasse1.h
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST
|
//TEST
|
||||||
|
@ -2846,7 +2849,7 @@ void doIt(){
|
||||||
=>trailing
|
=>trailing
|
||||||
|
|
||||||
=>freestanding
|
=>freestanding
|
||||||
namespace ziemlichlangernamespace
|
namespace somenamespace
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
//TEST
|
//TEST
|
||||||
|
|
|
@ -11,13 +11,12 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A composite type specifier represents a ocmposite structure (contains
|
* A composite type specifier represents a composite structure (contains declarations).
|
||||||
* declarations).
|
|
||||||
*
|
*
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier , IASTNameOwner, IASTDeclarationListOwner {
|
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier, IASTNameOwner, IASTDeclarationListOwner {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>TYPE_NAME</code> represents the relationship between an
|
* <code>TYPE_NAME</code> represents the relationship between an
|
||||||
|
@ -101,5 +100,6 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier , IASTName
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTCompositeTypeSpecifier copy();
|
public IASTCompositeTypeSpecifier copy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,10 +52,12 @@ public interface IASTCompoundStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTCompoundStatement copy();
|
public IASTCompoundStatement copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTCompoundStatement copy(CopyStyle style);
|
public IASTCompoundStatement copy(CopyStyle style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface IASTDeclSpecifier extends IASTNode {
|
public interface IASTDeclSpecifier extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No storage class specified.
|
* No storage class specified.
|
||||||
*/
|
*/
|
||||||
|
@ -52,11 +51,13 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTDeclSpecifier copy();
|
public IASTDeclSpecifier copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTDeclSpecifier copy(CopyStyle style);
|
public IASTDeclSpecifier copy(CopyStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,6 +91,4 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static final int sc_last = sc_register;
|
public static final int sc_last = sc_register;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,10 +103,12 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTFunctionDefinition copy();
|
public IASTFunctionDefinition copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTFunctionDefinition copy(CopyStyle style);
|
public IASTFunctionDefinition copy(CopyStyle style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
*/
|
*/
|
||||||
public interface IASTLiteralExpression extends IASTExpression {
|
public interface IASTLiteralExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An integer literal e.g. 5
|
* An integer literal e.g. 5
|
||||||
*/
|
*/
|
||||||
|
@ -79,6 +78,7 @@ public interface IASTLiteralExpression extends IASTExpression {
|
||||||
* Returns the value of the literal as string.
|
* Returns the value of the literal as string.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString();
|
public String toString();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,11 +95,13 @@ public interface IASTLiteralExpression extends IASTExpression {
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTLiteralExpression copy();
|
public IASTLiteralExpression copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTLiteralExpression copy(CopyStyle style);
|
public IASTLiteralExpression copy(CopyStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -64,6 +64,7 @@ public interface IASTTranslationUnit extends IASTDeclarationListOwner, IFileNomi
|
||||||
*
|
*
|
||||||
* @param declaration <code>IASTDeclaration</code>
|
* @param declaration <code>IASTDeclaration</code>
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addDeclaration(IASTDeclaration declaration);
|
public void addDeclaration(IASTDeclaration declaration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -324,6 +325,7 @@ public interface IASTTranslationUnit extends IASTDeclarationListOwner, IFileNomi
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTTranslationUnit copy();
|
public IASTTranslationUnit copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -335,6 +337,7 @@ public interface IASTTranslationUnit extends IASTDeclarationListOwner, IFileNomi
|
||||||
* @noreference This method is not intended to be referenced by clients.
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTTranslationUnit copy(CopyStyle style);
|
public IASTTranslationUnit copy(CopyStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -84,11 +84,13 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTBaseSpecifier copy();
|
public ICPPASTBaseSpecifier copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTBaseSpecifier copy(CopyStyle style);
|
public ICPPASTBaseSpecifier copy(CopyStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,15 +127,18 @@ public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifie
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPClassScope getScope();
|
public ICPPClassScope getScope();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTCompositeTypeSpecifier copy();
|
public ICPPASTCompositeTypeSpecifier copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTCompositeTypeSpecifier copy(CopyStyle style);
|
public ICPPASTCompositeTypeSpecifier copy(CopyStyle style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTParameterDeclaration extends ICPPASTTemplateParameter, IASTParameterDeclaration {
|
public interface ICPPASTParameterDeclaration extends ICPPASTTemplateParameter, IASTParameterDeclaration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
|
@ -27,15 +26,18 @@ public interface ICPPASTParameterDeclaration extends ICPPASTTemplateParameter, I
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTParameterDeclaration copy();
|
public ICPPASTParameterDeclaration copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTParameterDeclaration copy(CopyStyle style);
|
public ICPPASTParameterDeclaration copy(CopyStyle style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ICPPASTDeclarator getDeclarator();
|
public ICPPASTDeclarator getDeclarator();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,19 +33,20 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
|
||||||
public ICPPBase[] getBases();
|
public ICPPBase[] getBases();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get fields is restated here just to point out that this method returns a
|
* Get fields is restated here just to point out that this method returns a list of ICPPField
|
||||||
* list of ICPPField objects representing all fields, declared or inherited.
|
* objects representing all fields, declared or inherited.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IField[] getFields();
|
public IField[] getFields();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* findField is restated here to point out that this method looks through
|
* findField is restated here to point out that this method looks through the inheritance tree
|
||||||
* the inheritance tree of this class while looking for a field with the
|
* of this class while looking for a field with the given name If no field is found, null is
|
||||||
* given name If no field is found, null is returned, if the name is found
|
* returned, if the name is found to be ambiguous a IProblemBinding is returned.
|
||||||
* to be ambiguous a IProblemBinding is returned.
|
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IField findField(String name);
|
public IField findField(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -55,10 +55,12 @@ public class GPPLanguage extends AbstractCLikeLanguage {
|
||||||
return super.getAdapter(adapter);
|
return super.getAdapter(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return ID;
|
return ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLinkageID() {
|
public int getLinkageID() {
|
||||||
return ILinkage.CPP_LINKAGE_ID;
|
return ILinkage.CPP_LINKAGE_ID;
|
||||||
}
|
}
|
||||||
|
@ -68,6 +70,9 @@ public class GPPLanguage extends AbstractCLikeLanguage {
|
||||||
return CPP_GNU_SCANNER_EXTENSION;
|
return CPP_GNU_SCANNER_EXTENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected IScannerExtensionConfiguration getScannerExtensionConfiguration(IScannerInfo info) {
|
protected IScannerExtensionConfiguration getScannerExtensionConfiguration(IScannerInfo info) {
|
||||||
return GPPScannerExtensionConfiguration.getInstance(info);
|
return GPPScannerExtensionConfiguration.getInstance(info);
|
||||||
|
|
|
@ -202,8 +202,8 @@ public final class ASTRewrite {
|
||||||
* changes.
|
* changes.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return Change object describing the changes to the
|
* @return Change object describing the changes to the document corresponding to the changes
|
||||||
* document corresponding to the changes recorded by this rewriter
|
* recorded by this rewriter
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public Change rewriteAST() {
|
public Change rewriteAST() {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Tomasz Wesolowski - initial API and implementation
|
* Tomasz Wesolowski - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.core.dom.rewrite;
|
package org.eclipse.cdt.core.dom.rewrite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
|
||||||
|
@ -18,8 +17,8 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.internal.core.dom.rewrite.DeclarationGeneratorImpl;
|
import org.eclipse.cdt.internal.core.dom.rewrite.DeclarationGeneratorImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* This class handles the creation of {@link IASTDeclarator}s and {@link IASTDeclSpecifier}s
|
||||||
* This class handles the creation of {@link IASTDeclarator}s and {@link IASTDeclSpecifier}s basing on given type.
|
* for a given type.
|
||||||
*
|
*
|
||||||
* @author Tomasz Wesolowski
|
* @author Tomasz Wesolowski
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
|
@ -45,5 +44,4 @@ public abstract class DeclarationGenerator {
|
||||||
* @return the generated declarator
|
* @return the generated declarator
|
||||||
*/
|
*/
|
||||||
public abstract IASTDeclarator createDeclaratorFromType(IType type, char[] name);
|
public abstract IASTDeclarator createDeclaratorFromType(IType type, char[] name);
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2011 Google, Inc and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Sergey Prigogin (Google) - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.core.dom.rewrite;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.SizeofCalculator;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.SizeofCalculator.SizeAndAlignment;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
|
||||||
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A collection of static methods related to types.
|
||||||
|
* @since 5.4
|
||||||
|
*/
|
||||||
|
public class TypeHelper {
|
||||||
|
|
||||||
|
// Do not instantiate - all methods are static.
|
||||||
|
private TypeHelper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <code>true</code> if it is preferable to pass parameters of the given type to methods
|
||||||
|
* by reference, not by value. A parameter should be passed by reference if it is
|
||||||
|
* a <code>class</code>, <code>struct</code>, or <code>union</code>, and either has a nontrivial
|
||||||
|
* copy constructor or nontrivial destructor, or is larger than pointer.
|
||||||
|
*
|
||||||
|
* @param type the type in question.
|
||||||
|
* @param ast the AST used as a context.
|
||||||
|
* @return <code>true</code> is passing by reverence is preferable.
|
||||||
|
*/
|
||||||
|
public static boolean shouldBePassedByReference(IType type, IASTTranslationUnit ast) {
|
||||||
|
type = SemanticUtil.getNestedType(type, SemanticUtil.CVTYPE | SemanticUtil.TDEF);
|
||||||
|
if (type instanceof ICompositeType) {
|
||||||
|
if (type instanceof ICPPClassType) {
|
||||||
|
ICPPClassType classType = ((ICPPClassType) type);
|
||||||
|
if (!ClassTypeHelper.hasTrivialCopyCtor(classType) ||
|
||||||
|
!ClassTypeHelper.hasTrivialDestructor(classType)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SizeofCalculator calc = ((ASTTranslationUnit) ast).getSizeofCalculator();
|
||||||
|
SizeAndAlignment sizeofPointer = calc.sizeAndAlignmentOfPointer();
|
||||||
|
if (sizeofPointer == null)
|
||||||
|
return true;
|
||||||
|
SizeAndAlignment sizeofType = calc.sizeAndAlignment(type);
|
||||||
|
if (sizeofType == null || sizeofType.size > sizeofPointer.size)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue