Skip to content

Commit 718823a

Browse files
author
jan
committed
#1299 do not use isValid and use SLOEBERCFG
1 parent d6c47c8 commit 718823a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

io.sloeber.core/src/io/sloeber/core/api/SloeberProject.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.sloeber.core.api;
22

33
import java.io.ByteArrayInputStream;
4+
import java.io.File;
45
import java.io.IOException;
56
import java.net.URI;
67
import java.nio.file.Files;
@@ -418,6 +419,7 @@ public boolean configure(ICProjectDescription prjCDesc, boolean prjDescWritable)
418419
}
419420
return saveProjDesc;
420421
}
422+
421423
// first read the sloeber files in memory
422424
saveProjDesc = readConfig(prjCDesc, prjDescWritable);
423425
if (myNeedToPersist || isDirty) {
@@ -528,7 +530,7 @@ private boolean readConfigFromCDT(ICProjectDescription prjCDesc, boolean prjDesc
528530
BoardDescription boardDesc = BoardDescription.getFromCDT(confDesc);
529531
CompileDescription compileDescription = CompileDescription.getFromCDT(confDesc);
530532
OtherDescription otherDesc = OtherDescription.getFromCDT(confDesc);
531-
if (boardDesc.isValid()) {
533+
if (boardDesc.getReferencingBoardsFile() != null) {
532534
foundAValidConfig = true;
533535
myBoardDescriptions.put(getConfigKey(confDesc), boardDesc);
534536
myCompileDescriptions.put(getConfigKey(confDesc), compileDescription);
@@ -663,7 +665,7 @@ private void setEnvironmentVariables(Collection<String> configKeys) {
663665
* @param project
664666
* the project to store the data for
665667
*/
666-
private void createSloeberConfigFiles(Map<String, String> configs) {
668+
private synchronized void createSloeberConfigFiles(Map<String, String> configs) {
667669

668670
Map<String, String> configVars = new TreeMap<>();
669671
Map<String, String> versionVars = new TreeMap<>();
@@ -912,7 +914,7 @@ private static String getOtherPrefix(String confDescName) {
912914
}
913915

914916
private IFile getConfigVersionFile() {
915-
return myProject.getFile("sloeber.cfg"); //$NON-NLS-1$
917+
return myProject.getFile(SLOEBER_CFG);
916918
}
917919

918920
private IFile getConfigLocalFile() {

0 commit comments

Comments
 (0)