8000 Merge branch 'master' of https://github.com/robertinant/arduino-builder · arduino/arduino-builder@e491803 · GitHub
[go: up one dir, main page]

Skip to content

Commit e491803

Browse files
committed
2 parents 38fbf48 + 33c223f commit e491803

25 files changed

+711
-102
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This tool generates function prototypes and gathers library paths, providing `gc
3333

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

36-
* `-logger`: Optional, can be "human" or "machine". Defaults to "human". If "machine", messages emitted will be in a format which the Arduino IDE understands and that it uses for I18N.
36+
* `-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.
3737

3838
* `-version`: if specified, prints version and exits.
3939

@@ -57,19 +57,23 @@ See [Doing continuous integration with arduino builder](https://github.com/ardui
5757

5858
You need [Go 1.6.3](https://golang.org/dl/#go1.6.3).
5959

60-
Repo root contains the script `setup_go_env_vars`. Use it as is or as a template for setting up Go environment variables.
61-
6260
To install `codereview/patch` you have to install [Mercurial](https://www.mercurial-scm.org/) first.
6361

64-
Once done, run the following commands:
62+
To set things up, run the following inside the cloned arduino-builder
63+
directory:
6564

6665
```
66+
export GOPATH=$(pwd)
6767
go get github.com/go-errors/errors
6868
go get github.com/stretchr/testify
6969
go get github.com/jstemmer/go-junit-report
7070
go build arduino.cc/arduino-builder
7171
```
7272

73+
After installing dependencies, you do not need to run the `go get`
74+
commands again, but you will have to set `GOPATH` again for every shell
75+
you want to build in.
76+
7377
### TDD
7478

7579
In order to run the tests, type:

setup_go_env_vars

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/arduino.cc/arduino-builder/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const FLAG_WARNINGS_MORE = "more"
7575
const FLAG_WARNINGS_ALL = "all"
7676
const FLAG_LOGGER = "logger"
7777
const FLAG_LOGGER_HUMAN = "human"
78+
const FLAG_LOGGER_HUMANTAGS = "humantags"
7879
const FLAG_LOGGER_MACHINE = "machine"
7980
const FLAG_VERSION = "version"
8081
const FLAG_VID_PID = "vid-pid"
@@ -155,7 +156,7 @@ func init() {
155156
quietFlag = flag.Bool(FLAG_QUIET, false, "if 'true' doesn't print any warnings or progress or whatever")
156157
debugLevelFlag = flag.Int(FLAG_DEBUG_LEVEL, builder.DEFAULT_DEBUG_LEVEL, "Turns on debugging messages. The higher, the chattier")
157158
warningsLevelFlag = flag.String(FLAG_WARNINGS, "", "Sets warnings level. Available values are '"+FLAG_WARNINGS_NONE+"', '"+FLAG_WARNINGS_DEFAULT+"', '"+FLAG_WARNINGS_MORE+"' and '"+FLAG_WARNINGS_ALL+"'")
158-
loggerFlag = flag.String(FLAG_LOGGER, FLAG_LOGGER_HUMAN, "Sets type of logger. Available values are '"+FLAG_LOGGER_HUMAN+"', '"+FLAG_LOGGER_MACHINE+"'")
159+
loggerFlag = flag.String(FLAG_LOGGER, FLAG_LOGGER_HUMAN, "Sets type of logger. Available values are '"+FLAG_LOGGER_HUMAN+"', '"+FLAG_LOGGER_HUMANTAGS+"', '"+FLAG_LOGGER_MACHINE+"'")
159160
versionFlag = flag.Bool(FLAG_VERSION, false, "prints version and exits")
160161
vidPidFlag = flag.String(FLAG_VID_PID, "", "specify to use vid/pid specific build properties, as defined in boards.txt")
161162
}
@@ -321,6 +322,8 @@ func main() {
321322
ctx.SetLogger(i18n.NoopLogger{})
322323
} else if *loggerFlag == FLAG_LOGGER_MACHINE {
323324
ctx.SetLogger(i18n.MachineLogger{})
325+
} else if *loggerFlag == FLAG_LOGGER_HUMANTAGS {
326+
ctx.SetLogger(i18n.HumanTagsLogger{})
324327
} else {
325328
ctx.SetLogger(i18n.HumanLogger{})
326329
}

src/arduino.cc/builder/constants/constants.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const BUILD_PROPERTIES_BUILD_SYSTEM_PATH = "build.system.path"
4949
const BUILD_PROPERTIES_BUILD_VARIANT = "build.variant"
5050
const BUILD_PROPERTIES_BUILD_VARIANT_PATH = "build.variant.path"
5151
const BUILD_PROPERTIES_COMPILER_C_ELF_FLAGS = "compiler.c.elf.flags"
52+
const BUILD_PROPERTIES_COMPILER_C_ELF_EXTRAFLAGS = "compiler.c.elf.extra_flags"
5253
const BUILD_PROPERTIES_COMPILER_CPP_FLAGS = "compiler.cpp.flags"
5354
const BUILD_PROPERTIES_COMPILER_PATH = "compiler.path"
5455
const BUILD_PROPERTIES_COMPILER_WARNING_FLAGS = "compiler.warning_flags"
@@ -139,6 +140,8 @@ const LIBRARY_LICENSE = "license"
139140
const LIBRARY_MAINTAINER = "maintainer"
140141
const LIBRARY_NAME = "name"
141142
const LIBRARY_PARAGRAPH = "paragraph"
143+
const LIBRARY_PRECOMPILED = "precompiled"
144+
const LIBRARY_LDFLAGS = "ldflags"
142145
const LIBRARY_PROPERTIES = "library.properties"
143146
const LIBRARY_SENTENCE = "sentence"
144147
const LIBRARY_URL = "url"
@@ -148,12 +151,14 @@ const LOG_LEVEL_ERROR = "error"
148151
const LOG_LEVEL_INFO = "info"
149152
const LOG_LEVEL_WARN = "warn"
150153
const MSG_ARCH_FOLDER_NOT_SUPPORTED = "'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information"
154+
const MSG_ARCHIVING_CORE_CACHE = "Archiving built core (caching) in: {0}"
151155
const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown"
152156
const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}"
153157
const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
154158
const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}"
155159
const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName."
156160
const MSG_INVALID_QUOTING = "Invalid quoting: no closing [{0}] char found."
161+
const MSG_IGNORED_BUILTIN_TOOLS_TXT = "Skipping {0}; please consider removing that file since it may hurt older Arduino installations"
157162
const MSG_LIB_LEGACY = "(legacy)"
158163
const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\""
159164
const MSG_LIBRARIES_NOT_USED = " Not used: {0}"

src/arduino.cc/builder/container_find_includes.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,16 @@ func queueSourceFilesFromFolder(ctx *types.Context, queue *types.UniqueSourceFil
376376
if err != nil {
377377
return i18n.WrapError(err)
378378
}
379-
queue.Push(sourceFile)
379+
/*
380+
* hack: This is for Energia EMT targets to skip main.cpp
381+
* When the cache file is build the first time, main.cpp is not there yet
382+
* in the <build folder>/sketch.
383+
* On a second run it is there and the cache mismatches that of what is on disk
384+
* resulting in a pointer outside the cache array.
385+
*/
386+
if sourceFile.RelativePath != "main.cpp" {
387+
queue.Push(sourceFile)
388+
}
380389
}
381390

382391
return nil

0 commit comments

Comments
 (0)
0