1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

tidied up a bit

This commit is contained in:
Andrew Gvozdev 2010-11-04 20:32:55 +00:00
parent 4f4bdf2cbf
commit 1fbb6f4b05

View file

@ -30,15 +30,15 @@ import org.eclipse.core.runtime.IProgressMonitor;
/** /**
* Creates a include Folder to the project. * Creates a include Folder to the project.
* *
* @noextend This class is not intended to be subclassed by clients. * @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
*/ */
public class CreateIncludeFolder extends CreateSourceFolder { public class CreateIncludeFolder extends CreateSourceFolder {
/** /**
* This method Creates a include Folder to the project. * This method Creates a include Folder to the project.
* *
*/ */
@Override @Override
public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException { public void process(TemplateCore template, ProcessArgument[] args, String processId, IProgressMonitor monitor) throws ProcessFailureException {
@ -49,14 +49,14 @@ public class CreateIncludeFolder extends CreateSourceFolder {
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projectHandle); IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(projectHandle);
try { try {
IConfiguration[] configs = info.getManagedProject().getConfigurations(); IConfiguration[] configs = info.getManagedProject().getConfigurations();
for(int i=0; i<configs.length; i++) { for (IConfiguration config : configs) {
String path = projectHandle.getFolder(targetPath).getLocation().toOSString(); String path = projectHandle.getFolder(targetPath).getLocation().toOSString();
IToolChain toolChain = configs[i].getToolChain(); IToolChain toolChain = config.getToolChain();
setIncludePathOptionForConfig(path, configs[i], toolChain.getOptions(), toolChain); setIncludePathOptionForConfig(path, config, toolChain.getOptions(), toolChain);
ITool[] tools = configs[i].getTools(); ITool[] tools = config.getTools();
for(int j=0; j<tools.length; j++) { for (ITool tool : tools) {
setIncludePathOptionForConfig(path, configs[i], tools[j].getOptions(), tools[j]); setIncludePathOptionForConfig(path, config, tool.getOptions(), tool);
} }
} }
} catch (BuildException e) { } catch (BuildException e) {
@ -66,8 +66,7 @@ public class CreateIncludeFolder extends CreateSourceFolder {
} }
private void setIncludePathOptionForConfig(String path, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException { private void setIncludePathOptionForConfig(String path, IConfiguration config, IOption[] options, IHoldsOptions optionHolder) throws BuildException {
for (int i = 0; i < options.length; i++) { for (IOption option : options) {
IOption option = options[i];
if (option.getValueType() == IOption.INCLUDE_PATH) { if (option.getValueType() == IOption.INCLUDE_PATH) {
String[] includePaths = option.getIncludePaths(); String[] includePaths = option.getIncludePaths();
String[] newPaths = new String[includePaths.length + 1]; String[] newPaths = new String[includePaths.length + 1];
@ -77,5 +76,5 @@ public class CreateIncludeFolder extends CreateSourceFolder {
} }
} }
} }
} }