Commit Graph

791 Commits

Author SHA1 Message Date
Cristian Maglie b4f2af4f9d Merge remote-tracking branch 'ide-1.5.x-core.a-rebuild' into ide-1.5.x 2014-11-02 11:52:57 +01:00
Matthijs Kooijman b78339238d Don't recompile core.a if none of the .o files changed
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
2014-10-31 17:48:29 +01:00
Matthijs Kooijman 87c87c2897 Delete core.a when building it fails
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.
2014-10-31 15:43:42 +01:00
Matthijs Kooijman 57bdacc93c Remove core.a before rebuilding it
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.
2014-10-31 15:43:07 +01:00
Cristian Maglie e76de57f6b Fixed parsing of dependency files (.d) to improve sketch build speed
Close #2255
2014-10-31 11:39:36 +01:00
Cristian Maglie 35d616f050 Updated 'master' translations 2014-10-09 10:13:00 +02:00
Federico Fissore b6a4c8172f Processing references removed in favour of Arduino 2014-10-08 18:36:25 +02:00
Federico Fissore 82b6e6e325 macosx: removing java.additional.jvmargs property used for proper tests execution 2014-10-07 13:46:51 +02:00
Federico Fissore 1b783fa48c Formatter: cursor position is saved when invoking autoformat. Fixes #2293 2014-09-30 17:17:13 +02:00
Cristian Maglie 6f9674288b Merge pull request #2279 from cmaglie/fix-leo-upload-osx10.9.4
Fix for upload problems on Arduino Leonardo (and derivatives) on OSX 10.9
2014-09-10 12:58:10 +02:00
Cristian Maglie b7b9da7710 Updated version to 1.5.8 2014-09-05 10:11:47 +02:00
Cristian Maglie aa776b30ba Fix for upload problems on Arduino Leonardo (and derivatives) with OSX 10.9.4 2014-09-01 12:16:41 +02:00
Cristian Maglie ec1310e1bd Removed --no-op from CLI. Preferences now not-saved by default.
See https://github.com/arduino/Arduino/pull/2000 for details.

Close #2000
2014-08-22 15:39:33 +02:00
Cristian Maglie e3dc5e75e3 Removed unused variables. Small cosmetic changes. 2014-08-22 14:24:21 +02:00
Matthijs Kooijman 83ede8fdb4 Fix preference directory opening in the GUI with --preferences-file
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.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman f47ec35ebe If build.path is specified, create it if needed
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.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman c959388b37 Let Editor::statusError print to stderr
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.
2014-08-19 09:16:49 +02:00
Matthijs Kooijman cc773fb1e0 Take into account --curdir for all relative paths
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
2014-08-19 09:16:49 +02:00
Matthijs Kooijman 4f33d0851c Fix opening a non-primary .ino file
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.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman f96d71f32d Fix --curdir on Windows
On Windows, files are canonicalized to prevent issues with legacy 8.3
filenames. However, this canonicalization includes making the path
absolute and this happened before applying --curdir to the path, making
the latter a noop.

By reversing the operations, this should allow both of them to do their
work.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman 31fe4ac0c2 Add Base.absoluteFile method
This method takes filenames as specified on the commandline and turns
them into the right File object, taking into account the current
directory passed through --curdir by the wrapper script.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman 0798e1cf6f Pass around sketch File objects instead of filenames
This saves a few conversions from File object to String and is generally
cleaner.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman 87bdaa88cd Parse --curdir in Base.main()
This shouldn't change any behaviour, but prepares for upcoming changes.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman cf4fb7d0e3 Don't re-parse arguments to --preferences-file
Previously, the argument to --preferences-file would be interpreted as a
filename, but then also checked as an option as well (in the next loop
iteration). This didn't really matter in practice (unless you would be
using a file called "--preferences-file"), but better skip the argument
anyway.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman 9e17e52f63 Parse --preferences-file in main instead of Preferences.init
Parsing commandline arguments inside Preferences isn't very elegant,
this is better suited for the main function. Also, this change prepares
for taking --curdir into account for --preferences-file as well.
2014-08-19 09:16:48 +02:00
Matthijs Kooijman e494f39255 Add --get-pref option
This allows reading specific preferences from the commandline.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman f745fff50b Add --noop option
This option causes the IDE to process its commandline arguments and then
quit. This allows setting preferences uses --pref, without having to
also load the GUI or compile a sketch.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman 7cb99ad7b8 Ensure --verbose is never saved to preferences.txt
Previously, --verbose would be processed after the preferences were
saved, which should usually mean that it should never influence the
saved preferences. However, if for whatever reason Preferences.save()
would be called later, the verbosity preferences would still be messed
up.

Since we now have a Preferences.setDoSave() method, we can make sure
that these verbosity preferences (and any other preferences that are
changed after the build started) are never saved.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman d6333f8f37 Don't save a new preferences file in Preferences.init
Preferences.init would write out the default preferences when no
preference file previously existed. This would cause a default
preferences file to be written even when --no-save-prefs was passed, due
to the ordering of things.

However, since the Base constructor now already calls
Preferences.save(), there is no need for Preferences.init to also do
this. Since Base calls this after parsing the commandline, the
--no-save-prefs option is now also properly respected.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman 4452eb3850 Add --no-save-prefs option
This allows setting preferences for the current run only, without
remembering them for the next run. This is especially useful when
combined with --verify or --upload.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman bbd0128664 Explicitely save preferences on startup
Before, the preferences were saved as a side effect of loading files in
the Editor, but it seems better to explicitely save them as well (this
should prevent problems later on, if the Editor class is no longer used
in --verify or --upload mode).
2014-08-19 09:16:47 +02:00
Matthijs Kooijman e0c599d733 Error when passing --verbose without --verify or --upload
Since the handling of these options defaults to non-verbose (instead of
the current preference), they make no sense when starting the IDE
normally. Previously, these options would just be ignored in this case,
now an error is shown.
2014-08-19 09:16:47 +02:00
Matthijs Kooijman d3e2208c01 Process some commandline arguments earlier
Previously, the --board and --port arguments were stored in a variable
first and only processed later. Now, the arguments are processed right
away.

This does mean that the arguments are processed when the GUI is not yet
initialized, which caused problems with calling onBoardOrPortChange and
friends from selectBoard. However, since the GUI is not initialized,
there is no real reason to call them either - if we just set the
preferences to the right values, the GUI will be initialized correctly
later. For this reason, selectBoard no longer calls the GUI update
methods. Instead, those are called from the GUI code when the board is
changed through the menu instead (e.g., after calling selectBoard).

This commit slightly changes behaviour. Previously, --board and --port
only worked in combination with --verify and --upload, but were ignored
when just starting the IDE. Now, these are processed regardless of the
other options present.

Additionally, this commit causes all changed preferences to be saved.
Previously, only changes with --pref were saved, --board and --port
options were only active for the current run. This was caused because
the saving of the preferences happened as a side effect of loading the
file in the Editor, but only the --pref option was processed at that
time.

Note that the --verbose options are still only active for the current
run and are only valid combined with --verify or --upload (since they
default to non-verbose instead of the current preference).
2014-08-19 09:16:47 +02:00
Matthijs Kooijman c0ab536b7b Add Base.selectSerialPort
This method takes care of setting the serial.port preference to the
given value, as well as deriving the serial.port.file preference. This
should prevent duplicate code in the future.

Note that a second copy of this code lives in SerialUploader, but that
doesn't write to the global Preferences but a local prefs map. Since the
global Preferences are currently static, there is no way to share code
between these two copies.
2014-08-19 09:16:46 +02:00
Matthijs Kooijman 7548591d51 Improve commandline handling control flow
This uses a switch on the action value, which makes it more clear what
code runs when. No actual behaviour is changed, most of the changes in
this commit are indentation changes.
2014-08-19 09:16:46 +02:00
Matthijs Kooijman f3565a1bda Invert decision on when to show the GUI
Previously, the code showed an error when the given action was not
upload or verify. This is now reversed: the GUI is shown when the action
is "GUI" (which is the default when no action specified). Since the
action enum only contains these three values, there is no change in
behaviour, but this makes it easier to add new actions later.
2014-08-19 09:16:46 +02:00
Matthijs Kooijman 6a09ee5eb6 Use an "action" enum when processing commandline arguments
Previously, two separate booleans (doUpload and doVerify) were used.
However, since it always makes sense to specify only one of them, it
makes more sense to keep a single action enum variable, which slightly
simplifies the code (especially when more actions are added later).

Additionally, an error is now shown when both --verify and --upload are
specified on the commandline.
2014-08-19 09:16:46 +02:00
Cristian Maglie 11cfe2b81e Updated eclipse project classpath 2014-08-18 16:09:03 +02:00
Cristian Maglie a6c80364da FileUtils: added function to recursively find files with given extension 2014-08-08 15:01:53 +02:00
Cristian Maglie 7819374955 Removed unused variables 2014-08-08 15:01:53 +02:00
Cristian Maglie dcc1020a6e Better check for programmers configuration when uploading using programmer 2014-08-06 15:20:53 +02:00
Cristian Maglie 1a167b7a6f Allow to run empty recipes in platform.txt 2014-07-28 18:40:53 +02:00
Cristian Maglie 82401c84bb Fix indent and typos on FindReplace.java 2014-07-25 12:10:42 +02:00
Fulvio Ieva cd75cc24a2 Fix search and replace #2106 2014-07-25 12:01:43 +02:00
Fulvio Ieva 6efbecd3cc Do not replace textbox in Find/Replace dialog if no text is selected
See #2070
2014-07-25 11:56:08 +02:00
Fulvio Ieva 13321e3c1b Change layout in Find/Replace dialog to render correctly on Linux
see #2070
2014-07-25 11:38:34 +02:00
Fulvio Ieva 064fc45ba5 Merge branch 'feature/Search_and_replace_improved_dialog' of github.com:eried/Arduino into eried-feature/Search_and_replace_improved_dialog 2014-07-25 11:34:54 +02:00
Cristian Maglie b36beeb4c0 Fixed NullPointerException with i18n.
i18n class may not be initialized during init time.
2014-07-03 13:01:18 +02:00
Cristian Maglie 2a71073c32 Re-enabled serial port detection on Windows
Fixes #1573
2014-07-02 13:20:16 +02:00
Cristian Maglie e5f34e5a83 Merge branch 'ide-1.5.x-timer-variant' of github.com:matthijskooijman/Arduino into matthijskooijman-ide-1.5.x-timer-variant 2014-07-01 18:29:07 +02:00