Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactored build-properties creation (and removed some legacy code) #2082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Moved 'build.fqbn' and 'build.arch' properties generation
  • Loading branch information
cmaglie committed Feb 27, 2023
commit 7e270d6229fbd38ff36e0b714b992a93c3d9325b
2 changes: 2 additions & 0 deletions 2 arduino/cores/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map

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

// Add all sub-configurations one by one (a config is: option=value)
// Check for residual invalid options...
Expand Down
6 changes: 6 additions & 0 deletions 6 arduino/cores/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,11 @@ func TestBoardOptions(t *testing.T) {
expConf2560.Set("bootloader.low_fuses", "0xFF")
expConf2560.Set("bootloader.tool", "avrdude")
expConf2560.Set("bootloader.unlock_bits", "0x3F")
expConf2560.Set("build.arch", "AVR")
expConf2560.Set("build.board", "AVR_MEGA2560")
expConf2560.Set("build.core", "arduino")
expConf2560.Set("build.f_cpu", "16000000L")
expConf2560.Set("build.fqbn", "arduino:avr:mega")
expConf2560.Set("build.mcu", "atmega2560")
expConf2560.Set("build.variant", "mega")
expConf2560.Set("menu.cpu.atmega1280", "ATmega1280")
Expand Down Expand Up @@ -275,9 +277,11 @@ func TestBoardOptions(t *testing.T) {
expConf1280.Set("bootloader.low_fuses", "0xFF")
expConf1280.Set("bootloader.tool", "avrdude")
expConf1280.Set("bootloader.unlock_bits", "0x3F")
expConf1280.Set("build.arch", "AVR")
expConf1280.Set("build.board", "AVR_MEGA")
expConf1280.Set("build.core", "arduino")
expConf1280.Set("build.f_cpu", "16000000L")
expConf1280.Set("build.fqbn", "arduino:avr:mega")
expConf1280.Set("build.mcu", "atmega1280")
expConf1280.Set("build.variant", "mega")
expConf1280.Set("menu.cpu.atmega1280", "ATmega1280")
Expand Down Expand Up @@ -334,9 +338,11 @@ func TestBoardOptions(t *testing.T) {
expWatterott.Set("bootloader.low_fuses", "0xE2")
expWatterott.Set("bootloader.tool", "avrdude")
expWatterott.Set("bootloader.unlock_bits", "0xFF")
expWatterott.Set("build.arch", "AVR")
expWatterott.Set("build.board", "AVR_ATTINY841")
expWatterott.Set("build.core", "tiny841")
expWatterott.Set("build.f_cpu", "8000000L")
expWatterott.Set("build.fqbn", "watterott:avr:attiny841")
expWatterott.Set("build.mcu", "attiny841")
expWatterott.Set("build.variant", "tiny14")
expWatterott.Set("menu.core.arduino", "Standard Arduino")
Expand Down
2 changes: 0 additions & 2 deletions 2 legacy/builder/setup_build_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
if ctx.Sketch != nil {
buildProperties.Set("build.project_name", ctx.Sketch.MainFile.Base())
}
buildProperties.Set("build.arch", strings.ToUpper(targetPlatform.Platform.Architecture))

// get base folder and use it to populate BUILD_PROPERTIES_RUNTIME_IDE_PATH (arduino and arduino-builder live in the same dir)
ex, err := os.Executable()
Expand All @@ -64,7 +63,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
buildProperties.Set("runtime.hardware.path", targetPlatform.InstallDir.Join("..").String())
buildProperties.Set("runtime.ide.version", ctx.ArduinoAPIVersion)
buildProperties.Set("runtime.ide.path", exPath)
buildProperties.Set("build.fqbn", ctx.FQBN.String())
buildProperties.Set("ide_version", ctx.ArduinoAPIVersion)
buildProperties.Set("runtime.os", properties.GetOSSuffix())
buildProperties.Set("build.library_discovery_phase", "0")
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.