Skip to content

Commit 6900606

Browse files
author
jantje
committed
#1275 maybe also #1272
Lots of changes in the multi config space It was hard to get it to work so there probably still are some loose ends regression test is ok default ino on all boards is running ok above 600 successfull
1 parent 4651f9a commit 6900606

19 files changed

+602
-609
lines changed

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

+13-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ public boolean equals(BoardDescription otherBoardDescriptor) {
144144
* @return
145145
*/
146146
public boolean needsRebuild(BoardDescription otherBoardDescriptor) {
147-
147+
if (otherBoardDescriptor == null) {
148+
return true;
149+
}
148150
if (!this.getBoardID().equals(otherBoardDescriptor.getBoardID())) {
149151
return true;
150152
}
@@ -357,6 +359,15 @@ public BoardDescription() {
357359
myOptions = KeyValue.makeMap(myStorageNode.get(KEY_LAST_USED_BOARD_MENU_OPTIONS, EMPTY));
358360
}
359361

362+
public BoardDescription(BoardDescription srcObject) {
363+
myreferencingBoardsFile = srcObject.myreferencingBoardsFile;
364+
myTxtFile = srcObject.myTxtFile;
365+
myBoardID = srcObject.myBoardID;
366+
myUploadPort = srcObject.myUploadPort;
367+
myProgrammer = srcObject.myProgrammer;
368+
myOptions = srcObject.myOptions;
369+
}
370+
360371
protected BoardDescription(BoardTxtFile txtFile, String boardID) {
361372
this.myBoardID = boardID;
362373
this.myreferencingBoardsFile = txtFile.getTxtFile();
@@ -769,6 +780,7 @@ private Map<String, String> getEnvVarsTxt() {
769780
}
770781
}
771782

783+
772784
private Map<String, String> onlyKeepValidOptions(Map<String, String> options) {
773785
Map<String, String> ret = new HashMap<>();
774786

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

+18-51
Original file line numberDiff line numberDiff line change
@@ -39,56 +39,7 @@ public class CompileDescription {
3939
private static final String ENV_KEY_JANTJE_LINK_COMPILE_OPTIONS = Const.ENV_KEY_JANTJE_START + "extra.link"; //$NON-NLS-1$
4040
private static final String ENV_KEY_JANTJE_ALL_COMPILE_OPTIONS = Const.ENV_KEY_JANTJE_START + "extra.all"; //$NON-NLS-1$
4141

42-
// /**
43-
// * gets the compile options stored in this configuration description. if the
44-
// * configuration description is null the default compile options are returned.
45-
// *
46-
// * @param confDesc null for default or the configuration description you want
47-
// * the compile options for
48-
// */
49-
// public CompileDescription(ICConfigurationDescription confDesc) {
50-
// if (confDesc != null) {
51-
//
52-
// IEnvironmentVariableManager envManager =
53-
// CCorePlugin.getDefault().getBuildEnvironmentManager();
54-
// IContributedEnvironment contribEnv = envManager.getContributedEnvironment();
55-
// IEnvironmentVariable var =
56-
// contribEnv.getVariable(ENV_KEY_JANTJE_WARNING_LEVEL, confDesc);
57-
// if (var != null)
58-
// this.myWarningLevel = Boolean.valueOf(var.getValue());
59-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_SIZE_SWITCH, confDesc);
60-
// if (var != null)
61-
// this.myAlternativeSizeCommand =
62-
// var.getValue().contains(ENV_KEY_JANTJE_SIZE_COMMAND);
63-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ADDITIONAL_COMPILE_OPTIONS,
64-
// confDesc);
65-
// if (var != null)
66-
// this.my_C_andCPP_CompileOptions = var.getValue();
67-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ADDITIONAL_C_COMPILE_OPTIONS,
68-
// confDesc);
69-
// if (var != null)
70-
// this.my_C_CompileOptions = var.getValue();
71-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ADDITIONAL_CPP_COMPILE_OPTIONS,
72-
// confDesc);
73-
// if (var != null)
74-
// this.my_CPP_CompileOptions = var.getValue();
75-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ASSEMBLY_COMPILE_OPTIONS,
76-
// confDesc);
77-
// if (var != null)
78-
// this.my_Assembly_CompileOptions = var.getValue();
79-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ARCHIVE_COMPILE_OPTIONS,
80-
// confDesc);
81-
// if (var != null)
82-
// this.my_Archive_CompileOptions = var.getValue();
83-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_LINK_COMPILE_OPTIONS, confDesc);
84-
// if (var != null)
85-
// this.my_Link_CompileOptions = var.getValue();
86-
// var = contribEnv.getVariable(ENV_KEY_JANTJE_ALL_COMPILE_OPTIONS, confDesc);
87-
// if (var != null)
88-
// this.my_All_CompileOptions = var.getValue();
89-
//
90-
// }
91-
// }
42+
9243

9344
public boolean isWarningLevel() {
9445
return this.myWarningLevel;
@@ -202,7 +153,10 @@ public Map<String, String> getEnvVars() {
202153
public boolean needsRebuild(CompileDescription curOptions) {
203154
// ignore myWarningLevel
204155
// ignore myAlternativeSizeCommand
205-
return equalCompileOptions(curOptions);
156+
if (curOptions == null) {
157+
return true;
158+
}
159+
return !equalCompileOptions(curOptions);
206160
}
207161

208162
/**
@@ -252,6 +206,19 @@ public CompileDescription() {
252206
// therefore this is not set here but in the ui before project creation
253207
}
254208

209+
public CompileDescription(CompileDescription compileDescription) {
210+
myWarningLevel = compileDescription.myWarningLevel;
211+
myAlternativeSizeCommand = compileDescription.myAlternativeSizeCommand;
212+
myEnableParallelBuild = compileDescription.myEnableParallelBuild;
213+
my_CPP_CompileOptions = compileDescription.my_CPP_CompileOptions;
214+
my_C_CompileOptions = compileDescription.my_C_CompileOptions;
215+
my_C_andCPP_CompileOptions = compileDescription.my_C_andCPP_CompileOptions;
216+
my_Assembly_CompileOptions = compileDescription.my_Assembly_CompileOptions;
217+
my_Archive_CompileOptions = compileDescription.my_Archive_CompileOptions;
218+
my_Link_CompileOptions = compileDescription.my_Link_CompileOptions;
219+
my_All_CompileOptions = compileDescription.my_All_CompileOptions;
220+
}
221+
255222
/**
256223
* Compares 2 compile descriptors
257224
*

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

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public OtherDescription() {
2525
// nothing needs to be done
2626
}
2727

28+
public OtherDescription(OtherDescription srcObject) {
29+
myIsVersionControlled = srcObject.myIsVersionControlled;
30+
}
31+
2832
public Map<String, String> getEnvVars() {
2933
return getEnvVarsConfig(Const.EMPTY);
3034
}

0 commit comments

Comments
 (0)