Skip to content

Commit 7e270d6

Browse files
committed
Moved 'build.fqbn' and 'build.arch' properties generation
1 parent c660b33 commit 7e270d6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

arduino/cores/board.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map
125125

126126
// Start with board's base properties
127127
buildProperties := b.Properties.Clone()
128+
buildProperties.Set("build.fqbn", b.FQBN())
129+
buildProperties.Set("build.arch", strings.ToUpper(b.PlatformRelease.Platform.Architecture))
128130

129131
// Add all sub-configurations one by one (a config is: option=value)
130132
// Check for residual invalid options...

arduino/cores/board_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,11 @@ func TestBoardOptions(t *testing.T) {
216216
expConf2560.Set("bootloader.low_fuses", "0xFF")
217217
expConf2560.Set("bootloader.tool", "avrdude")
218218
expConf2560.Set("bootloader.unlock_bits", "0x3F")
219+
expConf2560.Set("build.arch", "AVR")
219220
expConf2560.Set("build.board", "AVR_MEGA2560")
220221
expConf2560.Set("build.core", "arduino")
221222
expConf2560.Set("build.f_cpu", "16000000L")
223+
expConf2560.Set("build.fqbn", "arduino:avr:mega")
222224
expConf2560.Set("build.mcu", "atmega2560")
223225
expConf2560.Set("build.variant", "mega")
224226
expConf2560.Set("menu.cpu.atmega1280", "ATmega1280")
@@ -275,9 +277,11 @@ func TestBoardOptions(t *testing.T) {
275277
expConf1280.Set("bootloader.low_fuses", "0xFF")
276278
expConf1280.Set("bootloader.tool", "avrdude")
277279
expConf1280.Set("bootloader.unlock_bits", "0x3F")
280+
expConf1280.Set("build.arch", "AVR")
278281
expConf1280.Set("build.board", "AVR_MEGA")
279282
expConf1280.Set("build.core", "arduino")
280283
expConf1280.Set("build.f_cpu", "16000000L")
284+
expConf1280.Set("build.fqbn", "arduino:avr:mega")
281285
expConf1280.Set("build.mcu", "atmega1280")
282286
expConf1280.Set("build.variant", "mega")
283287
expConf1280.Set("menu.cpu.atmega1280", "ATmega1280")
@@ -334,9 +338,11 @@ func TestBoardOptions(t *testing.T) {
334338
expWatterott.Set("bootloader.low_fuses", "0xE2")
335339
expWatterott.Set("bootloader.tool", "avrdude")
336340
expWatterott.Set("bootloader.unlock_bits", "0xFF")
341+
expWatterott.Set("build.arch", "AVR")
337342
expWatterott.Set("build.board", "AVR_ATTINY841")
338343
expWatterott.Set("build.core", "tiny841")
339344
expWatterott.Set("build.f_cpu", "8000000L")
345+
expWatterott.Set("build.fqbn", "watterott:avr:attiny841")
340346
expWatterott.Set("build.mcu", "attiny841")
341347
expWatterott.Set("build.variant", "tiny14")
342348
expWatterott.Set("menu.core.arduino", "Standard Arduino")

legacy/builder/setup_build_properties.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
4848
if ctx.Sketch != nil {
4949
buildProperties.Set("build.project_name", ctx.Sketch.MainFile.Base())
5050
}
51-
buildProperties.Set("build.arch", strings.ToUpper(targetPlatform.Platform.Architecture))
5251

5352
// get base folder and use it to populate BUILD_PROPERTIES_RUNTIME_IDE_PATH (arduino and arduino-builder live in the same dir)
5453
ex, err := os.Executable()
@@ -64,7 +63,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
6463
buildProperties.Set("runtime.hardware.path", targetPlatform.InstallDir.Join("..").String())
6564
buildProperties.Set("runtime.ide.version", ctx.ArduinoAPIVersion)
6665
buildProperties.Set("runtime.ide.path", exPath)
67-
buildProperties.Set("build.fqbn", ctx.FQBN.String())
6866
buildProperties.Set("ide_version", ctx.ArduinoAPIVersion)
6967
buildProperties.Set("runtime.os", properties.GetOSSuffix())
7068
buildProperties.Set("build.library_discovery_phase", "0")

0 commit comments

Comments
 (0)