Also removed unused ColorSelector and CreateFont to reduce wrappers
size to the minimum.
This commit is preparatory for dropping dependency on processing-core.
Created a class PreferencesData to manage all parameters except the ones for the GUI.
Removed GUI parameters management from ParametersMap.
Created ParametersHelper class to help with GUI parameters management.
Used ParametersHelper in Themes.
Create a class SketchData to store all relevant data for a sketch
(trying to keep GUI stuff out of the way).
Moved preprocessing code from Sketch to Compiler.
Nobody was using it anymore, except for checking against specific
extensions, which is easily done against the filename itself. This
prepares for some simplification of Sketch.load next.
Previously, the useRecursion and srcFolders were filled on library
creation, based on the existence of the src folder. Now, a layout
variable is set, and the useRecursion() and getSrcFolder() methods
change their return value based on the layout in use.
Before, core.a would be rebuilt on every build, even when none of the
core .o files changed. Now, the timestamps are checked against the
timestamp on core.a first, skipping the build if nothing changed.
Because this uses the current list of .o files, there is a corner case
when a source file is deleted, but no other source file is modified. In
that case, core.a is not rebuilt, even though it should be. However,
this is such a narrow and unrealistic case, that it should pose a real
problem.
This fixes part of #1991
This prevents a half-finished core.a file from lingering around.
Currently, this should not make a difference since core.a is rebuilt
every time, but this prepares for skipping this build step if possible.
Before, the ar command was just ran for all .o files that should end up
in core.a, which should replace any old code in core.a. However, it
seems that in the unlikely event that functions or entire source files
are deleted, they might linger in the core.a file.
Previously, the MessageSiphon class would read characters from an
InputStream and then push them to the passed MessageConsumer one line at
a time.
Now, you can specify a line timeout. Normally, messages are still
processed line by line, but if no line ending is received within the
specified timeout (counting from the first character in the line), then
the incomplete line is passed on as a message, without waiting for the
line ending.
This feature is used for the uploader command output. In particular,
this allows the avrdude progress bar to be shown in the IDE as expected,
character by character (previously, the entire progress bar would be
buffered, making it show up completely at the end of the upload).
In the preferences dialog, the name of the preferences file is shown for
advanced editing. If the filename is clicked, the folder containing the
file is opened. However, this always used Base.getSettingsFolder, which
is the folder where the settings file _normally_ resides. But when the
--preferences-file option is used, the actual preferences file might be
somewhere else.
This commit makes sure to always open up the parent directory of the
actual preferences file in use, instead of always the default one.
When no build.path preference is present, a temporary directory is
automatically created (and deleted). When a build.path was specified,
but the directory does not exist, the IDE would show an error and fail
to build, which is unexpected and not so friendly.
This commit makes sure that the build directory is automatically
created.
Before, these were only shown in the GUI, which makes a failing
commandline build a bit puzzling. As a side effect, the error is now
shown in the log area in addition to the status line above the log
area, but that should be ok.
In a lot of places, (potentially) relative paths were passed to File
without any processing, making them be resolved without taking into
account --curdir. By passing them through Base.absoluteFile instead,
these paths are resolved relative to the working directory before
starting arduino (at least on Linux, which is currently the only
platform supporting --curdir).
This applies --curdir to the --preferences-file option and the
build.path, settings.path, sketchbook.path preferences.
For example, this now works as expected:
arduino --pref build.path=build_dir --verify Blink.ino
When a sketch looks like this:
Blink/
Blink.ino
Foo.ino
The idea is that opening Foo.ino should open up the sketch. However,
before this would show an error stating "The file Foo.ino needs to be
inside a sketch folder named Foo" instead.
This turned out to be due to a typo, which seems to have been present
for a long time. Note that when the main sketch file was a .pde file,
everything already worked as expected.