Skip to content

Commit 0b76bf5

Browse files
author
jantje
committed
Fix persistency of toolchain options of files and projects #1126
1 parent 548dd58 commit 0b76bf5

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

io.sloeber.autoBuild/src/io/sloeber/autoBuild/integration/AutoBuildConfigurationDescription.java

+14-6
Original file line numberDiff line numberDiff line change
@@ -433,21 +433,27 @@ public AutoBuildConfigurationDescription(ICConfigurationDescription cfgDescripti
433433

434434
//reconstruct the selected options
435435
for (Entry<String, String> curOptionIndex : optionKeyMap.entrySet()) {
436-
String value = optionValueMap.get(curOptionIndex.getKey());
437-
String resourceString = optionResourceMap.get(curOptionIndex.getKey());
438-
String toolString = optionToolMap.get(curOptionIndex.getKey());
436+
String key = curOptionIndex.getKey();
437+
String id = curOptionIndex.getValue();
438+
String value = optionValueMap.get(key);
439+
String resourceString = optionResourceMap.get(key);
440+
String toolString = optionToolMap.get(key);
439441
if (value == null || resourceString == null) {
440442
//This Should not happen
441443
continue;
442444
}
443-
IResource resource = myProject.getFile(resourceString);
445+
IResource resource = myProject;
446+
if (!resourceString.isBlank()) {
447+
resource = myProject.getFile(resourceString);
448+
}
444449
ITool tool = null;
445450
if (toolString != null) {
446-
myAutoBuildConfiguration.getToolChain().getTool(toolString);
451+
tool = myAutoBuildConfiguration.getToolChain().getTool(toolString);
447452
}
448-
setOptionValueInternal(resource, tool, curOptionIndex.getValue(), value);
453+
setOptionValueInternal(resource, tool, id, value);
449454

450455
}
456+
options_combine();
451457

452458
//reconstruct the custom tool commands
453459
for (Entry<String, String> curOptionIndex : customToolKeyMap.entrySet()) {
@@ -560,6 +566,8 @@ private void options_updateDefault() {
560566

561567
/*
562568
* take myDefaultOptions and mySelected options and combine them in myCombinedOptions
569+
* From now onwards the combined options are to be used as they take the default and the
570+
* user selected option into account in the desired way
563571
*/
564572
private void options_combine() {
565573
myCombinedOptions.clear();

0 commit comments

Comments
 (0)