Skip to content

Commit ea603af

Browse files
author
jan
committed
Add the missing arduino framework environment vars #1652
Seems the hooks do not work in V5.0
1 parent 2c8730d commit ea603af

File tree

11 files changed

+349
-61
lines changed

11 files changed

+349
-61
lines changed

io.sloeber.core/src/io/sloeber/core/Messages.java

+12
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ public class Messages extends NLS {
105105
public static String projectNotFoundInGUI;
106106
public static String sizeReportSketch;
107107
public static String sizeReportData;
108+
public static String CompileDescription_CustomDebugLevel;
109+
public static String CompileDescription_OptimizedForDebug;
110+
public static String CompileDescription_OptimizedForRelease;
111+
public static String CompileDescription_SizeArduinoWay;
112+
public static String CompileDescription_SizeAVRAlternative;
113+
public static String CompileDescription_SizeCustom;
114+
public static String CompileDescription_SizeRawResult;
115+
public static String CompileDescription_WarningsAll;
116+
public static String CompileDescription_WarningsCustom;
117+
public static String CompileDescription_WarningsDefault;
118+
public static String CompileDescription_WarningsMore;
119+
public static String CompileDescription_WarningsNone;
108120

109121
static {
110122
// initialize resource bundle

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

+19-5
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ public String getArchitecture() {
368368
return mySloeberBoardTxtFile.getArchitecture();
369369
}
370370

371+
public String getVendor() {
372+
return mySloeberBoardTxtFile.getVendor();
373+
}
374+
371375
public File getReferencingBoardsFile() {
372376
return myUserSelectedBoardsTxtFile;
373377
}
@@ -450,7 +454,8 @@ public void setOptions(Map<String, String> options) {
450454
if (options == null) {
451455
return;
452456
}
453-
this.myOptions.putAll(options);
457+
myOptions.clear();
458+
myOptions.putAll(options);
454459
setDirty();
455460
}
456461

@@ -820,10 +825,8 @@ public Map<String, String> getEnvVars() {
820825
if(isMac) {
821826
allVars.put(ENV_KEY_RUNTIME_OS, "macosx"); //$NON-NLS-1$
822827
}
823-
allVars.put(ENV_KEY_SOFTWARE,VENDOR_ARDUINO);
824828
allVars.put(ENV_KEY_ID,getBoardID());
825-
826-
829+
allVars.put(ENV_KEY_BUILD_FQBN,getBoardFQBN());
827830

828831
allVars.put(ENV_KEY_SERIAL_PORT, getActualUploadPort());
829832
allVars.put(ENV_KEY_SERIAL_DOT_PORT, getActualUploadPort());
@@ -887,7 +890,18 @@ public Map<String, String> getEnvVars() {
887890

888891
}
889892

890-
private Map<String, String> getEnVarPlatformInfo() {
893+
private String getBoardFQBN() {
894+
String fqbn=getVendor()+COLON+getArchitecture()+COLON+getBoardID();
895+
String options=EMPTY_STRING;
896+
String prefix=COLON;
897+
for(Entry<String, String> curOption:myOptions.entrySet()){
898+
options=options+prefix+curOption.getKey()+EQUAL+curOption.getValue();
899+
prefix=COMMA;
900+
}
901+
return fqbn+options;
902+
}
903+
904+
private Map<String, String> getEnVarPlatformInfo() {
891905
Map<String, String> ret = new HashMap<>();
892906

893907
if (myReferencedPlatformUpload != null) {

0 commit comments

Comments
 (0)