mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Cosmetics
Change-Id: I584622013f810d8ac51dcb618074663a79cd5b19
This commit is contained in:
parent
d3fecaa15e
commit
33d12e75c9
1 changed files with 162 additions and 193 deletions
|
@ -68,29 +68,19 @@ public class BuildStep implements IBuildStep {
|
||||||
des.stepCreated(this);
|
des.stepCreated(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getInputIOTypes()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildIOType[] getInputIOTypes() {
|
public IBuildIOType[] getInputIOTypes() {
|
||||||
return fInputTypes.toArray(new BuildIOType[fInputTypes.size()]);
|
return fInputTypes.toArray(new BuildIOType[fInputTypes.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getOutputIOTypes()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildIOType[] getOutputIOTypes() {
|
public IBuildIOType[] getOutputIOTypes() {
|
||||||
return fOutputTypes.toArray(new BuildIOType[fOutputTypes.size()]);
|
return fOutputTypes.toArray(new BuildIOType[fOutputTypes.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#needsRebuild()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean needsRebuild() {
|
public boolean needsRebuild() {
|
||||||
if(fNeedsRebuild
|
if (fNeedsRebuild || (fTool != null && fTool.needsRebuild())
|
||||||
|| (fTool != null && fTool.needsRebuild())
|
|
||||||
|| (fLibTool != null && fLibTool.needsRebuild()))
|
|| (fLibTool != null && fLibTool.needsRebuild()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -210,17 +200,11 @@ public class BuildStep implements IBuildStep {
|
||||||
fBuildGroup = group;
|
fBuildGroup = group;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getInputResources()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildResource[] getInputResources() {
|
public IBuildResource[] getInputResources() {
|
||||||
return getResources(true);
|
return getResources(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getOutputResources()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildResource[] getOutputResources() {
|
public IBuildResource[] getOutputResources() {
|
||||||
return getResources(false);
|
return getResources(false);
|
||||||
|
@ -239,16 +223,12 @@ public class BuildStep implements IBuildStep {
|
||||||
return set.toArray(new BuildResource[set.size()]);
|
return set.toArray(new BuildResource[set.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getCommands(org.eclipse.core.runtime.IPath, java.util.Map, java.util.Map, boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildCommand[] getCommands(IPath cwd, Map inputArgValues, Map outputArgValues, boolean resolveAll) {
|
public IBuildCommand[] getCommands(IPath cwd, Map inputArgValues, Map outputArgValues,
|
||||||
|
boolean resolveAll) {
|
||||||
if (cwd == null)
|
if (cwd == null)
|
||||||
cwd = calcCWD();
|
cwd = calcCWD();
|
||||||
|
|
||||||
|
|
||||||
if (fTool == null) {
|
if (fTool == null) {
|
||||||
String step = null;
|
String step = null;
|
||||||
String appendToLastStep = null;
|
String appendToLastStep = null;
|
||||||
|
@ -295,7 +275,6 @@ public class BuildStep implements IBuildStep {
|
||||||
return new IBuildCommand[0];
|
return new IBuildCommand[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
performAsignToOption(cwd);
|
performAsignToOption(cwd);
|
||||||
|
|
||||||
BuildResource inRc = getRcForMacros(true);
|
BuildResource inRc = getRcForMacros(true);
|
||||||
|
@ -309,16 +288,13 @@ public class BuildStep implements IBuildStep {
|
||||||
outPrefix = resolveMacros(outPrefix, data, true);
|
outPrefix = resolveMacros(outPrefix, data, true);
|
||||||
outRcPath = rmNamePrefix(outRcPath, outPrefix);
|
outRcPath = rmNamePrefix(outRcPath, outPrefix);
|
||||||
|
|
||||||
IManagedCommandLineInfo info = gen.generateCommandLineInfo(fTool,
|
IManagedCommandLineInfo info = gen.generateCommandLineInfo(fTool, fTool.getToolCommand(),
|
||||||
fTool.getToolCommand(),
|
getCommandFlags(inRcPath, outRcPath, resolveAll), fTool.getOutputFlag(), outPrefix,
|
||||||
getCommandFlags(inRcPath, outRcPath, resolveAll),
|
|
||||||
fTool.getOutputFlag(),
|
|
||||||
outPrefix,
|
|
||||||
listToString(resourcesToStrings(cwd, getPrimaryResources(false), outPrefix), " "), //$NON-NLS-1$
|
listToString(resourcesToStrings(cwd, getPrimaryResources(false), outPrefix), " "), //$NON-NLS-1$
|
||||||
getInputResources(cwd, getPrimaryResources(true)),
|
getInputResources(cwd, getPrimaryResources(true)), fTool.getCommandLinePattern());
|
||||||
fTool.getCommandLinePattern());
|
|
||||||
|
|
||||||
return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd, getEnvironment());
|
return createCommandsFromString(resolveMacros(info.getCommandLine(), data, true), cwd,
|
||||||
|
getEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPath rmNamePrefix(IPath path, String prefix) {
|
private IPath rmNamePrefix(IPath path, String prefix) {
|
||||||
|
@ -468,7 +444,8 @@ public class BuildStep implements IBuildStep {
|
||||||
SupplierBasedCdtVariableSubstitutor sub = createSubstitutor(cfg, builder, fileData);
|
SupplierBasedCdtVariableSubstitutor sub = createSubstitutor(cfg, builder, fileData);
|
||||||
result = CdtVariableResolver.resolveToString(str, sub);
|
result = CdtVariableResolver.resolveToString(str, sub);
|
||||||
} else {
|
} else {
|
||||||
result = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(str, "", " ", IBuildMacroProvider.CONTEXT_FILE, fileData); //$NON-NLS-1$ //$NON-NLS-2$
|
result = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(str, "", //$NON-NLS-1$
|
||||||
|
" ", IBuildMacroProvider.CONTEXT_FILE, fileData); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} catch (CdtVariableException e) {
|
} catch (CdtVariableException e) {
|
||||||
}
|
}
|
||||||
|
@ -481,9 +458,11 @@ public class BuildStep implements IBuildStep {
|
||||||
try {
|
try {
|
||||||
IConfiguration cfg = getBuildDescription().getConfiguration();
|
IConfiguration cfg = getBuildDescription().getConfiguration();
|
||||||
if (resolveAll) {
|
if (resolveAll) {
|
||||||
result = ManagedBuildManager.getBuildMacroProvider().resolveValue(str, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg); //$NON-NLS-1$ //$NON-NLS-2$
|
result = ManagedBuildManager.getBuildMacroProvider().resolveValue(str, "", " ", //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg);
|
||||||
} else {
|
} else {
|
||||||
result = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(str, "", " ", IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg); //$NON-NLS-1$ //$NON-NLS-2$
|
result = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(str, "", //$NON-NLS-1$
|
||||||
|
" ", IBuildMacroProvider.CONTEXT_CONFIGURATION, cfg); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} catch (CdtVariableException e) {
|
} catch (CdtVariableException e) {
|
||||||
}
|
}
|
||||||
|
@ -491,14 +470,11 @@ public class BuildStep implements IBuildStep {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SupplierBasedCdtVariableSubstitutor createSubstitutor(IConfiguration cfg, IBuilder builder, IFileContextData fileData){
|
private SupplierBasedCdtVariableSubstitutor createSubstitutor(IConfiguration cfg, IBuilder builder,
|
||||||
|
IFileContextData fileData) {
|
||||||
BuildMacroProvider prov = (BuildMacroProvider) ManagedBuildManager.getBuildMacroProvider();
|
BuildMacroProvider prov = (BuildMacroProvider) ManagedBuildManager.getBuildMacroProvider();
|
||||||
IMacroContextInfo info = prov.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE, fileData);
|
IMacroContextInfo info = prov.getMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE, fileData);
|
||||||
FileMacroExplicitSubstitutor sub = new FileMacroExplicitSubstitutor(
|
FileMacroExplicitSubstitutor sub = new FileMacroExplicitSubstitutor(info, cfg, builder, "", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
info,
|
|
||||||
cfg,
|
|
||||||
builder,
|
|
||||||
"", " "); //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
|
|
||||||
return sub;
|
return sub;
|
||||||
}
|
}
|
||||||
|
@ -554,9 +530,6 @@ public class BuildStep implements IBuildStep {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#isRemoved()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRemoved() {
|
public boolean isRemoved() {
|
||||||
return fIsRemoved;
|
return fIsRemoved;
|
||||||
|
@ -567,9 +540,6 @@ public class BuildStep implements IBuildStep {
|
||||||
fNeedsRebuild = false;
|
fNeedsRebuild = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.managedbuilder.builddescription.IBuildStep#getBuildDescription()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IBuildDescription getBuildDescription() {
|
public IBuildDescription getBuildDescription() {
|
||||||
return fBuildDescription;
|
return fBuildDescription;
|
||||||
|
@ -582,7 +552,8 @@ public class BuildStep implements IBuildStep {
|
||||||
if (arg != null) {
|
if (arg != null) {
|
||||||
if (arg.getIoType() != null)
|
if (arg.getIoType() != null)
|
||||||
return ((IInputType) arg.getIoType()).getMultipleOfType();
|
return ((IInputType) arg.getIoType()).getMultipleOfType();
|
||||||
return fTool != null && fTool == ((Configuration)fBuildDescription.getConfiguration()).calculateTargetTool();
|
return fTool != null
|
||||||
|
&& fTool == ((Configuration) fBuildDescription.getConfiguration()).calculateTargetTool();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -625,30 +596,27 @@ public class BuildStep implements IBuildStep {
|
||||||
if (j != 0) {
|
if (j != 0) {
|
||||||
optVal += " "; //$NON-NLS-1$
|
optVal += " "; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
optVal += BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation()).toOSString();
|
optVal += BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation())
|
||||||
|
.toOSString();
|
||||||
}
|
}
|
||||||
ManagedBuildManager.setOption(cfg, fTool, assignToOption, optVal);
|
ManagedBuildManager.setOption(cfg, fTool, assignToOption, optVal);
|
||||||
} else if (
|
} else if (optType == IOption.STRING_LIST || optType == IOption.LIBRARIES
|
||||||
optType == IOption.STRING_LIST ||
|
|| optType == IOption.OBJECTS || optType == IOption.INCLUDE_PATH
|
||||||
optType == IOption.LIBRARIES ||
|
|| optType == IOption.PREPROCESSOR_SYMBOLS || optType == IOption.INCLUDE_FILES
|
||||||
optType == IOption.OBJECTS ||
|
|| optType == IOption.LIBRARY_PATHS || optType == IOption.LIBRARY_FILES
|
||||||
optType == IOption.INCLUDE_PATH ||
|
|| optType == IOption.MACRO_FILES || optType == IOption.UNDEF_INCLUDE_PATH
|
||||||
optType == IOption.PREPROCESSOR_SYMBOLS ||
|
|| optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS
|
||||||
optType == IOption.INCLUDE_FILES ||
|
|| optType == IOption.UNDEF_INCLUDE_FILES
|
||||||
optType == IOption.LIBRARY_PATHS ||
|
|| optType == IOption.UNDEF_LIBRARY_PATHS
|
||||||
optType == IOption.LIBRARY_FILES ||
|
|| optType == IOption.UNDEF_LIBRARY_FILES
|
||||||
optType == IOption.MACRO_FILES ||
|
|| optType == IOption.UNDEF_MACRO_FILES) {
|
||||||
optType == IOption.UNDEF_INCLUDE_PATH ||
|
// Mote that when using the enumerated inputs, the path(s) must be translated from
|
||||||
optType == IOption.UNDEF_PREPROCESSOR_SYMBOLS ||
|
// project relative
|
||||||
optType == IOption.UNDEF_INCLUDE_FILES ||
|
|
||||||
optType == IOption.UNDEF_LIBRARY_PATHS ||
|
|
||||||
optType == IOption.UNDEF_LIBRARY_FILES ||
|
|
||||||
optType == IOption.UNDEF_MACRO_FILES){
|
|
||||||
// Mote that when using the enumerated inputs, the path(s) must be translated from project relative
|
|
||||||
// to top build directory relative
|
// to top build directory relative
|
||||||
String[] paths = new String[bRcs.length];
|
String[] paths = new String[bRcs.length];
|
||||||
for (int j = 0; j < bRcs.length; j++) {
|
for (int j = 0; j < bRcs.length; j++) {
|
||||||
paths[j] = BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation()).toOSString();
|
paths[j] = BuildDescriptionManager.getRelPath(cwd, bRcs[j].getLocation())
|
||||||
|
.toOSString();
|
||||||
}
|
}
|
||||||
ManagedBuildManager.setOption(cfg, fTool, assignToOption, paths);
|
ManagedBuildManager.setOption(cfg, fTool, assignToOption, paths);
|
||||||
} else if (optType == IOption.BOOLEAN) {
|
} else if (optType == IOption.BOOLEAN) {
|
||||||
|
@ -659,7 +627,8 @@ public class BuildStep implements IBuildStep {
|
||||||
}
|
}
|
||||||
} else if (optType == IOption.ENUMERATED || optType == IOption.TREE) {
|
} else if (optType == IOption.ENUMERATED || optType == IOption.TREE) {
|
||||||
if (bRcs.length > 0) {
|
if (bRcs.length > 0) {
|
||||||
ManagedBuildManager.setOption(cfg, fTool, assignToOption, BuildDescriptionManager.getRelPath(cwd, bRcs[0].getLocation()).toOSString());
|
ManagedBuildManager.setOption(cfg, fTool, assignToOption, BuildDescriptionManager
|
||||||
|
.getRelPath(cwd, bRcs[0].getLocation()).toOSString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (BuildException ex) {
|
} catch (BuildException ex) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue