@@ -113,19 +113,21 @@ public void run(IProgressMonitor internalMonitor) throws CoreException {
113
113
workspaceDesc .setAutoBuilding (false );
114
114
workspace .setDescription (workspaceDesc );
115
115
116
- String RELEASE = "Release" ;
117
-
118
116
// create a sloeber project
119
117
SloeberProject sloeberProject = new SloeberProject (project );
120
118
if (!sloeberProject .readConfigFromFiles ()) {
119
+ String RELEASE = "Release" ;
121
120
sloeberProject .setBoardDescription (RELEASE , new BoardDescription (), false );
122
121
sloeberProject .setCompileDescription (RELEASE , new CompileDescription ());
123
122
sloeberProject .setOtherDescription (RELEASE , new OtherDescription ());
123
+ // we failed to read from disk so we set opourselfves some values
124
+ // faking the stuf is in memory
125
+ sloeberProject .isInMemory = true ;
124
126
}
125
-
126
- BoardDescription boardDescriptor = sloeberProject .getBoardDescription (RELEASE , true );
127
- CompileDescription compileDescriptor = sloeberProject .getCompileDescription (RELEASE , true );
128
- OtherDescription otherDesc = sloeberProject .getOtherDescription (RELEASE , true );
127
+ String configName = sloeberProject . myBoardDescriptions . keySet (). iterator (). next ();
128
+ BoardDescription boardDescriptor = sloeberProject .getBoardDescription (configName , true );
129
+ CompileDescription compileDescriptor = sloeberProject .getCompileDescription (configName , true );
130
+ OtherDescription otherDesc = sloeberProject .getOtherDescription (configName , true );
129
131
130
132
// Add the arduino code folders
131
133
List <IPath > addToIncludePath = Helpers .addArduinoCodeToProject (project , boardDescriptor );
@@ -393,7 +395,7 @@ public void configure() {
393
395
* @return true if the projectDesc needs to be saved
394
396
*/
395
397
396
- private boolean configure (ICProjectDescription prjCDesc , boolean prjDescWritable ) {
398
+ public boolean configure (ICProjectDescription prjCDesc , boolean prjDescWritable ) {
397
399
Map <String , String > configs = getConfigs (prjCDesc );
398
400
boolean saveProjDesc = false ;
399
401
if (isInMemory ) {
@@ -432,7 +434,6 @@ private boolean configure(ICProjectDescription prjCDesc, boolean prjDescWritable
432
434
}
433
435
}
434
436
setEnvironmentVariables (getCfgKeys (configs ));
435
- isInMemory = true ;
436
437
return saveProjDesc ;
437
438
}
438
439
@@ -587,6 +588,7 @@ private boolean readConfig(ICProjectDescription prjCDesc, boolean prjDescWritabl
587
588
588
589
}
589
590
}
591
+ isInMemory = true ;
590
592
return projDescNeedsWriting ;
591
593
}
592
594
@@ -995,7 +997,7 @@ public void sloeberCfgChanged() {
995
997
CCorePlugin cCorePlugin = CCorePlugin .getDefault ();
996
998
ICProjectDescription projDesc = cCorePlugin .getProjectDescription (myProject );
997
999
ICConfigurationDescription activeConfig = projDesc .getActiveConfiguration ();
998
- isInMemory = false ;
1000
+ isDirty = true ;
999
1001
boolean projDescNeedsSaving = configure (projDesc , true );
1000
1002
Helpers .deleteBuildFolder (myProject , activeConfig .getName ());
1001
1003
projDescNeedsSaving = projDescNeedsSaving || setActiveConfig (activeConfig );
0 commit comments