You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,15 @@ This tool generates function prototypes and gathers library paths, providing `gc
37
37
38
38
*`-version`: if specified, prints version and exits.
39
39
40
+
*`-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`.
41
+
40
42
Final mandatory parameter is the sketch to compile (of course).
43
+
44
+
### What is and how to use build.options.json file
45
+
46
+
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.
47
+
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.
48
+
You can save this file locally and use it instead of specifying `-hardware`, `-tools`, `-libraries`, `-fqbn`, `-pref` and `-ide-version`.
41
49
42
50
### Using it for continuously verify your libraries or cores
verboseFlag=flag.Bool("verbose", false, "if 'true' prints lots of stuff")
98
-
debugLevelFlag=flag.Int("debug-level", builder.DEFAULT_DEBUG_LEVEL, "Turns on debugging messages. The higher, the chattier")
99
-
warningsLevelFlag=flag.String("warnings", "", "Sets warnings level. Available values are 'none', 'default', 'more' and 'all'")
100
-
loggerFlag=flag.String("logger", "human", "Sets type of logger. Available values are 'human', 'machine'")
101
-
libraryDiscoveryRecursionDepthFlag=flag.Int("lib-discovery-recursion-depth", builder.DEFAULT_LIBRARY_DISCOVERY_RECURSION_DEPTH, "How deep should library discovery go down looking for included libraries")
102
-
versionFlag=flag.Bool("version", false, "prints version and exits")
114
+
compileFlag=flag.Bool(FLAG_COMPILE, false, "compiles the given sketch")
115
+
dumpPrefsFlag=flag.Bool(FLAG_DUMP_PREFS, false, "dumps build properties used when compiling")
116
+
buildOptionsFileFlag=flag.String(FLAG_BUILD_OPTIONS_FILE, "", "Instead of specifying --"+FLAG_HARDWARE+", --"+FLAG_TOOLS+" etc every time, you can load all such options from a file")
117
+
flag.Var(&hardwareFoldersFlag, FLAG_HARDWARE, "Specify a 'hardware' folder. Can be added multiple times for specifying multiple 'hardware' folders")
118
+
flag.Var(&toolsFoldersFlag, FLAG_TOOLS, "Specify a 'tools' folder. Can be added multiple times for specifying multiple 'tools' folders")
119
+
flag.Var(&librariesFoldersFlag, FLAG_LIBRARIES, "Specify a 'libraries' folder. Can be added multiple times for specifying multiple 'libraries' folders")
120
+
flag.Var(&customBuildPropertiesFlag, FLAG_PREFS, "Specify a custom preference. Can be added multiple times for specifying multiple custom preferences")
verboseFlag=flag.Bool(FLAG_VERBOSE, false, "if 'true' prints lots of stuff")
125
+
debugLevelFlag=flag.Int(FLAG_DEBUG_LEVEL, builder.DEFAULT_DEBUG_LEVEL, "Turns on debugging messages. The higher, the chattier")
126
+
warningsLevelFlag=flag.String(FLAG_WARNINGS, "", "Sets warnings level. Available values are '"+FLAG_WARNINGS_NONE+"', '"+FLAG_WARNINGS_DEFAULT+"', '"+FLAG_WARNINGS_MORE+"' and '"+FLAG_WARNINGS_ALL+"'")
127
+
loggerFlag=flag.String(FLAG_LOGGER, FLAG_LOGGER_HUMAN, "Sets type of logger. Available values are '"+FLAG_LOGGER_HUMAN+"', '"+FLAG_LOGGER_MACHINE+"'")
128
+
libraryDiscoveryRecursionDepthFlag=flag.Int(FLAG_LIB_DISCOVERY_RECURSION_PATH, builder.DEFAULT_LIBRARY_DISCOVERY_RECURSION_DEPTH, "How deep should library discovery go down looking for included libraries")
129
+
versionFlag=flag.Bool(FLAG_VERSION, false, "prints version and exits")
103
130
}
104
131
105
132
funcmain() {
@@ -119,7 +146,7 @@ func main() {
119
146
dumpPrefs:=*dumpPrefsFlag
120
147
121
148
ifcompile&&dumpPrefs {
122
-
fmt.Fprintln(os.Stderr, "You can either specify --compile or --dump-prefs, not both")
149
+
fmt.Fprintln(os.Stderr, "You can either specify --"+FLAG_COMPILE+" or --"+FLAG_DUMP_PREFS+", not both")
0 commit comments