Skip to content

Commit 1543838

Browse files
author
jantje
committed
#1268 do not store uploadPort and programmer in version control files
1 parent d8cf0c9 commit 1543838

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

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

+19
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,25 @@ public Map<String, String> getEnvVarsConfig(String prefix) {
814814
return allVars;
815815
}
816816

817+
/**
818+
* get the environment variables that need to be stored in version control
819+
*
820+
* @return the minimum list of environment variables to recreate the project
821+
* from version control
822+
*/
823+
public Map<String, String> getEnvVarsVersion(String prefix) {
824+
Map<String, String> allVars = new TreeMap<>();
825+
String board_txt = makePathVersionString(getReferencingBoardsFile());
826+
827+
allVars.put(prefix + KEY_SLOEBER_BOARD_ID, myBoardID);
828+
allVars.put(prefix + KEY_SLOEBER_BOARD_TXT, board_txt);
829+
830+
for (Entry<String, String> curOption : myOptions.entrySet()) {
831+
allVars.put(prefix + KEY_SLOEBER_MENU_SELECTION + DOT + curOption.getKey(), curOption.getValue());
832+
}
833+
return allVars;
834+
}
835+
817836
/**
818837
* This method creates environment variables based on the platform.txt and
819838
* boards.txt. platform.txt is processed first and then boards.txt. This way

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

+4
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ public Map<String, String> getEnvVarsConfig(String prefix) {
188188
return ret;
189189
}
190190

191+
public Map<String, String> getEnvVarsVersion(String prefix) {
192+
return getEnvVarsConfig(prefix);
193+
}
194+
191195
public CompileDescription(TxtFile configFile, String prefix) {
192196

193197
KeyValueTree tree = configFile.getData();

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

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public Map<String, String> getEnvVarsConfig(String prefix) {
4343
return allVars;
4444
}
4545

46+
public Map<String, String> getEnvVarsVersion(String prefix) {
47+
return getEnvVarsConfig(prefix);
48+
}
49+
4650
public static OtherDescription getFromCDT(ICConfigurationDescription confDesc) {
4751
OtherDescription ret = new OtherDescription();
4852
ret.myIsVersionControlled = false;

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ private void cleanOldData(ICProjectDescription prjCDesc) {
308308
* @param confDesc
309309
* returns true if the config needs saving otherwise false
310310
*/
311-
@SuppressWarnings("nls")
312311
private boolean readSloeberConfig(final ICProjectDescription prjCDesc) {
313312
boolean needToCreateConfigFiles = false;
314313
IFile file = getConfigLocalFile();
@@ -405,9 +404,9 @@ private void createSloeberConfigFiles(final ICProjectDescription prjCDesc) {
405404
configVars.putAll(otherDescription.getEnvVarsConfig(otherPrefix));
406405

407406
if (otherDescription.IsVersionControlled()) {
408-
versionVars.putAll(boardDescription.getEnvVarsConfig(boardPrefix));
409-
versionVars.putAll(compileDescription.getEnvVarsConfig(compPrefix));
410-
versionVars.putAll(otherDescription.getEnvVarsConfig(otherPrefix));
407+
versionVars.putAll(boardDescription.getEnvVarsVersion(boardPrefix));
408+
versionVars.putAll(compileDescription.getEnvVarsVersion(compPrefix));
409+
versionVars.putAll(otherDescription.getEnvVarsVersion(otherPrefix));
411410
}
412411
}
413412

0 commit comments

Comments
 (0)