• Stars
    star
    451
  • Rank 93,710 (Top 2 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A command line tool for compiling Arduino sketches

DEPRECATION WARNING: This tool is being phased out in favor of Arduino CLI, we recommend to use Arduino CLI for new projects.

The source code of the builder has been moved in the arduino-cli repository (as a legacy package) where it will be maintained and developed and eventually moved outside the legacy package once properly integrated in the Arduino CLI codebase.

The arduino-builder is now just a wrapper of arduino-cli. We will continue to provide builds of this project for some time to allow a smooth transition period to our users.

Arduino Builder Build Status

A command line tool for compiling Arduino sketches

This tool is able to parse Arduino Hardware specifications, properly run gcc and produce compiled sketches.

An Arduino sketch differs from a standard C program in that it misses a main (provided by the Arduino core), function prototypes are not mandatory, and libraries inclusion is automagic (you just have to #include them). This tool generates function prototypes and gathers library paths, providing gcc with all the needed -I params.

Usage

  • -compile or -dump-prefs or -preprocess: Optional. If omitted, defaults to -compile. -dump-prefs will just print all build preferences used, -compile will use those preferences to run the actual compiler, -preprocess will only print preprocessed code to stdout.

  • -hardware: Mandatory. Folder containing Arduino platforms. An example is the hardware folder shipped with the Arduino IDE, or the packages folder created by Arduino Boards Manager. Can be specified multiple times. If conflicting hardware definitions are specified, the last one wins.

  • -tools: Mandatory. Folder containing Arduino tools (gcc, avrdude...). An example is the hardware/tools folder shipped with the Arduino IDE, or the packages folder created by Arduino Boards Manager. Can be specified multiple times.

  • -libraries: Optional. Folder containing Arduino libraries. An example is the libraries folder shipped with the Arduino IDE. Can be specified multiple times.

  • -fqbn: Mandatory. Fully Qualified Board Name, e.g.: arduino:avr:uno

  • -build-path: Optional. Folder where to save compiled files. If omitted, a folder will be created in the temporary folder specified by your OS.

  • -prefs=key=value: Optional. It allows to override some build properties.

  • -warnings: Optional, can be "none", "default", "more" and "all". Defaults to "none". Used to tell gcc which warning level to use (-W flag).

  • -verbose: Optional, turns on verbose mode.

  • -quiet: Optional, supresses almost every output.

  • -debug-level: Optional, defaults to "5". Used for debugging. Set it to 10 when submitting an issue.

  • -core-api-version: Optional, defaults to "10600". The version of the Arduino IDE which is using this tool.

  • -logger: Optional, can be "human", "humantags" or "machine". Defaults to "human". If "humantags" the messages are qualified with a prefix that indicates their level (info, debug, error). If "machine", messages emitted will be in a format which the Arduino IDE understands and that it uses for I18N.

  • -version: if specified, prints version and exits.

  • -build-options-file: it specifies path to a local build.options.json file (see paragraph below), which allows you to omit specifying params such as -hardware, -tools, -libraries, -fqbn, -pref and -ide-version.

  • -vid-pid: when specified, VID/PID specific build properties are used, if boards supports them.

Final mandatory parameter is the sketch to compile (of course).

What is and how to use build.options.json file

Every time you run this tool, it will create a build.options.json file in build path. It's used to understand if build options (such as hardware folders, fqbn and so on) were changed when compiling the same sketch. If they changed, the whole build path is wiped out. If they didn't change, previous compiled files will be reused if the corresponding source files didn't change as well. You can save this file locally and use it instead of specifying -hardware, -tools, -libraries, -fqbn, -pref and -ide-version.

Using it for continuously verify your libraries or cores

See Doing continuous integration with arduino builder.

Building from source

You need a version of Go >=1.13.0.

The project now uses go.mod for dependecy management, there is no need to go get anything or to set GOPATH env vars. The build is very simple:

$ git clone https://github.com/arduino/arduino-builder.git
$ cd arduino-builder
$ go build
[.....]
$ ./arduino-builder -version
Arduino Builder 1.5.1
Copyright (C) 2015 Arduino LLC and contributors
See https://www.arduino.cc/ and https://github.com/arduino/arduino-builder/graphs/contributors
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Security

If you think you found a vulnerability or other security-related bug in this project, please read our security policy and report the bug to our Security Team ๐Ÿ›ก๏ธ Thank you!

e-mail contact: [email protected]

License and Copyright

arduino-builder is licensed under General Public License version 2, as published by the Free Software Foundation. See LICENSE.txt.

Copyright (C) 2017 Arduino AG and contributors

See https://www.arduino.cc/ and https://github.com/arduino/arduino-builder/graphs/contributors

More Repositories

1

Arduino

Arduino IDE 1.x
Java
13,961
star
2

arduino-cli

Arduino command line tool
Go
4,158
star
3

arduino-ide

Arduino IDE 2.x
TypeScript
2,054
star
4

ArduinoCore-avr

The Official Arduino AVR core
C
1,141
star
5

arduino-pro-ide

The Arduino IDE for advanced users and developers. Experimental alpha version.
883
star
6

ArduinoCore-samd

Arduino Core for SAMD21 CPU
C
449
star
7

arduino-create-agent

The Arduino Create Agent
Go
411
star
8

ArduinoCore-arc32

C
322
star
9

ArduinoCore-mbed

C
309
star
10

ArduinoTensorFlowLiteTutorials

Jupyter Notebook
244
star
11

library-registry

Arduino Library Manager list
207
star
12

lab-micropython-editor

Arduino Lab for MicroPython is an Integrated Development Environment (IDE) for MicroPython.
JavaScript
185
star
13

ArduinoCore-API

Hardware independent layer of the Arduino cores defining the official API
C++
173
star
14

reference-en

Editable source for the Arduino Reference
161
star
15

openwrt-yun

A custom version of OpenWrt, targeted to the Arduino Yรบn
C
146
star
16

toolchain-avr

The AVR toolchain used by the Arduino IDE
Shell
136
star
17

setup-protoc

GitHub Action to setup the protoc compiler for protocol buffers
TypeScript
126
star
18

docs-content

Arduino documentation (docs.arduino.cc)
Python
125
star
19

nina-fw

Firmware for u-blox NINA W102 WiFi/BT module
C
123
star
20

arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
Go
112
star
21

OpenOCD

Fork of OpenOCD
C
108
star
22

ArduinoCore-megaavr

Arduino Core for the ATMEGA4809 CPU
C++
101
star
23

linino

C
99
star
24

arduino-lint

Tool to check for problems with Arduino projects
Go
96
star
25

wifishield

Arduino Wifi Shield
C
92
star
26

ArduinoCore-renesas

C
88
star
27

ArduinoCore-nRF528x-mbedos

[Archived] Arduino core supporting mbed-enabled boards
C
86
star
28

setup-task

GitHub Actions action to make Task available for use in your workflow
TypeScript
85
star
29

arduino-examples

Arduino IDE bundled examples
Shell
83
star
30

setup-arduino-cli

GitHub Action to setup Arduino CLI
TypeScript
74
star
31

YunBridge

Python
72
star
32

ArduinoCloudProviderExamples

Examples of how to connect various Arduino boards to cloud providers.
C
70
star
33

ArduinoCore-sam

HTML
70
star
34

BtSerial

A Bluetooth Serial library for Processing for Android
Java
69
star
35

tutorials

C++
69
star
36

ArduinoAI

Arduino AI content / demos
JavaScript
66
star
37

openwrt-packages-yun

Makefile
65
star
38

compile-sketches

GitHub Actions action that checks whether Arduino sketches compile and produces a report of data from the compilations
Python
57
star
39

AIoT-Dev-Summit-2019

C++
55
star
40

YunWebUI

Arduino/Genuino Yรบn or Yรบn Shield Web panel
JavaScript
51
star
41

RXTX

Arduino version of RXTX
Shell
49
star
42

arduino-preprocessor

Parses an Arduino Sketch and converts it into valid C++ source code
C++
49
star
43

Arduino-Science-Journal-Android

Use the sensors in your mobile devices to perform science experiments. Science doesnโ€™t just happen in the classroom or labโ€”tools like Science Journal let you see how the world works with just your phone.
Java
48
star
44

language

This repository serves a central entry point to discussions concerning the Arduino Language.
47
star
45

arduino-fwuploader

A Command Line Tool made to update the firmware and/or add SSL certificates for any Arduino board equipped with WINC or NINA Wi-Fi module.
Go
46
star
46

nicla-sense-me-fw

Arduino Nicla Sense ME resources (libraries, bootloader, host pc utilities)
C
43
star
47

arduino-lint-action

GitHub Actions action to check Arduino projects for problems
TypeScript
42
star
48

summer-of-code

Arduino @ Google Summer of Code
40
star
49

go-apt-client

Go
39
star
50

ArduinoCore-primo

Arduino core for nrf52 cpu
C
38
star
51

arduino-iot-js

Arduino IoT Cloud - Javascript SDK
JavaScript
37
star
52

ArduinoISP

C
36
star
53

arduino-connector

Connector to the Arduino Create Cloud and IoT platform
Go
36
star
54

TFTP-Bootloader

An unfinished TFTP bootloader for Arduino Ethernet
C
35
star
55

avrdude-build-script

avrdude build scripts for Arduino/Genuino
Shell
34
star
56

EduIntro

Arduino library aimed at making super-fast introductory workshops to Arduino. Based on the idea of having components as objects in the code.
C++
34
star
57

actions

Collection of custom Github actions
Python
34
star
58

arduino-create-agent-js-client

JS module providing discovery of the Arduino Create Plugin and communication with it
JavaScript
33
star
59

mcuboot-arduino-stm32h7

C
26
star
60

arduino-usb-scanner

Tool that scans the USB bus autodetecting Arduino boards and their serial port names
25
star
61

arduino-iot-cloud-py

Arduino IoT Cloud Python Client.
Python
24
star
62

dfu-utils-cross

scripts to compile (and cross-compile from a Linux machine) dfu-utils package for Linux (x86_64, x86, arm), OSX and Windows.
C
23
star
63

mkrwan1300-fw

C++
22
star
64

rp2040tools

Go
22
star
65

vscode-arduino-tools

Arduino Language Server extension for VS Code
TypeScript
22
star
66

Arduino-Science-Journal-iOS

Use the sensors in your mobile devices to perform science experiments. Science doesnโ€™t just happen in the classroom or labโ€”tools like Science Journal let you see how the world works with just your phone.
Swift
22
star
67

iot-client-py

Python client for Arduino IoT API
Python
21
star
68

arduino-cli-example

C++
21
star
69

uno-r4-library-compatibility

21
star
70

uno-r4-wifi-usb-bridge

C++
21
star
71

iot-client-js

Javascript client for Arduino IoT API
JavaScript
21
star
72

Tests

Arduino
20
star
73

HMC5983

Proof of concept of an Arduino library for Honeywell's HMC5983 magnetic sensor.
C++
20
star
74

arduino-flash-tools

Arduino Tools for Create
C
20
star
75

iot-client-go

Go client for Arduino IoT API
Go
20
star
76

ArduinoModule-CMSIS-Atmel

Atmel Smart ARM devices CMSIS module for Arduino IDE
C
20
star
77

serial-discovery

An Arduino IDE pluggable-discovery for Serial ports
Go
19
star
78

ethernet-bootloader

TFTP Bootloader for the Arduino Ethernet Board
C
19
star
79

astyle

Scripts and patches used to build astyle, a code formatter used by the Arduino IDE
Shell
18
star
80

mdns-discovery

mdns (bonjour) pluggable discovery
Go
16
star
81

cpp-test-action

A GitHub Actions action for testing C/C++ projects
16
star
82

arduinoOTA

Go
15
star
83

livecast

Code for the examples presented at the Arduino Livecasts
C++
15
star
84

openwrt-yun-1505

Updated build system for OpenWrt - Yun family boards
C
14
star
85

reference-pt

Portuguese version of the Arduino Reference
14
star
86

WiFi101-FirmwareUpdater-Plugin

WiFi101 Firmware Updater Tool for Arduino IDE
Java
13
star
87

lab-micropython-installer

This repository hosts the entire code of the Arduino MicroPython Installer tool
C
13
star
88

report-size-deltas

GitHub Actions action that comments on pull requests with a report of change in memory usage of Arduino sketches
Python
13
star
89

the-things-conference

C
12
star
90

reference-fr

12
star
91

arduino-cloud-cli

Go
12
star
92

season-of-docs

Arduino and Google's Season of Docs 2019
12
star
93

ctags

A mix of ctags and anjuta-tags for the perfect C++ ctags
C
12
star
94

libraries-repository-engine

Arduino Library Manager index manager
Go
11
star
95

lede-yun

C
11
star
96

cloud-examples

Examples for Arduino Cloud
JavaScript
11
star
97

serial-monitor

Arduino pluggable monitor for serial ports
Go
11
star
98

tooling-project-assets

A collection of reusable assets for Arduino tooling projects
Python
11
star
99

reference-es

10
star
100

arduino-iot-google-sheet-script

A script to integration Arduino IoT Cloud with Google Sheet to automatically save historical data about your sensors
JavaScript
10
star