mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
cleanup: loops to enhanced and spaces, no functionality changes
This commit is contained in:
parent
241396290b
commit
c20ac81db5
1 changed files with 366 additions and 414 deletions
|
@ -334,15 +334,15 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!removed && !rebuild){
|
if(!removed && !rebuild){
|
||||||
for(int i = 0; i < rcs.length; i++){
|
for (BuildResource rc : rcs) {
|
||||||
if(rcs[i].needsRebuild()){
|
if(rc.needsRebuild()){
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("resource " + locationToRel(rcs[i].getLocation()).toString() + " needs rebuild"); //$NON-NLS-1$ //$NON-NLS-2$
|
DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " needs rebuild"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
rebuild = true;
|
rebuild = true;
|
||||||
break;
|
break;
|
||||||
} else if(rcs[i].isRemoved()){
|
} else if(rc.isRemoved()){
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("resource " + locationToRel(rcs[i].getLocation()).toString() + " is removed"); //$NON-NLS-1$ //$NON-NLS-2$
|
DbgUtil.trace("resource " + locationToRel(rc.getLocation()).toString() + " is removed"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
rebuild = true;
|
rebuild = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -355,13 +355,11 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
action.setRemoved();
|
action.setRemoved();
|
||||||
|
|
||||||
IBuildResource[] outRcs = action.getOutputResources();
|
for (IBuildResource outRc : action.getOutputResources()) {
|
||||||
|
|
||||||
for(int i = 0; i < outRcs.length; i++){
|
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("setting remove state for resource " + locationToRel(outRcs[i].getLocation()).toString()); //$NON-NLS-1$
|
DbgUtil.trace("setting remove state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
|
||||||
|
|
||||||
((BuildResource)outRcs[i]).setRemoved(true);
|
((BuildResource)outRc).setRemoved(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(rebuild){
|
} else if(rebuild){
|
||||||
|
@ -370,13 +368,11 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
action.setRebuildState(true);
|
action.setRebuildState(true);
|
||||||
|
|
||||||
IBuildResource[] outRcs = action.getOutputResources();
|
for (IBuildResource outRc : action.getOutputResources()) {
|
||||||
|
|
||||||
for(int i = 0; i < outRcs.length; i++){
|
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("setting rebuild state for resource " + locationToRel(outRcs[i].getLocation()).toString()); //$NON-NLS-1$
|
DbgUtil.trace("setting rebuild state for resource " + locationToRel(outRc.getLocation()).toString()); //$NON-NLS-1$
|
||||||
|
|
||||||
((BuildResource)outRcs[i]).setRebuildState(true);
|
((BuildResource)outRc).setRebuildState(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -449,16 +445,15 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
BuildIOType types[] = input ? (BuildIOType[])step.getInputIOTypes() : (BuildIOType[])step.getOutputIOTypes();
|
BuildIOType types[] = input ? (BuildIOType[])step.getInputIOTypes() : (BuildIOType[])step.getOutputIOTypes();
|
||||||
|
|
||||||
for(int i = 0; i < types.length; i++){
|
for (BuildIOType type : types) {
|
||||||
IBuildResource rcs[] = types[i].getResources();
|
for (IBuildResource rc : type.getResources()) {
|
||||||
for(int j = 0; j < rcs.length; j++){
|
String e = rc.getLocation().getFileExtension();
|
||||||
String e = rcs[j].getLocation().getFileExtension();
|
|
||||||
if(e == null){
|
if(e == null){
|
||||||
if(ext.length() == 0)
|
if(ext.length() == 0)
|
||||||
return types[i];
|
return type;
|
||||||
} else {
|
} else {
|
||||||
if(ext.equals(e))
|
if(ext.equals(e))
|
||||||
return types[i];
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -467,16 +462,11 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
private Map<String, List<ToolAndType>> initToolAndTypeMap(IFolderInfo foInfo){
|
private Map<String, List<ToolAndType>> initToolAndTypeMap(IFolderInfo foInfo){
|
||||||
Map<String, List<ToolAndType>> extToToolAndTypeListMap = new HashMap<String, List<ToolAndType>>();
|
Map<String, List<ToolAndType>> extToToolAndTypeListMap = new HashMap<String, List<ToolAndType>>();
|
||||||
ITool tools[] = foInfo.getFilteredTools();
|
for (ITool tool : foInfo.getFilteredTools()) {
|
||||||
for(int i = 0; i < tools.length; i++){
|
|
||||||
ITool tool = tools[i];
|
|
||||||
IInputType types[] = tool.getInputTypes();
|
IInputType types[] = tool.getInputTypes();
|
||||||
if(types.length != 0){
|
if(types.length != 0){
|
||||||
for(int j = 0; j < types.length; j++){
|
for (IInputType type : types) {
|
||||||
IInputType type = types[j];
|
for (String ext : type.getSourceExtensions(tool)) {
|
||||||
String exts[] = type.getSourceExtensions(tool);
|
|
||||||
for(int k = 0; k < exts.length; k++){
|
|
||||||
String ext = exts[k];
|
|
||||||
if(tool.buildsFileType(ext)){
|
if(tool.buildsFileType(ext)){
|
||||||
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
|
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
|
||||||
if(list == null){
|
if(list == null){
|
||||||
|
@ -488,9 +478,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String exts[] = tool.getAllInputExtensions();
|
for (String ext : tool.getAllInputExtensions()) {
|
||||||
for(int k = 0; k < exts.length; k++){
|
|
||||||
String ext = exts[k];
|
|
||||||
if(tool.buildsFileType(ext)){
|
if(tool.buildsFileType(ext)){
|
||||||
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
|
List<ToolAndType> list = extToToolAndTypeListMap.get(ext);
|
||||||
if(list == null){
|
if(list == null){
|
||||||
|
@ -572,9 +560,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
IOutputType[] secondaryOutputs = fCfg.getToolChain().getSecondaryOutputs();
|
for (IOutputType secondaryOutput : fCfg.getToolChain().getSecondaryOutputs()) {
|
||||||
for(int i = 0; i < secondaryOutputs.length; i++){
|
if(secondaryOutput == inputActionArg.getIoType()){
|
||||||
if(secondaryOutputs[i] == inputActionArg.getIoType()){
|
|
||||||
BuildIOType arg = findTypeForExtension(fOutputStep,true,rc.getLocation().getFileExtension());
|
BuildIOType arg = findTypeForExtension(fOutputStep,true,rc.getLocation().getFileExtension());
|
||||||
if(arg == null || arg.isPrimary()){
|
if(arg == null || arg.isPrimary()){
|
||||||
arg = fOutputStep.createIOType(true, false, null);
|
arg = fOutputStep.createIOType(true, false, null);
|
||||||
|
@ -608,10 +595,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
if(tools.length > 0 )
|
if(tools.length > 0 )
|
||||||
{
|
{
|
||||||
tool = fi.getToolsToInvoke()[0];
|
tool = fi.getToolsToInvoke()[0];
|
||||||
String exts[] = tool.getAllInputExtensions();
|
|
||||||
String locString = location.toString();
|
String locString = location.toString();
|
||||||
for(int i = 0; i < exts.length; i++){
|
for (String e : tool.getAllInputExtensions()) {
|
||||||
String e = exts[i];
|
|
||||||
if(locString.endsWith(e)){
|
if(locString.endsWith(e)){
|
||||||
inputType = tool.getInputType(e);
|
inputType = tool.getInputType(e);
|
||||||
ext = e;
|
ext = e;
|
||||||
|
@ -666,10 +651,10 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
BuildIOType outputs[] = (BuildIOType[])action.getOutputIOTypes();
|
BuildIOType outputs[] = (BuildIOType[])action.getOutputIOTypes();
|
||||||
|
|
||||||
for(int i = 0; i < outputs.length; i++){
|
for (BuildIOType output : outputs) {
|
||||||
BuildResource rcs[] = (BuildResource[])outputs[i].getResources();
|
BuildResource rcs[] = (BuildResource[])output.getResources();
|
||||||
for(int j = 0; j < rcs.length; j++){
|
for (BuildResource outputRc : rcs) {
|
||||||
composeOutputs(action, outputs[i], rcs[j]);
|
composeOutputs(action, output, outputRc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -790,8 +775,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void processBuildState(int state, IPath fullPaths[]){
|
protected void processBuildState(int state, IPath fullPaths[]){
|
||||||
for(int i = 0; i < fullPaths.length; i++){
|
for (IPath fullPath : fullPaths) {
|
||||||
processBuildState(state, fullPaths[i]);
|
processBuildState(state, fullPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -847,9 +832,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleMultiSteps() throws CoreException{
|
private void handleMultiSteps() throws CoreException{
|
||||||
for(int i = 0; i < fOrderedMultiActions.length; i++){
|
for (BuildStep action : fOrderedMultiActions) {
|
||||||
BuildStep action = fOrderedMultiActions[i];
|
|
||||||
|
|
||||||
calculateInputs(action);
|
calculateInputs(action);
|
||||||
|
|
||||||
calculateOutputs(action, action.getPrimaryTypes(true)[0], null);
|
calculateOutputs(action, action.getPrimaryTypes(true)[0], null);
|
||||||
|
@ -859,11 +842,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
BuildIOType args[] = (BuildIOType[])action.getOutputIOTypes();
|
BuildIOType args[] = (BuildIOType[])action.getOutputIOTypes();
|
||||||
|
|
||||||
for(int j = 0; j < args.length; j++){
|
for (BuildIOType arg : args) {
|
||||||
BuildIOType arg = args[j];
|
|
||||||
BuildResource rcs[] = (BuildResource[])arg.getResources();
|
BuildResource rcs[] = (BuildResource[])arg.getResources();
|
||||||
for(int k = 0; k < rcs.length; k++){
|
for (BuildResource rc : rcs) {
|
||||||
BuildResource rc = rcs[k];
|
|
||||||
composeOutputs(action, arg, rc);
|
composeOutputs(action, arg, rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -871,11 +852,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMultiSteps(){
|
private void initMultiSteps(){
|
||||||
ITool tools[] = fCfg.getFilteredTools();
|
|
||||||
ITool targetTool = fCfg.calculateTargetTool();
|
ITool targetTool = fCfg.calculateTargetTool();
|
||||||
|
|
||||||
for(int i = 0; i < tools.length; i++){
|
for (ITool tool : fCfg.getFilteredTools()) {
|
||||||
ITool tool = tools[i];
|
|
||||||
IInputType type = tool.getPrimaryInputType();
|
IInputType type = tool.getPrimaryInputType();
|
||||||
BuildStep action = null;
|
BuildStep action = null;
|
||||||
if(type != null ? type.getMultipleOfType() : tool == targetTool){
|
if(type != null ? type.getMultipleOfType() : tool == targetTool){
|
||||||
|
@ -887,10 +866,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
fOrderedMultiActions = new BuildStep[fToolToMultiStepMap.size()];
|
fOrderedMultiActions = new BuildStep[fToolToMultiStepMap.size()];
|
||||||
ITool orderedTools[] = getOrderedTools();
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for(int i = 0; i < orderedTools.length; i++){
|
for (ITool orderedTool : getOrderedTools()) {
|
||||||
BuildStep action = fToolToMultiStepMap.get(orderedTools[i]);
|
BuildStep action = fToolToMultiStepMap.get(orderedTool);
|
||||||
if(action != null)
|
if(action != null)
|
||||||
fOrderedMultiActions[index++] = action;
|
fOrderedMultiActions[index++] = action;
|
||||||
}
|
}
|
||||||
|
@ -904,8 +882,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
do{
|
do{
|
||||||
BuildStep steps[] = (BuildStep[])getSteps();
|
BuildStep steps[] = (BuildStep[])getSteps();
|
||||||
foundUnused = false;
|
foundUnused = false;
|
||||||
for(int k = 0; k < steps.length; k++){
|
for (BuildStep step : steps) {
|
||||||
BuildStep step = steps[k];
|
|
||||||
if(step == fOutputStep || step == fInputStep)
|
if(step == fOutputStep || step == fInputStep)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -967,9 +944,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildIOType deps[] = types[1];
|
BuildIOType deps[] = types[1];
|
||||||
for(int i = 0; i < deps.length; i++){
|
for (BuildIOType dep : deps) {
|
||||||
if(deps[i].getResources().length == 0)
|
if(dep.getResources().length == 0)
|
||||||
((BuildStep)deps[i].getStep()).removeIOType(deps[i]);
|
((BuildStep)dep.getStep()).removeIOType(dep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1017,9 +994,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){
|
private BuildResource[] addOutputs(IPath paths[], BuildIOType buildArg, IPath outDirPath){
|
||||||
if(paths != null){
|
if(paths != null){
|
||||||
List<BuildResource> list = new ArrayList<BuildResource>();
|
List<BuildResource> list = new ArrayList<BuildResource>();
|
||||||
for(int k = 0; k < paths.length; k++){
|
for (IPath path : paths) {
|
||||||
IPath outFullPath = paths[k];
|
IPath outFullPath = path;
|
||||||
IPath outWorkspacePath = paths[k];
|
IPath outWorkspacePath = path;
|
||||||
IPath outProjPath;
|
IPath outProjPath;
|
||||||
IPath projLocation = new Path(fProject.getLocationURI().getPath());
|
IPath projLocation = new Path(fProject.getLocationURI().getPath());
|
||||||
|
|
||||||
|
@ -1164,8 +1141,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
ioType = action.createIOType(false, true, type);
|
ioType = action.createIOType(false, true, type);
|
||||||
addOutputs(new IPath[]{path}, ioType, outDirPath);
|
addOutputs(new IPath[]{path}, ioType, outDirPath);
|
||||||
} else if (outTypes != null && outTypes.length > 0) {
|
} else if (outTypes != null && outTypes.length > 0) {
|
||||||
for (int i=0; i<outTypes.length; i++) {
|
for (IOutputType type : outTypes) {
|
||||||
IOutputType type = outTypes[i];
|
|
||||||
boolean primaryOutput = (type == tool.getPrimaryOutputType());
|
boolean primaryOutput = (type == tool.getPrimaryOutputType());
|
||||||
String outputPrefix = type.getOutputPrefix();
|
String outputPrefix = type.getOutputPrefix();
|
||||||
String[] pathStrings = null;
|
String[] pathStrings = null;
|
||||||
|
@ -1407,11 +1383,10 @@ public class BuildDescription implements IBuildDescription {
|
||||||
IInputType type = action.getInputType();
|
IInputType type = action.getInputType();
|
||||||
String ext = null;
|
String ext = null;
|
||||||
if(type != null){
|
if(type != null){
|
||||||
String exts[] = type.getSourceExtensions(tool);
|
|
||||||
String location = buildRc.getLocation().toOSString();
|
String location = buildRc.getLocation().toOSString();
|
||||||
for(int i = 0; i < exts.length; i++){
|
for (String srcExt : type.getSourceExtensions(tool)) {
|
||||||
if(location.endsWith(exts[i])){
|
if(location.endsWith(srcExt)){
|
||||||
ext = exts[i];
|
ext = srcExt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1500,10 +1475,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBuildResource[] getResources(boolean generated){
|
public IBuildResource[] getResources(boolean generated){
|
||||||
IBuildResource[] rcs = getResources();
|
|
||||||
List<IBuildResource> list = new ArrayList<IBuildResource>();
|
List<IBuildResource> list = new ArrayList<IBuildResource>();
|
||||||
for(int i = 0; i < rcs.length; i++){
|
for (IBuildResource rc : getResources()) {
|
||||||
IBuildResource rc = rcs[i];
|
|
||||||
if(generated == (rc.getProducerStep() != fInputStep))
|
if(generated == (rc.getProducerStep() != fInputStep))
|
||||||
list.add(rc);
|
list.add(rc);
|
||||||
}
|
}
|
||||||
|
@ -1528,8 +1501,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg,true,true);
|
IBuildEnvironmentVariable variables[] = ManagedBuildManager.getEnvironmentVariableProvider().getVariables(fCfg,true,true);
|
||||||
Map<String, String> map = new HashMap<String, String>();
|
Map<String, String> map = new HashMap<String, String>();
|
||||||
|
|
||||||
for(int i = 0; i < variables.length; i++){
|
for (IBuildEnvironmentVariable var : variables) {
|
||||||
IBuildEnvironmentVariable var = variables[i];
|
|
||||||
map.put(var.getName(), var.getValue());
|
map.put(var.getName(), var.getValue());
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
|
@ -1552,8 +1524,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
ITool tool = step.getTool();
|
ITool tool = step.getTool();
|
||||||
IInputType[] inTypes = tool.getInputTypes();
|
IInputType[] inTypes = tool.getInputTypes();
|
||||||
if (inTypes != null && inTypes.length > 0) {
|
if (inTypes != null && inTypes.length > 0) {
|
||||||
for (int i=0; i<inTypes.length; i++) {
|
for (IInputType type : inTypes) {
|
||||||
IInputType type = inTypes[i];
|
|
||||||
boolean primaryInput = type.getPrimaryInput();
|
boolean primaryInput = type.getPrimaryInput();
|
||||||
IOption option = tool.getOptionBySuperClassId(type.getOptionId());
|
IOption option = tool.getOptionBySuperClassId(type.getOptionId());
|
||||||
BuildIOType arg = step.getIOTypeForType(type, true);
|
BuildIOType arg = step.getIOTypeForType(type, true);
|
||||||
|
@ -1618,15 +1589,14 @@ public class BuildDescription implements IBuildDescription {
|
||||||
// Get any additional inputs specified in the manifest file or the project file
|
// Get any additional inputs specified in the manifest file or the project file
|
||||||
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
|
IAdditionalInput[] addlInputs = type.getAdditionalInputs();
|
||||||
if (addlInputs != null) {
|
if (addlInputs != null) {
|
||||||
for (int j=0; j<addlInputs.length; j++) {
|
for (IAdditionalInput addlInput : addlInputs) {
|
||||||
IAdditionalInput addlInput = addlInputs[j];
|
|
||||||
int kind = addlInput.getKind();
|
int kind = addlInput.getKind();
|
||||||
if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
|
if (kind == IAdditionalInput.KIND_ADDITIONAL_INPUT ||
|
||||||
kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
|
kind == IAdditionalInput.KIND_ADDITIONAL_INPUT_DEPENDENCY) {
|
||||||
String[] paths = addlInput.getPaths();
|
String[] paths = addlInput.getPaths();
|
||||||
if (paths != null) {
|
if (paths != null) {
|
||||||
for (int k = 0; k < paths.length; k++) {
|
for (String path : paths) {
|
||||||
String strPath = paths[k];
|
String strPath = path;
|
||||||
|
|
||||||
// Translate the path from project relative to
|
// Translate the path from project relative to
|
||||||
// build directory relative
|
// build directory relative
|
||||||
|
@ -1646,8 +1616,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
if(arg == null)
|
if(arg == null)
|
||||||
arg = step.createIOType(true, primaryInput, type);
|
arg = step.createIOType(true, primaryInput, type);
|
||||||
|
|
||||||
for(int o = 0; o < objs.length; o++){
|
for (String userObj : objs) {
|
||||||
addInput(objs[o], arg);
|
addInput(userObj, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO
|
//TODO
|
||||||
|
@ -1695,12 +1665,12 @@ public class BuildDescription implements IBuildDescription {
|
||||||
BuildResource rcs[] = (BuildResource[])step.getInputResources();
|
BuildResource rcs[] = (BuildResource[])step.getInputResources();
|
||||||
Set<IPath> depSet = new HashSet<IPath>();
|
Set<IPath> depSet = new HashSet<IPath>();
|
||||||
|
|
||||||
for(int i = 0; i < rcs.length; i++){
|
for (BuildResource rc : rcs) {
|
||||||
IManagedDependencyCalculator depCalc = getDependencyCalculator(step, rcs[i]);
|
IManagedDependencyCalculator depCalc = getDependencyCalculator(step, rc);
|
||||||
if(depCalc != null){
|
if(depCalc != null){
|
||||||
IPath paths[] = depCalc.getDependencies();
|
IPath paths[] = depCalc.getDependencies();
|
||||||
for(int j = 0; j < paths.length; j++){
|
for (IPath path : paths) {
|
||||||
depSet.add(paths[j]);
|
depSet.add(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1822,10 +1792,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
ITool tool = step.getLibTool();
|
ITool tool = step.getLibTool();
|
||||||
|
|
||||||
if(tool != null){
|
if(tool != null){
|
||||||
IOption[] opts = tool.getOptions();
|
|
||||||
// Look for the lib option type
|
// Look for the lib option type
|
||||||
for (int i = 0; i < opts.length; i++) {
|
for (IOption option : tool.getOptions()) {
|
||||||
IOption option = opts[i];
|
|
||||||
try {
|
try {
|
||||||
if (option.getValueType() == IOption.LIBRARIES) {
|
if (option.getValueType() == IOption.LIBRARIES) {
|
||||||
|
|
||||||
|
@ -1835,19 +1803,16 @@ public class BuildDescription implements IBuildDescription {
|
||||||
if (applicabilitytCalculator == null
|
if (applicabilitytCalculator == null
|
||||||
|| applicabilitytCalculator.isOptionUsedInCommandLine(fCfg, tool, option)) {
|
|| applicabilitytCalculator.isOptionUsedInCommandLine(fCfg, tool, option)) {
|
||||||
String command = option.getCommand();
|
String command = option.getCommand();
|
||||||
String[] allLibs = option.getLibraries();
|
for (String lib : option.getLibraries()) {
|
||||||
for (int j = 0; j < allLibs.length; j++)
|
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
|
String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
|
||||||
allLibs[j],
|
lib,
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
new OptionContextData(option, tool));
|
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 (String string : resolved) {
|
||||||
String string = resolved[k];
|
|
||||||
if(string.length() > 0)
|
if(string.length() > 0)
|
||||||
libs.add(command + string);
|
libs.add(command + string);
|
||||||
}
|
}
|
||||||
|
@ -1876,18 +1841,16 @@ public class BuildDescription implements IBuildDescription {
|
||||||
tool = step.getTool();
|
tool = step.getTool();
|
||||||
|
|
||||||
if(tool != null){
|
if(tool != null){
|
||||||
IOption[] opts = tool.getOptions();
|
|
||||||
// Look for the user object option type
|
// Look for the user object option type
|
||||||
for (int i = 0; i < opts.length; i++) {
|
for (IOption option : tool.getOptions()) {
|
||||||
IOption option = opts[i];
|
|
||||||
try {
|
try {
|
||||||
if (option.getValueType() == IOption.OBJECTS) {
|
if (option.getValueType() == IOption.OBJECTS) {
|
||||||
String unresolved[] = option.getUserObjects();
|
String unresolved[] = option.getUserObjects();
|
||||||
if(unresolved != null && unresolved.length > 0){
|
if(unresolved != null && unresolved.length > 0){
|
||||||
for(int k = 0; k < unresolved.length; k++){
|
for (String unresolvedObj : unresolved) {
|
||||||
try {
|
try {
|
||||||
String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
|
String resolved[] = ManagedBuildManager.getBuildMacroProvider().resolveStringListValueToMakefileFormat(
|
||||||
unresolved[k],
|
unresolvedObj,
|
||||||
"", //$NON-NLS-1$
|
"", //$NON-NLS-1$
|
||||||
" ", //$NON-NLS-1$
|
" ", //$NON-NLS-1$
|
||||||
IBuildMacroProvider.CONTEXT_OPTION,
|
IBuildMacroProvider.CONTEXT_OPTION,
|
||||||
|
@ -1932,8 +1895,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
inLocation = inFullPath;
|
inLocation = inFullPath;
|
||||||
inFullPath = null;
|
inFullPath = null;
|
||||||
IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(inLocation);
|
IFile files[] = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(inLocation);
|
||||||
for(int i = 0; i < files.length; i++){
|
for (IFile file : files) {
|
||||||
IPath fl = files[i].getFullPath();
|
IPath fl = file.getFullPath();
|
||||||
if(fl.segment(0).equals(fProject.getName())){
|
if(fl.segment(0).equals(fProject.getName())){
|
||||||
inFullPath = fl;
|
inFullPath = fl;
|
||||||
break;
|
break;
|
||||||
|
@ -2017,8 +1980,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
boolean put = deps.length == 0;
|
boolean put = deps.length == 0;
|
||||||
if(!put && deps.length <= i){
|
if(!put && deps.length <= i){
|
||||||
put = true;
|
put = true;
|
||||||
for(int k = 0; k < deps.length; k++){
|
for (ITool dep : deps) {
|
||||||
if(indexOf(deps[k], tools, 0, i) == -1){
|
if(indexOf(dep, tools, 0, i) == -1){
|
||||||
put = false;
|
put = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2077,15 +2040,12 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
String exts[] = tool.getAllInputExtensions();
|
String exts[] = tool.getAllInputExtensions();
|
||||||
|
|
||||||
ITool tools[] = fCfg.getFilteredTools();
|
|
||||||
Set<ITool> set = new HashSet<ITool>();
|
Set<ITool> set = new HashSet<ITool>();
|
||||||
for(int i = 0; i < tools.length; i++){
|
for (ITool t : fCfg.getFilteredTools()) {
|
||||||
ITool t = tools[i];
|
|
||||||
if(t == tool)
|
if(t == tool)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for(int j = 0; j < exts.length; j++){
|
for (String e : exts) {
|
||||||
String e = exts[j];
|
|
||||||
if(t.producesFileType(e)){
|
if(t.producesFileType(e)){
|
||||||
IInputType inType = tool.getInputType(e);
|
IInputType inType = tool.getInputType(e);
|
||||||
IOutputType outType = t.getOutputType(e);
|
IOutputType outType = t.getOutputType(e);
|
||||||
|
@ -2094,10 +2054,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
set.add(t);
|
set.add(t);
|
||||||
ToolOrderEstimation est = getToolOrder(t);
|
ToolOrderEstimation est = getToolOrder(t);
|
||||||
ITool deps[] = est.getDeps();
|
for (ITool dep : est.getDeps()) {
|
||||||
for(int k = 0; k < deps.length; k++){
|
if(dep != tool)
|
||||||
if(deps[k] != tool)
|
set.add(dep);
|
||||||
set.add(deps[k]);
|
|
||||||
else{
|
else{
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
|
DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
|
||||||
|
@ -2123,15 +2082,12 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
String exts[] = tool.getAllOutputExtensions();
|
String exts[] = tool.getAllOutputExtensions();
|
||||||
|
|
||||||
ITool tools[] = fCfg.getFilteredTools();
|
|
||||||
Set<ITool> set = new HashSet<ITool>();
|
Set<ITool> set = new HashSet<ITool>();
|
||||||
for(int i = 0; i < tools.length; i++){
|
for (ITool t : fCfg.getFilteredTools()) {
|
||||||
ITool t = tools[i];
|
|
||||||
if(t == tool)
|
if(t == tool)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for(int j = 0; j < exts.length; j++){
|
for (String e : exts) {
|
||||||
String e = exts[j];
|
|
||||||
if(t.buildsFileType(e)){
|
if(t.buildsFileType(e)){
|
||||||
IOutputType inType = tool.getOutputType(e);
|
IOutputType inType = tool.getOutputType(e);
|
||||||
IInputType outType = t.getInputType(e);
|
IInputType outType = t.getInputType(e);
|
||||||
|
@ -2140,10 +2096,9 @@ public class BuildDescription implements IBuildDescription {
|
||||||
|
|
||||||
set.add(t);
|
set.add(t);
|
||||||
ToolOrderEstimation est = getToolOrder(t);
|
ToolOrderEstimation est = getToolOrder(t);
|
||||||
ITool consumers[] = est.getConsumers();
|
for (ITool consumer : est.getConsumers()) {
|
||||||
for(int k = 0; k < consumers.length; k++){
|
if(consumer != tool)
|
||||||
if(consumers[k] != tool)
|
set.add(consumer);
|
||||||
set.add(consumers[k]);
|
|
||||||
else{
|
else{
|
||||||
if(DbgUtil.DEBUG)
|
if(DbgUtil.DEBUG)
|
||||||
DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
|
DbgUtil.trace("loop dependency for tool" + tool.getName()); //$NON-NLS-1$
|
||||||
|
@ -2174,9 +2129,8 @@ public class BuildDescription implements IBuildDescription {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isGenerated(IPath path){
|
protected boolean isGenerated(IPath path){
|
||||||
IPath paths[] = getGeneratedPaths();
|
for (IPath genPath : getGeneratedPaths()) {
|
||||||
for(int i = 0; i < paths.length; i++){
|
if(genPath.isPrefixOf(path))
|
||||||
if(paths[i].isPrefixOf(path))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2269,9 +2223,7 @@ public class BuildDescription implements IBuildDescription {
|
||||||
private void initToolInfos(){
|
private void initToolInfos(){
|
||||||
fToolInfos = PathSettingsContainer.createRootContainer();
|
fToolInfos = PathSettingsContainer.createRootContainer();
|
||||||
|
|
||||||
IResourceInfo rcInfos[] = fCfg.getResourceInfos();
|
for (IResourceInfo rcInfo : fCfg.getResourceInfos()) {
|
||||||
for(int i = 0; i < rcInfos.length; i++){
|
|
||||||
IResourceInfo rcInfo = rcInfos[i];
|
|
||||||
// if(rcInfo.isExcluded())
|
// if(rcInfo.isExcluded())
|
||||||
// continue;
|
// continue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue