mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
1.File context macro support implemented
2.New MBS pre-defined macros added that represent tool/tool-chain/builder version 3.Some fixes for the option specific macros functionslity
This commit is contained in:
parent
4fa15e42ed
commit
fcddfaecbf
12 changed files with 195 additions and 162 deletions
|
@ -206,7 +206,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
assertNotNull(opt);
|
assertNotNull(opt);
|
||||||
|
|
||||||
// standard check of suppliers # and attempt to add macro (should fail)
|
// standard check of suppliers # and attempt to add macro (should fail)
|
||||||
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,tc));
|
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t));
|
||||||
assertNotNull(ms);
|
assertNotNull(ms);
|
||||||
assertEquals(ms.length, 1);
|
assertEquals(ms.length, 1);
|
||||||
assertFalse(addMacro(TEST, IBuildMacro.VALUE_TEXT, TST[IBuildMacroProvider.CONTEXT_OPTION], IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t)));
|
assertFalse(addMacro(TEST, IBuildMacro.VALUE_TEXT, TST[IBuildMacroProvider.CONTEXT_OPTION], IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t)));
|
||||||
|
@ -214,7 +214,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
// modify value and check that macros is resolved
|
// modify value and check that macros is resolved
|
||||||
try {
|
try {
|
||||||
opt = cfgs[0].setOption(t, opt, "222 " + INC_DEF); //$NON-NLS-1$
|
opt = cfgs[0].setOption(t, opt, "222 " + INC_DEF); //$NON-NLS-1$
|
||||||
String a = mp.resolveValue(opt.getStringValue(), UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,tc));
|
String a = mp.resolveValue(opt.getStringValue(), UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t));
|
||||||
assertEquals(a, "222 111"); //$NON-NLS-1$
|
assertEquals(a, "222 111"); //$NON-NLS-1$
|
||||||
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
||||||
catch (BuildException e) { fail(e.getLocalizedMessage()); }
|
catch (BuildException e) { fail(e.getLocalizedMessage()); }
|
||||||
|
@ -225,7 +225,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
IOption ropt = rc.getTools()[0].getOptionById(OPT_IDS);
|
IOption ropt = rc.getTools()[0].getOptionById(OPT_IDS);
|
||||||
try {
|
try {
|
||||||
ropt = rc.setOption(rc.getTools()[0], ropt, "333 " + INC_DEF); //$NON-NLS-1$
|
ropt = rc.setOption(rc.getTools()[0], ropt, "333 " + INC_DEF); //$NON-NLS-1$
|
||||||
String a = mp.resolveValue(ropt.getStringValue(), UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,tc));
|
String a = mp.resolveValue(ropt.getStringValue(), UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t));
|
||||||
assertEquals(a, "333 111"); //$NON-NLS-1$
|
assertEquals(a, "333 111"); //$NON-NLS-1$
|
||||||
} catch (Exception e) { fail(e.getLocalizedMessage()); }
|
} catch (Exception e) { fail(e.getLocalizedMessage()); }
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
IToolChain tc = cfgs[0].getToolChain();
|
IToolChain tc = cfgs[0].getToolChain();
|
||||||
ITool t = cfgs[0].getTools()[0];
|
ITool t = cfgs[0].getTools()[0];
|
||||||
IOption opt = t.getOptionById(OPT_IDL);
|
IOption opt = t.getOptionById(OPT_IDL);
|
||||||
OptionContextData ocd = new OptionContextData(opt,tc);
|
OptionContextData ocd = new OptionContextData(opt,t);
|
||||||
assertNotNull(opt);
|
assertNotNull(opt);
|
||||||
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, ocd);
|
ms = mp.getSuppliers(IBuildMacroProvider.CONTEXT_OPTION, ocd);
|
||||||
assertNotNull(ms);
|
assertNotNull(ms);
|
||||||
|
@ -259,7 +259,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
ArrayList ar = new ArrayList(1);
|
ArrayList ar = new ArrayList(1);
|
||||||
for (int i=0; i<set1.length; i++) {
|
for (int i=0; i<set1.length; i++) {
|
||||||
try {
|
try {
|
||||||
String[] aus = mp.resolveStringListValue(set1[i], UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,tc));
|
String[] aus = mp.resolveStringListValue(set1[i], UNKNOWN, LISTSEP, IBuildMacroProvider.CONTEXT_OPTION, new OptionContextData(opt,t));
|
||||||
if (aus == null) continue;
|
if (aus == null) continue;
|
||||||
for (int j=0; j<aus.length; j++) ar.add(aus[j]);
|
for (int j=0; j<aus.length; j++) ar.add(aus[j]);
|
||||||
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
||||||
|
@ -326,14 +326,14 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
values0wAbs[8] = dev1 + values0wAbs[8];
|
values0wAbs[8] = dev1 + values0wAbs[8];
|
||||||
values0wAbs[9] = dev1 + values0wAbs[9];
|
values0wAbs[9] = dev1 + values0wAbs[9];
|
||||||
|
|
||||||
fd = new FileContextData(new Path(values0wAbs[3]), new Path(values0wAbs[8]),opt,cfgs[0].getToolChain());
|
fd = new FileContextData(new Path(values0wAbs[3]), new Path(values0wAbs[8]),opt,t);
|
||||||
for (int i=0; i<names.length; i++)
|
for (int i=0; i<names.length; i++)
|
||||||
try {
|
try {
|
||||||
assertEquals(values0wAbs[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
assertEquals(values0wAbs[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
||||||
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
} catch (BuildMacroException e) { fail(e.getLocalizedMessage()); }
|
||||||
|
|
||||||
// check that relative path are reported OK
|
// check that relative path are reported OK
|
||||||
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,cfgs[0].getToolChain());
|
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,t);
|
||||||
for (int i=0; i<names.length; i++)
|
for (int i=0; i<names.length; i++)
|
||||||
try {
|
try {
|
||||||
assertEquals(values0wRel[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
assertEquals(values0wRel[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
||||||
|
@ -368,7 +368,7 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// check relative path only
|
// check relative path only
|
||||||
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,cfgs[0].getToolChain());
|
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,t);
|
||||||
for (int i=0; i<names.length; i++)
|
for (int i=0; i<names.length; i++)
|
||||||
try {
|
try {
|
||||||
assertEquals(values0u[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
assertEquals(values0u[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
||||||
|
@ -384,8 +384,8 @@ public class ManagedBuildMacrosTests extends TestCase {
|
||||||
TST[IBuildMacroProvider.CONTEXT_FILE], IBuildMacroProvider.CONTEXT_FILE, fd));
|
TST[IBuildMacroProvider.CONTEXT_FILE], IBuildMacroProvider.CONTEXT_FILE, fd));
|
||||||
|
|
||||||
// For config #3, macros should contain lines specified in plugin.xml
|
// For config #3, macros should contain lines specified in plugin.xml
|
||||||
opt = cfgs[3].getTools()[0].getOptions()[0];
|
opt = cfgs[1].getTools()[0].getOptions()[0];
|
||||||
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,cfgs[1].getToolChain());
|
fd = new FileContextData(p.append(EIN), p.append(AUS),opt,cfgs[1].getTools()[0]);
|
||||||
for (int i=0; i<names.length; i++)
|
for (int i=0; i<names.length; i++)
|
||||||
try {
|
try {
|
||||||
assertEquals(values1[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
assertEquals(values1[i], mp.getMacro(names[i], IBuildMacroProvider.CONTEXT_FILE, fd, flag).getStringValue());
|
||||||
|
|
|
@ -434,7 +434,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option, getDefaultConfiguration().getToolChain()));
|
new OptionContextData(option, tool));
|
||||||
if(resolved != null && resolved.length > 0){
|
if(resolved != null && resolved.length > 0){
|
||||||
for(int k = 0; k < resolved.length; k++){
|
for(int k = 0; k < resolved.length; k++){
|
||||||
String string = resolved[k];
|
String string = resolved[k];
|
||||||
|
@ -733,8 +733,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputLocation,
|
new FileContextData(inputLocation,
|
||||||
outputLocation, null,
|
outputLocation, null,
|
||||||
getDefaultConfiguration()
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
@ -747,8 +746,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputLocation,
|
new FileContextData(inputLocation,
|
||||||
outputLocation, null,
|
outputLocation, null,
|
||||||
getDefaultConfiguration()
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
cmd = resolvedCommand;
|
cmd = resolvedCommand;
|
||||||
|
@ -790,7 +788,7 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option, getDefaultConfiguration().getToolChain()));
|
new OptionContextData(option, tool));
|
||||||
if(resolved != null && resolved.length > 0)
|
if(resolved != null && resolved.length > 0)
|
||||||
objs.addAll(Arrays.asList(resolved));
|
objs.addAll(Arrays.asList(resolved));
|
||||||
} catch (BuildMacroException e) {
|
} catch (BuildMacroException e) {
|
||||||
|
@ -1342,12 +1340,12 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
|
||||||
if (entryType == IPathEntry.CDT_INCLUDE_FILE &&
|
if (entryType == IPathEntry.CDT_INCLUDE_FILE &&
|
||||||
op[j].getValueType() == IOption.INCLUDE_PATH)
|
op[j].getValueType() == IOption.INCLUDE_PATH)
|
||||||
{
|
{
|
||||||
OptionContextData ocd = new OptionContextData(op[j], obj);
|
OptionContextData ocd = new OptionContextData(op[j], t[i]);
|
||||||
addIncludes(entries, builtIns ? op[j].getBuiltIns() : op[j].getIncludePaths(), resPath, ocd);
|
addIncludes(entries, builtIns ? op[j].getBuiltIns() : op[j].getIncludePaths(), resPath, ocd);
|
||||||
} else if (entryType == IPathEntry.CDT_LIBRARY &&
|
} else if (entryType == IPathEntry.CDT_LIBRARY &&
|
||||||
op[j].getValueType() == IOption.LIBRARIES)
|
op[j].getValueType() == IOption.LIBRARIES)
|
||||||
{
|
{
|
||||||
OptionContextData ocd = new OptionContextData(op[j], obj);
|
OptionContextData ocd = new OptionContextData(op[j], t[i]);
|
||||||
addLibraries(entries, builtIns ? op[j].getBuiltIns() : op[j].getLibraries(), resPath, ocd);
|
addLibraries(entries, builtIns ? op[j].getBuiltIns() : op[j].getLibraries(), resPath, ocd);
|
||||||
} else if (entryType == IPathEntry.CDT_MACRO &&
|
} else if (entryType == IPathEntry.CDT_MACRO &&
|
||||||
op[j].getValueType() == IOption.PREPROCESSOR_SYMBOLS)
|
op[j].getValueType() == IOption.PREPROCESSOR_SYMBOLS)
|
||||||
|
|
|
@ -2107,7 +2107,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
String strCmd = option.getCommand();
|
String strCmd = option.getCommand();
|
||||||
String val = option.getStringValue();
|
String val = option.getStringValue();
|
||||||
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputFileLocation, outputFileLocation, option, getParent()));
|
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||||
if (val.length() > 0
|
if (val.length() > 0
|
||||||
&& (val = MacroResolver.resolveToString(val, macroSubstitutor)).length() > 0) {
|
&& (val = MacroResolver.resolveToString(val, macroSubstitutor)).length() > 0) {
|
||||||
sb.append( evaluateCommand( strCmd, val ) );
|
sb.append( evaluateCommand( strCmd, val ) );
|
||||||
|
@ -2117,7 +2117,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
case IOption.STRING_LIST :
|
case IOption.STRING_LIST :
|
||||||
String listCmd = option.getCommand();
|
String listCmd = option.getCommand();
|
||||||
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputFileLocation, outputFileLocation, option, getParent()));
|
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||||
String[] list = MacroResolver.resolveStringListValues(option.getStringListValue(), macroSubstitutor, true);
|
String[] list = MacroResolver.resolveStringListValues(option.getStringListValue(), macroSubstitutor, true);
|
||||||
if(list != null){
|
if(list != null){
|
||||||
for (int j = 0; j < list.length; j++) {
|
for (int j = 0; j < list.length; j++) {
|
||||||
|
@ -2131,7 +2131,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
case IOption.INCLUDE_PATH :
|
case IOption.INCLUDE_PATH :
|
||||||
String incCmd = option.getCommand();
|
String incCmd = option.getCommand();
|
||||||
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputFileLocation, outputFileLocation, option, getParent()));
|
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||||
String[] paths = MacroResolver.resolveStringListValues(option.getIncludePaths(), macroSubstitutor, true);
|
String[] paths = MacroResolver.resolveStringListValues(option.getIncludePaths(), macroSubstitutor, true);
|
||||||
if(paths != null){
|
if(paths != null){
|
||||||
for (int j = 0; j < paths.length; j++) {
|
for (int j = 0; j < paths.length; j++) {
|
||||||
|
@ -2145,7 +2145,7 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory {
|
||||||
case IOption.PREPROCESSOR_SYMBOLS :
|
case IOption.PREPROCESSOR_SYMBOLS :
|
||||||
String defCmd = option.getCommand();
|
String defCmd = option.getCommand();
|
||||||
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
macroSubstitutor.setMacroContextInfo(IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(inputFileLocation, outputFileLocation, option, getParent()));
|
new FileContextData(inputFileLocation, outputFileLocation, option, this));
|
||||||
String[] symbols = MacroResolver.resolveStringListValues(option.getDefinedSymbols(), macroSubstitutor, true);
|
String[] symbols = MacroResolver.resolveStringListValues(option.getDefinedSymbols(), macroSubstitutor, true);
|
||||||
if(symbols != null){
|
if(symbols != null){
|
||||||
for (int j = 0; j < symbols.length; j++) {
|
for (int j = 0; j < symbols.length; j++) {
|
||||||
|
|
|
@ -69,14 +69,14 @@ public class CheckStringExpression implements IBooleanExpression {
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
delimiter,
|
delimiter,
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option,configuration)
|
new OptionContextData(option,holder)
|
||||||
);
|
);
|
||||||
|
|
||||||
String resolvedValue = provider.resolveValue(fValue,
|
String resolvedValue = provider.resolveValue(fValue,
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
delimiter,
|
delimiter,
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option,configuration)
|
new OptionContextData(option,holder)
|
||||||
);
|
);
|
||||||
|
|
||||||
if(fIsRegex){
|
if(fIsRegex){
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.managedbuilder.internal.macros;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
||||||
import org.eclipse.cdt.managedbuilder.core.ITool;
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
@ -60,6 +61,13 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case IBuildMacroProvider.CONTEXT_TOOL:
|
||||||
|
if(data instanceof ITool){
|
||||||
|
return new IBuildMacroSupplier[]{
|
||||||
|
BuildMacroProvider.fMbsMacroSupplier
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
||||||
if(data instanceof IConfiguration){
|
if(data instanceof IConfiguration){
|
||||||
return new IBuildMacroSupplier[]{
|
return new IBuildMacroSupplier[]{
|
||||||
|
@ -150,22 +158,30 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
|
||||||
case IBuildMacroProvider.CONTEXT_OPTION:
|
case IBuildMacroProvider.CONTEXT_OPTION:
|
||||||
if(fData instanceof IOptionContextData){
|
if(fData instanceof IOptionContextData){
|
||||||
IOptionContextData optionContext = (IOptionContextData)fData;
|
IOptionContextData optionContext = (IOptionContextData)fData;
|
||||||
IBuildObject buildObj = optionContext.getParent();
|
IHoldsOptions ho = OptionContextData.getHolder(optionContext);
|
||||||
|
if(ho instanceof ITool)
|
||||||
|
return new DefaultMacroContextInfo(
|
||||||
|
IBuildMacroProvider.CONTEXT_TOOL,
|
||||||
|
ho);
|
||||||
|
else if(ho instanceof IToolChain)
|
||||||
|
return new DefaultMacroContextInfo(
|
||||||
|
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||||
|
((IToolChain)ho).getParent());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case IBuildMacroProvider.CONTEXT_TOOL:
|
||||||
|
if(fData instanceof ITool){
|
||||||
|
IBuildObject parent = ((ITool)fData).getParent();
|
||||||
IConfiguration cfg = null;
|
IConfiguration cfg = null;
|
||||||
if(buildObj instanceof ITool)
|
if(parent instanceof IToolChain)
|
||||||
buildObj = ((ITool)buildObj).getParent();
|
cfg = ((IToolChain)parent).getParent();
|
||||||
if(buildObj instanceof IToolChain)
|
else if(parent instanceof IResourceConfiguration)
|
||||||
cfg = ((IToolChain)buildObj).getParent();
|
cfg = ((IResourceConfiguration)parent).getParent();
|
||||||
else if(buildObj instanceof IResourceConfiguration)
|
|
||||||
cfg = ((IResourceConfiguration)buildObj).getParent();
|
|
||||||
else if(buildObj instanceof IConfiguration)
|
|
||||||
cfg = (IConfiguration)buildObj;
|
|
||||||
|
|
||||||
if(cfg != null){
|
if(cfg != null)
|
||||||
return new DefaultMacroContextInfo(
|
return new DefaultMacroContextInfo(
|
||||||
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
IBuildMacroProvider.CONTEXT_CONFIGURATION,
|
||||||
cfg);
|
cfg);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
||||||
|
@ -209,5 +225,4 @@ public class DefaultMacroContextInfo implements IMacroContextInfo {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.managedbuilder.core.BuildException;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||||
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.IHoldsOptions;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
import org.eclipse.cdt.managedbuilder.core.IInputType;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
import org.eclipse.cdt.managedbuilder.core.IManagedProject;
|
||||||
|
@ -38,6 +39,7 @@ import org.eclipse.core.resources.IWorkspace;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
import org.eclipse.core.runtime.PluginVersionIdentifier;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,6 +68,11 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
|
|
||||||
private static final String fOptionMacros[] = new String[]{
|
private static final String fOptionMacros[] = new String[]{
|
||||||
"IncludeDefaults", //$NON-NLS-1$
|
"IncludeDefaults", //$NON-NLS-1$
|
||||||
|
"ParentVersion", //$NON-NLS-1$
|
||||||
|
};
|
||||||
|
|
||||||
|
private static final String fToolMacros[] = new String[]{
|
||||||
|
"ToolVersion", //$NON-NLS-1$
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String fConfigurationMacros[] = new String[]{
|
private static final String fConfigurationMacros[] = new String[]{
|
||||||
|
@ -77,6 +84,8 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
"BuildArtifactFilePrefix", //$NON-NLS-1$
|
"BuildArtifactFilePrefix", //$NON-NLS-1$
|
||||||
"TargetOsList", //$NON-NLS-1$
|
"TargetOsList", //$NON-NLS-1$
|
||||||
"TargetArchList", //$NON-NLS-1$
|
"TargetArchList", //$NON-NLS-1$
|
||||||
|
"ToolChainVersion", //$NON-NLS-1$
|
||||||
|
"BuilderVersion", //$NON-NLS-1$
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String fProjectMacros[] = new String[]{
|
private static final String fProjectMacros[] = new String[]{
|
||||||
|
@ -271,6 +280,9 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
case IBuildMacroProvider.CONTEXT_OPTION:
|
case IBuildMacroProvider.CONTEXT_OPTION:
|
||||||
names = fOptionMacros;
|
names = fOptionMacros;
|
||||||
break;
|
break;
|
||||||
|
case IBuildMacroProvider.CONTEXT_TOOL:
|
||||||
|
names = fToolMacros;
|
||||||
|
break;
|
||||||
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
||||||
names = fConfigurationMacros;
|
names = fConfigurationMacros;
|
||||||
break;
|
break;
|
||||||
|
@ -311,8 +323,10 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
case IBuildMacroProvider.CONTEXT_FILE:
|
case IBuildMacroProvider.CONTEXT_FILE:
|
||||||
if(contextData instanceof IFileContextData){
|
if(contextData instanceof IFileContextData){
|
||||||
for(int i = 0; i < fFileMacros.length; i++){
|
for(int i = 0; i < fFileMacros.length; i++){
|
||||||
if(macroName.equals(fFileMacros[i]))
|
if(macroName.equals(fFileMacros[i])){
|
||||||
macro = new FileContextMacro(macroName,(IFileContextData)contextData);
|
macro = new FileContextMacro(macroName,(IFileContextData)contextData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -321,6 +335,11 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
macro = getMacro(macroName, (IOptionContextData)contextData);
|
macro = getMacro(macroName, (IOptionContextData)contextData);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case IBuildMacroProvider.CONTEXT_TOOL:
|
||||||
|
if(contextData instanceof ITool){
|
||||||
|
macro = getMacro(macroName, (ITool)contextData);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
case IBuildMacroProvider.CONTEXT_CONFIGURATION:
|
||||||
if(contextData instanceof IConfiguration){
|
if(contextData instanceof IConfiguration){
|
||||||
macro = getMacro(macroName, (IConfiguration)contextData);
|
macro = getMacro(macroName, (IConfiguration)contextData);
|
||||||
|
@ -354,6 +373,18 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
if(!canHandle(optionContext))
|
if(!canHandle(optionContext))
|
||||||
optionContext = null;
|
optionContext = null;
|
||||||
macro = new OptionMacro(macroName,optionContext);
|
macro = new OptionMacro(macroName,optionContext);
|
||||||
|
} else if("ParentVersion".equals(macroName)){
|
||||||
|
IHoldsOptions holder = OptionContextData.getHolder(optionContext);
|
||||||
|
if(holder != null && holder.getVersion() != null)
|
||||||
|
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,holder.getVersion().toString());
|
||||||
|
}
|
||||||
|
return macro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IBuildMacro getMacro(String macroName, ITool tool){
|
||||||
|
IBuildMacro macro = null;
|
||||||
|
if("ToolVersion".equals(macroName) && tool.getVersion() != null){ //$NON-NLS-1$
|
||||||
|
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,tool.getVersion().toString());
|
||||||
}
|
}
|
||||||
return macro;
|
return macro;
|
||||||
}
|
}
|
||||||
|
@ -513,6 +544,15 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT_LIST,archList);
|
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT_LIST,archList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else if("ToolChainVersion".equals(macroName)){ //$NON-NLS-1$
|
||||||
|
if(cfg.getToolChain().getVersion() != null)
|
||||||
|
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,cfg.getToolChain().getVersion().toString());
|
||||||
|
}
|
||||||
|
else if("BuilderVersion".equals(macroName)){ //$NON-NLS-1$
|
||||||
|
PluginVersionIdentifier version = cfg.getToolChain().getBuilder().getVersion();
|
||||||
|
if(version != null)
|
||||||
|
macro = new BuildMacro(macroName,IBuildMacro.VALUE_TEXT,version.toString());
|
||||||
|
}
|
||||||
return macro;
|
return macro;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,83 +937,30 @@ public class MbsMacroSupplier implements IBuildMacroSupplier {
|
||||||
if (parent instanceof ITool) {
|
if (parent instanceof ITool) {
|
||||||
tool = (ITool)parent;
|
tool = (ITool)parent;
|
||||||
}
|
}
|
||||||
IBuildObject bo = (optionContext instanceof OptionData) ?
|
IBuildObject bObj = (optionContext instanceof OptionData) ?
|
||||||
((OptionData)optionContext).getOptionContainer() : optionContext.getParent();
|
((OptionData)optionContext).getOptionContainer() : optionContext.getParent();
|
||||||
IBuildObject parentObject = null;
|
|
||||||
if(bo instanceof ITool)
|
IResourceConfiguration rcCfg = null;
|
||||||
bo = ((ITool)bo).getParent();
|
ITool holderTool = null;
|
||||||
else if(bo instanceof IConfiguration)
|
if(bObj instanceof ITool){
|
||||||
bo = ((IConfiguration)bo).getToolChain();
|
holderTool = (ITool)bObj;
|
||||||
|
IBuildObject p = holderTool.getParent();
|
||||||
if(tool != null && bo instanceof IResourceConfiguration){
|
if(p instanceof IResourceConfiguration)
|
||||||
|
rcCfg = (IResourceConfiguration)p;
|
||||||
IToolChain toolChain = null;
|
} else if(bObj instanceof IResourceConfiguration)
|
||||||
IConfiguration cfg = null;
|
rcCfg = (IResourceConfiguration)bObj;
|
||||||
|
|
||||||
IResourceConfiguration rc = (IResourceConfiguration)bo;
|
IBuildObject parentObject = rcCfg == null ? bObj : rcCfg.getParent();
|
||||||
cfg = rc.getParent();
|
|
||||||
toolChain = cfg.getToolChain();
|
if(rcCfg != null && rcCfg.getTool(tool.getId()) != null){
|
||||||
parentObject = toolChain;
|
tool = tool.getSuperClass();
|
||||||
if(rc.getTool(tool.getId()) != null){
|
parentOption = tool.getOptionBySuperClassId(option.getSuperClass().getId());
|
||||||
//get the configuration tool
|
|
||||||
tool = tool.getSuperClass();
|
|
||||||
IOption opts[] = tool.getOptions();
|
|
||||||
IOption superClass = option;
|
|
||||||
do{
|
|
||||||
for(int i = 0; i < opts.length; i++){
|
|
||||||
if(superClass.equals(opts[i]) || superClass.equals(opts[i].getSuperClass())){
|
|
||||||
parentOption = opts[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(parentOption != null)
|
|
||||||
break;
|
|
||||||
}while((superClass = superClass.getSuperClass()) != null);
|
|
||||||
} else if(toolChain.getTool(tool.getId()) != null){
|
|
||||||
parentOption = option.getSuperClass();
|
|
||||||
} else {
|
|
||||||
ITool tools[] = toolChain.getTools();
|
|
||||||
ITool superClasses[] = new ITool[tools.length];
|
|
||||||
int i = 0;
|
|
||||||
for(i = 0; i < tools.length; i++){
|
|
||||||
superClasses[i] = tools[i];
|
|
||||||
}
|
|
||||||
for(i = 0; i < tools.length; i++){
|
|
||||||
if(tool.equals(superClasses[i]))
|
|
||||||
break;
|
|
||||||
superClasses[i] = tools[i].getSuperClass();
|
|
||||||
}
|
|
||||||
if(i < tools.length){
|
|
||||||
tool = tools[i];
|
|
||||||
IOption opts[] = tool.getOptions();
|
|
||||||
IOption superClassOpts[] = new IOption[opts.length];
|
|
||||||
for(i = 0; i < opts.length; i++){
|
|
||||||
superClassOpts[i] = opts[i];
|
|
||||||
}
|
|
||||||
for(i = 0; i < opts.length; i++){
|
|
||||||
if(superClassOpts[i] != null){
|
|
||||||
if(option.equals(superClassOpts[i]))
|
|
||||||
break;
|
|
||||||
superClassOpts[i] = superClassOpts[i].getSuperClass();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(i < opts.length)
|
|
||||||
parentOption = opts[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
parentOption = option.getSuperClass();
|
parentOption = option.getSuperClass();
|
||||||
if(parentOption != null){
|
|
||||||
IBuildObject parentParent = parentOption.getParent();
|
|
||||||
if (parentParent instanceof ITool)
|
|
||||||
parentObject = ((ITool)parentParent).getParent();
|
|
||||||
else if (parentParent instanceof IToolChain)
|
|
||||||
parentObject = parentParent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parentOption != null)
|
if(parentOption != null)
|
||||||
return new OptionData(parentOption,bo,parentObject);
|
return new OptionData(parentOption,bObj,parentObject);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,12 @@
|
||||||
package org.eclipse.cdt.managedbuilder.internal.macros;
|
package org.eclipse.cdt.managedbuilder.internal.macros;
|
||||||
|
|
||||||
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
import org.eclipse.cdt.managedbuilder.core.IBuildObject;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IHoldsOptions;
|
||||||
import org.eclipse.cdt.managedbuilder.core.IOption;
|
import org.eclipse.cdt.managedbuilder.core.IOption;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IResourceConfiguration;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ITool;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IToolChain;
|
||||||
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
|
import org.eclipse.cdt.managedbuilder.macros.IOptionContextData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,4 +46,46 @@ public class OptionContextData implements IOptionContextData {
|
||||||
return fParent;
|
return fParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IHoldsOptions getHolder(IOptionContextData data){
|
||||||
|
IOption option = data.getOption();
|
||||||
|
if(option == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
IBuildObject buildObj = data.getParent();
|
||||||
|
IToolChain tCh = null;
|
||||||
|
IHoldsOptions ho = null;
|
||||||
|
IResourceConfiguration rcCfg = null;
|
||||||
|
if(buildObj instanceof ITool)
|
||||||
|
ho = (ITool)buildObj;
|
||||||
|
if(buildObj instanceof IToolChain)
|
||||||
|
tCh = (IToolChain)buildObj;
|
||||||
|
else if(buildObj instanceof IResourceConfiguration)
|
||||||
|
rcCfg = (IResourceConfiguration)buildObj;
|
||||||
|
else if(buildObj instanceof IConfiguration)
|
||||||
|
tCh = ((IConfiguration)buildObj).getToolChain();
|
||||||
|
|
||||||
|
if(ho == null){
|
||||||
|
ho = option.getOptionHolder();
|
||||||
|
ITool tools[] = null;
|
||||||
|
if(tCh != null){
|
||||||
|
for(IToolChain cur = tCh; cur != null; cur = cur.getSuperClass()){
|
||||||
|
if(cur == ho)
|
||||||
|
return tCh;
|
||||||
|
}
|
||||||
|
tools = tCh.getTools();
|
||||||
|
} else if(rcCfg != null){
|
||||||
|
tools = rcCfg.getTools();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tools != null){
|
||||||
|
for(int i = 0; i < tools.length; i++){
|
||||||
|
for(ITool cur = tools[i]; cur != null; cur = cur.getSuperClass()){
|
||||||
|
if(cur == ho)
|
||||||
|
return tools[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ho;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ public interface IBuildMacroProvider{
|
||||||
public final static int CONTEXT_WORKSPACE = 5;
|
public final static int CONTEXT_WORKSPACE = 5;
|
||||||
public final static int CONTEXT_INSTALLATIONS = 6;
|
public final static int CONTEXT_INSTALLATIONS = 6;
|
||||||
public final static int CONTEXT_ECLIPSEENV = 7;
|
public final static int CONTEXT_ECLIPSEENV = 7;
|
||||||
|
public final static int CONTEXT_TOOL = 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -27,7 +27,12 @@ public interface IOptionContextData {
|
||||||
public IOption getOption();
|
public IOption getOption();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns IBuildObject that could be either an IToolChain or an IResourceConfiguration reference
|
* Returns IBuildObject that represents the option holder.
|
||||||
|
* For the backward compatibility MBS will also support the cases
|
||||||
|
* when this method returns either an IToolChain or IResourceConfiguration.
|
||||||
|
* In this case MBS will try to obtain the option holder automatically,
|
||||||
|
* but it might fail in case the tool-chain/resource configuration contains
|
||||||
|
* more than one tools with the same super-class
|
||||||
*
|
*
|
||||||
* @return IBuildObject
|
* @return IBuildObject
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -136,9 +136,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// use builder variables
|
// use builder variables
|
||||||
resolvedCommand = ManagedBuildManager
|
resolvedCommand = ManagedBuildManager
|
||||||
|
@ -149,9 +147,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
|
@ -195,9 +191,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// use builder variables
|
// use builder variables
|
||||||
resolvedCommand = ManagedBuildManager
|
resolvedCommand = ManagedBuildManager
|
||||||
|
@ -208,9 +202,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
buildCmd = resolvedCommand;
|
buildCmd = resolvedCommand;
|
||||||
|
@ -220,14 +212,24 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
String cmd = info.getToolForSource(inputExtension);
|
ITool tool = null;
|
||||||
|
tools = config.getFilteredTools();
|
||||||
|
for (int index = 0; index < tools.length; index++) {
|
||||||
|
ITool tmp = tools[index];
|
||||||
|
if (tmp.buildsFileType(inputExtension)) {
|
||||||
|
tool = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String cmd = tool != null ? tool.getToolCommand() : null;
|
||||||
|
|
||||||
//try to resolve the build macros in the tool command
|
//try to resolve the build macros in the tool command
|
||||||
try{
|
try{
|
||||||
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
|
String resolvedCommand = ManagedBuildManager.getBuildMacroProvider().resolveValueToMakefileFormat(cmd,
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),null,null,info.getDefaultConfiguration().getToolChain()));
|
new FileContextData(resource.getLocation(),null,null,tool));
|
||||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
cmd = resolvedCommand;
|
cmd = resolvedCommand;
|
||||||
|
|
||||||
|
@ -266,9 +268,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// use builder variables
|
// use builder variables
|
||||||
resolvedCommand = ManagedBuildManager
|
resolvedCommand = ManagedBuildManager
|
||||||
|
@ -279,9 +279,7 @@ public class DefaultGCCDependencyCalculator implements IManagedDependencyGenerat
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(resource.getLocation(),
|
new FileContextData(resource.getLocation(),
|
||||||
null, null, info
|
null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
buildCmd = resolvedCommand;
|
buildCmd = resolvedCommand;
|
||||||
|
|
|
@ -1547,7 +1547,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
EMPTY_STRING,
|
EMPTY_STRING,
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(null,null,null,info.getDefaultConfiguration().getToolChain()));
|
new FileContextData(null,null,null,tool));
|
||||||
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
command = resolvedCommand;
|
command = resolvedCommand;
|
||||||
|
|
||||||
|
@ -1581,9 +1581,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
EMPTY_STRING,
|
EMPTY_STRING,
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(null, null, null, info
|
new FileContextData(null, null, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
buildCmd = resolvedCommand;
|
buildCmd = resolvedCommand;
|
||||||
|
|
||||||
|
@ -2149,7 +2147,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
|| MacroResolver.getReferencedExplitFileMacros(tool
|
|| MacroResolver.getReferencedExplitFileMacros(tool
|
||||||
.getToolCommand(), IBuildMacroProvider.CONTEXT_FILE,
|
.getToolCommand(), IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation, outputLocation,
|
new FileContextData(sourceLocation, outputLocation,
|
||||||
null, config.getToolChain())).length > 0;
|
null, tool)).length > 0;
|
||||||
//get and resolve command
|
//get and resolve command
|
||||||
String cmd = tool.getToolCommand();
|
String cmd = tool.getToolCommand();
|
||||||
|
|
||||||
|
@ -2163,9 +2161,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// if we need an explicit rule then don't use any builder
|
// if we need an explicit rule then don't use any builder
|
||||||
// variables, resolve everything
|
// variables, resolve everything
|
||||||
|
@ -2177,9 +2173,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
|
@ -2346,9 +2340,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// if we need an explicit rule then don't use any builder
|
// if we need an explicit rule then don't use any builder
|
||||||
// variables, resolve everything
|
// variables, resolve everything
|
||||||
|
@ -2360,9 +2352,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
|
@ -2423,9 +2413,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
// if we need an explicit rule then don't use any builder
|
// if we need an explicit rule then don't use any builder
|
||||||
// variables, resolve everything
|
// variables, resolve everything
|
||||||
|
@ -2437,9 +2425,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
WHITESPACE,
|
WHITESPACE,
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null, info
|
outputLocation, null, tool));
|
||||||
.getDefaultConfiguration()
|
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
if ((resolvedCommand = resolvedCommand.trim()).length() > 0)
|
||||||
|
@ -2474,8 +2460,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null,
|
outputLocation, null,
|
||||||
info.getDefaultConfiguration()
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
@ -2487,8 +2472,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
|
||||||
IBuildMacroProvider.CONTEXT_FILE,
|
IBuildMacroProvider.CONTEXT_FILE,
|
||||||
new FileContextData(sourceLocation,
|
new FileContextData(sourceLocation,
|
||||||
outputLocation, null,
|
outputLocation, null,
|
||||||
info.getDefaultConfiguration()
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (BuildMacroException e) {
|
} catch (BuildMacroException e) {
|
||||||
|
|
|
@ -215,8 +215,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(
|
new OptionContextData(
|
||||||
option,
|
option,
|
||||||
config
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// resolve to makefile variable format
|
// resolve to makefile variable format
|
||||||
|
@ -229,8 +228,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(
|
new OptionContextData(
|
||||||
option,
|
option,
|
||||||
config
|
tool));
|
||||||
.getToolChain()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((resolved = resolved.trim()).length() > 0)
|
if ((resolved = resolved.trim()).length() > 0)
|
||||||
|
@ -539,7 +537,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option, config.getToolChain()));
|
new OptionContextData(option, tool));
|
||||||
if((resolved = resolved.trim()).length() > 0)
|
if((resolved = resolved.trim()).length() > 0)
|
||||||
outputs.set(j, resolved);
|
outputs.set(j, resolved);
|
||||||
} catch (BuildMacroException e){
|
} catch (BuildMacroException e){
|
||||||
|
@ -624,7 +622,7 @@ public class ManagedBuildGnuToolInfo implements IManagedBuildGnuToolInfo {
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option, config.getToolChain()));
|
new OptionContextData(option, tool));
|
||||||
if((resolved = resolved.trim()).length() > 0)
|
if((resolved = resolved.trim()).length() > 0)
|
||||||
outputNames[j] = resolved;
|
outputNames[j] = resolved;
|
||||||
} catch (BuildMacroException e){
|
} catch (BuildMacroException e){
|
||||||
|
|
Loading…
Add table
Reference in a new issue