Skip to content

Commit 4265b73

Browse files
author
jantje
committed
#1281 Bot A. and Sloeber are done
tested upload, regression and upgrade (only one config available aat this time
1 parent 72a5dba commit 4265b73

15 files changed

+274
-292
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
1-
#this file is processed without the adding of A to enable referencing non arduino set variables
2-
A.software=ARDUINO
3-
A.recipe.objcopy.hex.pattern=${A.recipe.objcopy.bin.pattern}
4-
A.archive_file=arduino.ar
5-
A.archive_file_path=${A.build.path}/${A.archive_file}
6-
SLOEBER.alt_size_command="${A.compiler.path}${A.compiler.size.cmd}" --format=avr --mcu=${A.build.mcu} "${A.build.path}/${A.build.project_name}.elf"
7-
A.runtime.ide.version=10812
8-
A.build.system.path=${A.referenced.core.path}${DirectoryDelimiter}system
9-
A.serial.port=${JANTJE.com_port}
10-
A.build.project_name=${ProjName}
11-
A.packages=${eclipse_home}${DirectoryDelimiter}arduinoPlugin${DirectoryDelimiter}packages
12-
A.build.path=${ProjDirPath}${DirectoryDelimiter}${ConfigName}
13-
1+
#this file contains default/fallback/resque values
2+
software=ARDUINO
3+
recipe.objcopy.hex.pattern=${recipe.objcopy.bin.pattern}
4+
archive_file=arduino.ar
5+
archive_file_path=${build.path}/${archive_file}
6+
sloeber.alt_size_command="${compiler.path}${compiler.size.cmd}" --format=avr --mcu=${build.mcu} "${build.path}/${build.project_name}.elf"
7+
runtime.ide.version=10812
8+
build.system.path=${referenced.core.path}${DirectoryDelimiter}system
9+
serial.port=${com_port}
10+
build.project_name=${ProjName}
11+
build.path=${ProjDirPath}${DirectoryDelimiter}${ConfigName}
1412

1513

1614
#quick fix for issue #810
17-
A.upload.speed=19200
18-
A.upload.protocol=stk500v1
15+
upload.speed=19200
16+
upload.protocol=stk500v1
1917

2018

2119
#for esp8266 network upload
22-
A.tools.esp8266OTA=${A.tools.esptool.network_cmd}
23-
A.tools.esp8266OTA.upload.pattern=${A.tools.esptool.upload.network_pattern}
24-
A.esp8266.network.upload.tool=esp8266OTA
25-
A.tools.esptool.network.PASSWORD=${A.network.auth}
20+
tools.esp8266OTA=${tools.esptool.network_cmd}
21+
tools.esp8266OTA.upload.pattern=${tools.esptool.upload.network_pattern}
22+
esp8266.network.upload.tool=esp8266OTA
23+
tools.esptool.network.PASSWORD=${network.auth}
2624

2725
#for yun shield to work
28-
A.tools.avrdude_remote.upload.verbose=-v
26+
tools.avrdude_remote.upload.verbose=-v
2927

3028
#for due
31-
A.serial.port.file=${A.serial.port}
29+
serial.port.file=${serial.port}
3230

3331
#to turn warnings on/off
34-
A.compiler.warning_flags=-w
35-
A.compiler.warning_flags.all=-Wall -Wextra
32+
compiler.warning_flags=-w
33+
compiler.warning_flags.all=-Wall -Wextra
3634

3735
#for stm
3836

39-
A.upload.altID=no_altID
40-
A.upload.usbID=no_altID
37+
upload.altID=no_altID
38+
upload.usbID=no_altID
4139

io.sloeber.core/plugin.xml

+15-15
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
autoBuildTarget="all"
113113
buildfileGenerator="io.sloeber.core.toolchain.ArduinoGnuMakefileGenerator"
114114
cleanBuildTarget="clean"
115-
command="${JANTJE.make_location}make"
115+
command="${sloeber.make_location}make"
116116
errorParsers="org.eclipse.cdt.core.MakeErrorParser"
117117
id="io.sloeber.gnu.builder"
118118
ignoreErrCmd="-k"
@@ -174,8 +174,8 @@
174174
</optionCategory>
175175
<tool
176176
announcement="%tool.Arduino.CPP.announcement"
177-
command="${A.recipe.cpp.o.pattern}"
178-
commandLinePattern="${A.recipe.cpp.o.pattern.1} ${FLAGS} -D__IN_ECLIPSE__=1 -x c++ ${INPUTS} ${A.recipe.cpp.o.pattern.2} -o ${OUTPUT} ${A.recipe.cpp.o.pattern.3} ${JANTJE.extra.compile} ${JANTJE.extra.cpp.compile} ${JANTJE.extra.all}"
177+
command="${recipe.cpp.o.pattern}"
178+
commandLinePattern="${recipe.cpp.o.pattern.1} ${FLAGS} -D__IN_ECLIPSE__=1 -x c++ ${INPUTS} ${recipe.cpp.o.pattern.2} -o ${OUTPUT} ${recipe.cpp.o.pattern.3} ${sloeber.extra.compile} ${sloeber.extra.cpp.compile} ${sloeber.extra.all}"
179179
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
180180
id="io.sloeber.tool.sketch.compiler.cpp"
181181
name="%tool.Arduino.CPP2O.name"
@@ -221,8 +221,8 @@
221221
</tool>
222222
<tool
223223
announcement="%tool.Arduino.C.announcement"
224-
command="${A.recipe.c.o.pattern}"
225-
commandLinePattern="${A.recipe.c.o.pattern.1} ${FLAGS} -D__IN_ECLIPSE__=1 ${INPUTS} ${A.recipe.c.o.pattern.2} -o ${OUTPUT} ${A.recipe.c.o.pattern.3} ${JANTJE.extra.compile} ${JANTJE.extra.c.compile} ${JANTJE.extra.all}"
224+
command="${recipe.c.o.pattern}"
225+
commandLinePattern="${recipe.c.o.pattern.1} ${FLAGS} -D__IN_ECLIPSE__=1 ${INPUTS} ${recipe.c.o.pattern.2} -o ${OUTPUT} ${recipe.c.o.pattern.3} ${sloeber.extra.compile} ${sloeber.extra.c.compile} ${sloeber.extra.all}"
226226
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
227227
id="io.sloeber.tool.compiler.c"
228228
name="%tool.Arduino.C2O.name"
@@ -269,8 +269,8 @@
269269
</tool>
270270
<tool
271271
announcement="%tool.Arduino.S.announcement"
272-
command="${A.recipe.S.o.pattern}"
273-
commandLinePattern="${A.recipe.S.o.pattern.1} ${FLAGS} ${INPUTS} ${A.recipe.S.o.pattern.2} -o ${OUTPUT} ${A.recipe.S.o.pattern.3} ${JANTJE.extra.assembly} ${JANTJE.extra.all}"
272+
command="${recipe.S.o.pattern}"
273+
commandLinePattern="${recipe.S.o.pattern.1} ${FLAGS} ${INPUTS} ${recipe.S.o.pattern.2} -o ${OUTPUT} ${recipe.S.o.pattern.3} ${sloeber.extra.assembly} ${sloeber.extra.all}"
274274
errorParsers="org.eclipse.cdt.core.GCCErrorParser"
275275
id="io.sloeber.tool.sketch.compiler.s"
276276
name="%tool.Arduino.S20.name"
@@ -316,21 +316,21 @@
316316
</tool>
317317
<tool
318318
announcement="%tool.Arduino.archiver.announcement"
319-
command="${A.recipe.ar.pattern}"
320-
commandLinePattern="${A.recipe.ar.pattern.1} ${FLAGS} ${A.archive_file_path} ${INPUTS} ${A.recipe.ar.pattern.2} ${A.recipe.ar.pattern.3} ${JANTJE.extra_archive} ${JANTJE.extra_all}"
319+
command="${recipe.ar.pattern}"
320+
commandLinePattern="${recipe.ar.pattern.1} ${FLAGS} ${archive_file_path} ${INPUTS} ${recipe.ar.pattern.2} ${recipe.ar.pattern.3} ${sloeber.extra_archive} ${sloeber.extra_all}"
321321
errorParsers="org.eclipse.cdt.core.GLDErrorParser"
322322
id="io.sloeber.tool.ar"
323323
name="%tool.archiver.name">
324324
<outputType
325325
buildVariable="AR"
326326
id="io.sloeber.tool.archiver.output"
327327
name="%outputType.archiver.name"
328-
outputNames="${A.archive_file_path}"
328+
outputNames="${archive_file_path}"
329329
outputs="ar"
330330
primaryOutput="true">
331331
</outputType>
332332
<inputType
333-
assignToOption="A.OBJECT_FILE"
333+
assignToOption="OBJECT_FILE"
334334
buildVariable="AR_OBJ"
335335
id="io.sloeber.tool.archiver.input"
336336
multipleOfType="true"
@@ -341,8 +341,8 @@
341341
</tool>
342342
<tool
343343
announcement="%tool.Arduino.combiner.announcement"
344-
command="${A.recipe.c.combine.pattern}"
345-
commandLinePattern="${A.JANTJE.pre.link}${A.recipe.c.combine.pattern.1} ${FLAGS} ${INPUTS} ${A.recipe.c.combine.pattern.2} ${A.archive_file_path} ${A.recipe.c.combine.pattern.3} ${JANTJE.extra_all} ${JANTJE.extra_link}${A.JANTJE.post.link}"
344+
command="${recipe.c.combine.pattern}"
345+
commandLinePattern="${sloeber.pre.link}${recipe.c.combine.pattern.1} ${FLAGS} ${INPUTS} ${recipe.c.combine.pattern.2} ${archive_file_path} ${recipe.c.combine.pattern.3} ${sloeber.extra_all} ${sloeber.extra_link}${sloeber.post.link}"
346346
errorParsers="org.eclipse.cdt.core.GLDErrorParser"
347347
id="io.sloeber.tool.combine"
348348
name="%tool.combiner.name"
@@ -371,7 +371,7 @@
371371
<tool
372372
announcement="%tool.obcopy.announcement"
373373
command="all objcopy commands"
374-
commandLinePattern="${JANTJE.objcopy}"
374+
commandLinePattern="${sloeber.objcopy}"
375375
id="io.sloeber.tool.objcopy.eep"
376376
isAbstract="false"
377377
name="%tool.objcopy.name"
@@ -397,7 +397,7 @@
397397
</tool>
398398
<tool
399399
announcement="%tool.printsize.announcement"
400-
command="${JANTJE.size.switch} "
400+
command="${sloeber.size.switch} "
401401
commandLinePattern="${COMMAND}"
402402
id="io.sloeber.tool.size"
403403
isAbstract="false"

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

+28-32
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,20 @@ public class BoardDescription {
5252
private static final String KEY_LAST_USED_UPLOAD_PROTOCOL = "last Used upload Protocol"; //$NON-NLS-1$
5353
private static final String KEY_LAST_USED_BOARDS_FILE = "Last used Boards file"; //$NON-NLS-1$
5454
private static final String KEY_LAST_USED_BOARD_MENU_OPTIONS = "last used Board custom option selections"; //$NON-NLS-1$
55-
private static final String ENV_KEY_SERIAL_PORT = ERASE_START + "serial_port"; //$NON-NLS-1$
56-
private static final String ENV_KEY_SERIAL_DOT_PORT = ERASE_START + "serial.port"; //$NON-NLS-1$
57-
private static final String ENV_KEY_SERIAL_PORT_FILE = ERASE_START + "serial.port.file"; //$NON-NLS-1$
58-
private static final String ENV_KEY_BUILD_VARIANT_PATH = ERASE_START + BUILD + DOT + VARIANT + DOT + PATH;
59-
private static final String ENV_KEY_BUILD_ACTUAL_CORE_PATH = ERASE_START + BUILD + DOT + CORE + DOT + PATH;
60-
private static final String ENV_KEY_BUILD_ARCH = ERASE_START + "build.arch"; //$NON-NLS-1$
61-
private static final String ENV_KEY_HARDWARE_PATH = ERASE_START + "runtime.hardware.path"; //$NON-NLS-1$
62-
private static final String ENV_KEY_PLATFORM_PATH = ERASE_START + "runtime.platform.path"; //$NON-NLS-1$
63-
private static final String ENV_KEY_REFERENCED_CORE_PLATFORM_PATH = ERASE_START + REFERENCED + DOT + CORE + DOT
64-
+ PATH;
65-
private static final String ENV_KEY_REFERENCED_VARIANT_PLATFORM_PATH = ERASE_START + REFERENCED + DOT + VARIANT
66-
+ DOT + PATH;
67-
private static final String ENV_KEY_REFERENCED_UPLOAD_PLATFORM_PATH = ERASE_START + REFERENCED + DOT + UPLOAD
68-
+ PATH;
55+
private static final String ENV_KEY_SERIAL_PORT = "serial_port"; //$NON-NLS-1$
56+
private static final String ENV_KEY_SERIAL_DOT_PORT = "serial.port"; //$NON-NLS-1$
57+
private static final String ENV_KEY_SERIAL_PORT_FILE = "serial.port.file"; //$NON-NLS-1$
58+
private static final String ENV_KEY_BUILD_VARIANT_PATH = BUILD + DOT + VARIANT + DOT + PATH;
59+
private static final String ENV_KEY_BUILD_ACTUAL_CORE_PATH = BUILD + DOT + CORE + DOT + PATH;
60+
private static final String ENV_KEY_BUILD_ARCH = BUILD + DOT + "arch"; //$NON-NLS-1$
61+
private static final String ENV_KEY_HARDWARE_PATH = RUNTIME + DOT + HARDWARE + DOT + PATH;
62+
private static final String ENV_KEY_PLATFORM_PATH = RUNTIME + DOT + PLATFORM + DOT + PATH;
63+
private static final String ENV_KEY_REFERENCED_CORE_PLATFORM_PATH = REFERENCED + DOT + CORE + DOT + PATH;
64+
private static final String ENV_KEY_REFERENCED_VARIANT_PLATFORM_PATH = REFERENCED + DOT + VARIANT + DOT + PATH;
65+
private static final String ENV_KEY_REFERENCED_UPLOAD_PLATFORM_PATH = REFERENCED + DOT + UPLOAD + PATH;
6966

7067
// preference nodes
7168
private static final String NODE_ARDUINO = Activator.NODE_ARDUINO;
72-
private static final String JANTJE_ACTION_UPLOAD = ENV_KEY_JANTJE_START + UPLOAD; // this is actually the programmer
7369
private static final IEclipsePreferences myStorageNode = InstanceScope.INSTANCE.getNode(NODE_ARDUINO);
7470
private static final TxtFile pluginPreProcessingPlatformTxt = new TxtFile(
7571
ConfigurationPreferences.getPreProcessingPlatformFile());
@@ -683,7 +679,7 @@ public String getUploadCommand(ICConfigurationDescription confdesc) {
683679
if (isNetworkUpload()) {
684680
networkPrefix = DOT + NETWORK_PREFIX;
685681
}
686-
String key = A_TOOLS + upLoadTool + DOT + action + networkPrefix + DOT + PATTERN;
682+
String key = TOOLS + DOT + upLoadTool + DOT + action + networkPrefix + DOT + PATTERN;
687683
String ret = Common.getBuildEnvironmentVariable(confdesc, key, EMPTY);
688684
if (ret.isEmpty()) {
689685
Common.log(new Status(IStatus.ERROR, CORE_PLUGIN_ID, key + " : not found in the platform.txt file")); //$NON-NLS-1$
@@ -911,7 +907,7 @@ public Map<String, String> getEnvVars() {
911907
String menuID = curOption.getKey();
912908
String SelectedMenuItemID = curOption.getValue();
913909
KeyValueTree curSelectedMenuItem = menuData.getChild(menuID + DOT + SelectedMenuItemID);
914-
allVars.putAll(curSelectedMenuItem.toKeyValues(ERASE_START, false));
910+
allVars.putAll(curSelectedMenuItem.toKeyValues(EMPTY, false));
915911
}
916912

917913
// add the stuff that comes with the plugin that is marked as post
@@ -956,7 +952,7 @@ private Map<String, String> getEnVarPlatformInfo() {
956952
* arduino recipes. Therefore I split the arduino recipes into parts (based on
957953
* the arduino keys) and connect them again in the plugin.xml using the CDT
958954
* keys. This code assumes that the command is in following order ${first part}
959-
* ${files} ${second part} [${ARCHIVE_FILE} ${third part}] with [optional]
955+
* ${files} ${second part} [${archive_file} ${third part}] with [optional]
960956
*
961957
* Secondly The handling of the upload variables is done differently in arduino
962958
* than here. This is taken care of here. for example the output of this input
@@ -969,10 +965,10 @@ private Map<String, String> getEnVarPlatformInfo() {
969965
* are done here so no special code is needed to handle programmers
970966
*
971967
* Fourthly The build path for the core is {BUILD.PATH}/core/core in sloeber
972-
* where it is {BUILD.PATH}/core/ in arduino world and used to be {BUILD.PATH}/
968+
* where it is {build.path}/core/ in arduino world and used to be {build.path}/
973969
* This only gives problems in the link command as sometimes there are hardcoded
974-
* links to some sys files so ${A.BUILD.PATH}/core/sys* ${A.BUILD.PATH}/sys* is
975-
* replaced with ${A.BUILD.PATH}/core/core/sys*
970+
* links to some sys files so ${build.path}/core/sys* ${build.path}/sys* is
971+
* replaced with ${build.path}/core/core/sys*
976972
*
977973
* @param contribEnv
978974
* @param confDesc
@@ -998,7 +994,7 @@ private Map<String, String> getEnvVarsPostProcessing(Map<String, String> vars) {
998994
recipe = recipe.replace(" -o ", " "); //$NON-NLS-1$ //$NON-NLS-2$
999995
}
1000996
String recipeParts[] = recipe.split(
1001-
"(\"\\$\\{A.object_file}\")|(\\$\\{A.object_files})|(\"\\$\\{A.source_file}\")|(\"[^\"]*\\$\\{A.archive_file}\")|(\"[^\"]*\\$\\{A.archive_file_path}\")", //$NON-NLS-1$
997+
"(\"\\$\\{object_file}\")|(\\$\\{object_files})|(\"\\$\\{source_file}\")|(\"[^\"]*\\$\\{archive_file}\")|(\"[^\"]*\\$\\{archive_file_path}\")", //$NON-NLS-1$
1002998
3);
1003999

10041000
switch (recipeParts.length) {
@@ -1032,19 +1028,19 @@ private Map<String, String> getEnvVarsPostProcessing(Map<String, String> vars) {
10321028
}
10331029
}
10341030
Collections.sort(objcopyCommand);
1035-
extraVars.put(JANTJE_OBJCOPY, StringUtil.join(objcopyCommand, "\n\t")); //$NON-NLS-1$
1031+
extraVars.put(SLOEBER_OBJCOPY, StringUtil.join(objcopyCommand, "\n\t")); //$NON-NLS-1$
10361032

10371033
// handle the hooks
1038-
extraVars.putAll(getEnvVarsHookBuild(vars, "A.JANTJE.pre.link", //$NON-NLS-1$
1039-
"A.recipe.hooks.linking.prelink.XX.pattern", false)); //$NON-NLS-1$
1040-
extraVars.putAll(getEnvVarsHookBuild(vars, "A.JANTJE.post.link", //$NON-NLS-1$
1041-
"A.recipe.hooks.linking.postlink.XX.pattern", true)); //$NON-NLS-1$
1042-
extraVars.putAll(getEnvVarsHookBuild(vars, "A.JANTJE.prebuild", "A.recipe.hooks.prebuild.XX.pattern", //$NON-NLS-1$ //$NON-NLS-2$
1034+
extraVars.putAll(getEnvVarsHookBuild(vars, "sloeber.pre.link", //$NON-NLS-1$
1035+
"recipe.hooks.linking.prelink.XX.pattern", false)); //$NON-NLS-1$
1036+
extraVars.putAll(getEnvVarsHookBuild(vars, "sloeber.post.link", //$NON-NLS-1$
1037+
"recipe.hooks.linking.postlink.XX.pattern", true)); //$NON-NLS-1$
1038+
extraVars.putAll(getEnvVarsHookBuild(vars, "sloeber.prebuild", "recipe.hooks.prebuild.XX.pattern", //$NON-NLS-1$ //$NON-NLS-2$
10431039
false));
1044-
extraVars.putAll(getEnvVarsHookBuild(vars, "A.JANTJE.sketch.prebuild", //$NON-NLS-1$
1045-
"A.recipe.hooks.sketch.prebuild.XX.pattern", false)); //$NON-NLS-1$
1046-
extraVars.putAll(getEnvVarsHookBuild(vars, "A.JANTJE.sketch.postbuild", //$NON-NLS-1$
1047-
"A.recipe.hooks.sketch.postbuild.XX.pattern", false)); //$NON-NLS-1$
1040+
extraVars.putAll(getEnvVarsHookBuild(vars, "sloeber.sketch.prebuild", //$NON-NLS-1$
1041+
"recipe.hooks.sketch.prebuild.XX.pattern", false)); //$NON-NLS-1$
1042+
extraVars.putAll(getEnvVarsHookBuild(vars, "sloeber.sketch.postbuild", //$NON-NLS-1$
1043+
"recipe.hooks.sketch.postbuild.XX.pattern", false)); //$NON-NLS-1$
10481044

10491045
// add -relax for mega boards; the arduino ide way
10501046
String buildMCU = vars.get(ENV_KEY_BUILD_MCU);

0 commit comments

Comments
 (0)