|
1 | 1 | package io.sloeber.core.api;
|
2 | 2 |
|
3 | 3 | import java.io.ByteArrayInputStream;
|
| 4 | +import java.io.File; |
4 | 5 | import java.io.IOException;
|
5 | 6 | import java.net.URI;
|
6 | 7 | import java.nio.file.Files;
|
@@ -418,6 +419,7 @@ public boolean configure(ICProjectDescription prjCDesc, boolean prjDescWritable)
|
418 | 419 | }
|
419 | 420 | return saveProjDesc;
|
420 | 421 | }
|
| 422 | + |
421 | 423 | // first read the sloeber files in memory
|
422 | 424 | saveProjDesc = readConfig(prjCDesc, prjDescWritable);
|
423 | 425 | if (myNeedToPersist || isDirty) {
|
@@ -528,7 +530,7 @@ private boolean readConfigFromCDT(ICProjectDescription prjCDesc, boolean prjDesc
|
528 | 530 | BoardDescription boardDesc = BoardDescription.getFromCDT(confDesc);
|
529 | 531 | CompileDescription compileDescription = CompileDescription.getFromCDT(confDesc);
|
530 | 532 | OtherDescription otherDesc = OtherDescription.getFromCDT(confDesc);
|
531 |
| - if (boardDesc.isValid()) { |
| 533 | + if (boardDesc.getReferencingBoardsFile() != null) { |
532 | 534 | foundAValidConfig = true;
|
533 | 535 | myBoardDescriptions.put(getConfigKey(confDesc), boardDesc);
|
534 | 536 | myCompileDescriptions.put(getConfigKey(confDesc), compileDescription);
|
@@ -663,7 +665,7 @@ private void setEnvironmentVariables(Collection<String> configKeys) {
|
663 | 665 | * @param project
|
664 | 666 | * the project to store the data for
|
665 | 667 | */
|
666 |
| - private void createSloeberConfigFiles(Map<String, String> configs) { |
| 668 | + private synchronized void createSloeberConfigFiles(Map<String, String> configs) { |
667 | 669 |
|
668 | 670 | Map<String, String> configVars = new TreeMap<>();
|
669 | 671 | Map<String, String> versionVars = new TreeMap<>();
|
@@ -912,7 +914,7 @@ private static String getOtherPrefix(String confDescName) {
|
912 | 914 | }
|
913 | 915 |
|
914 | 916 | private IFile getConfigVersionFile() {
|
915 |
| - return myProject.getFile("sloeber.cfg"); //$NON-NLS-1$ |
| 917 | + return myProject.getFile(SLOEBER_CFG); |
916 | 918 | }
|
917 | 919 |
|
918 | 920 | private IFile getConfigLocalFile() {
|
|
0 commit comments