1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00
Commit Graph

866 Commits

Author SHA1 Message Date
Cristian Maglie
931c2b7f21 Do not translate labels of boards submenus
Otherwise it may happen some weird sorting when untraslated and
translated labels are sorted together:

    Arduino megaAVR Boards
    Arduino nRF52 Board
    ESP32 Arduino
    ESP8266 Modules
    Schede Arduino AVR   <-- the localized string falls to the bottom

Also there is no way for 3rd party boards developers to actually provide
a translation, so let's just remove them.
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
a1d6da9dfe Prevent bytes from lingering in the serial buffer
This fixes a problem with the Serial UTF-8 decoder. This decoding moves
data from char[] buf, into a ByteBuffer inFromSerial, then decodes them
into a CharBuffer outToMessage and converts to a char[] to pass on.

When the buf read contained just over a full buffer worth of bytes and
contained some multi-byte characters, a situation could arise where two
decodes were needed to fill up outToMessage, leaving some data in
inFromSerial. If in this case no data would be left in buf, decoding
would stop until more data came in from serial.

This commit fixes this problem by:
 - Changing the outer loop to continue running when buf is empty, but
   inFromSerial is not.
 - Changing the inner loop to run at least once (so it runs when buf is
   empty, but inFromSerial is no).
 - Breaking out of the outer loop when no characters were produced (this
   handles the case where only an incomplete UTF-8 character remains in
   inFromSerial, which would otherwise prevent the loop from
   terminating.
 - Removes a `if (outToMessage.hasRemaining()` check that is now
   necessarily true if the break was not done.

This fixes #9808.
2020-03-24 15:24:50 +01:00
Matthijs Kooijman
d244a45c4a Use Math.min instead of ternary if in Serial data copy
This makes the code slightly more compact and easier to read.
2020-03-24 15:24:50 +01:00
Cristian Maglie
d6667dd4ca Added unit testing for UTF8 decoder in Serial 2020-03-24 15:24:50 +01:00
Cristian Maglie
bc54dd8ef5 SerialDiscovery: reorder a bit the discovery phases to make it clearer 2020-03-23 18:37:59 +01:00
Cristian Maglie
8208376507 SerialDiscovery: refactor search loop 2020-03-23 18:37:59 +01:00
Martino Facchin
d154120f0e Fix bogus port disconnection during serial event
Fixes https://github.com/arduino/Arduino/issues/9785 and probably many others

This commit strongly simplyfies the serial list code

Pluggable discovery introduced a bug since BoardPort.toString() started reporting only the name of the port, not the complete name_vid_pid needed to match liblistserial output.
Adding .toCompleteString() almost solves the bogus disconnection part alone, but resolveDeviceByVendorIdProductId() uses "0x" prefixes VID/PID, breaking it again.

In addition, all the logic used to match a board with its bootloader (to obtain a serial number on 32u4 boards) has been completely removed since it is currently useless (and unused).
2020-03-23 17:37:01 +01:00
Cristian Maglie
fcb53ba6e1 Fixed user/pass preferences save for "manual" proxy settings.
There was an error in the following constants:

  PREF_PROXY_AUTO_USERNAME = "proxy.manual.username"
  PREF_PROXY_AUTO_PASSWORD = "proxy.manual.password"

they should be set to "auto" and not "manual":

  PREF_PROXY_AUTO_USERNAME = "proxy.auto.username"
  PREF_PROXY_AUTO_PASSWORD = "proxy.auto.password"

Changing the constants to the correct value now will fix the problem for
future installations of the IDE but will produce an annoying side-effect
for users upgrading from previous version of the IDE: they will lose
their saved user and pass (because it was saved as "proxy.manual.*")
and the IDE will suddenly stop working without any clear reason.

To avoid this I've left the value to "proxy.manual.*" and removed
the distinction from AUTO and MANUAL, so now we have only:

  PREF_PROXY_USERNAME = "proxy.manual.username"
  PREF_PROXY_PASSWORD = "proxy.manual.password"

The corresponding textbox in the preference dialog will be filled based on
the PROXY_TYPE selection.
2020-03-06 18:55:50 +01:00
Thomas L. Kjeldsen
b40f54af06 Declare fields at the top of the class
Improve Codacy PR quality requirements:
Fields should be declared at the top of the class, before any method
declarations, constructors, initializers or inner classes.
2020-02-19 15:13:47 +01:00
Thomas L. Kjeldsen
488388050e Remove "MrBean" dependency
Sacrifice abstract classes and interfaces to reduce the amount of magic
performed by MrBean.

Refs https://github.com/HuayraLinux/pkg-arduino/issues/4
2020-02-19 15:13:47 +01:00
Cristian Maglie
15133a0720 Starting Arduino IDE 1.8.13 2020-02-14 15:29:26 +01:00
per1234
33ff49566c Start Arduino IDE 1.8.12 2020-02-07 23:16:20 +01:00
Cristian Maglie
b59c91ebe2 Fixed failures in download tests 2020-02-06 16:04:39 +01:00
Matthijs Kooijman
3d4b026b50 Preserve "fatal" in compiler errors
When transforming compiler errors (to make filenames more friendly), it
would match "fatal error" or "error" but then always reconstruct as
"error", modifying the compiler error in a way that is not intended.

This commit fixes that, as well as the previous hardcoding of the
"error: " prefix when rebuilding the error message, by capturing this
entire prefix and simply reproducing it in the resulting error message.
2020-01-29 19:38:03 +01:00
Matthijs Kooijman
e387c23b60 Slightly simplify error message rebuilding
This removes some duplicate code for with and without column number by
building the column number string separately first.
2020-01-29 19:04:43 +01:00
Matthijs Kooijman
8e9f7a630a Fix exception on compiler errors with column numbers
Error messages are detected and parsed using a regex. Part of this regex
matches the optional column number.

The code that handled this assumed that a missing column would result in
less elements in the matches array, but a regex always results in one
element per set of parenthesis in the regex, which will be null if no
capture was made for that element.

In practice, this meant that if no column was present in the error
message, a NullPointerException would be raised. Furthermore, gcc 9
seems to have started outputting omitting column numbers (instead of
printing 0) for some errors (such as unterminated #ifdef), which exposed
this problem.

This commit fixes this by simply using the fixed match numbers to take
apart the regex match, and by checking for a null column number (all
other captures are non-optional, so no need to check there).
2020-01-29 19:04:43 +01:00
Cristian Maglie
113c56d657 Even stricter sanity checks 2020-01-21 14:39:02 +01:00
Cristian Maglie
b811689e97 Improved sanity checks on filenames in package_index.json 2020-01-21 14:39:02 +01:00
PaulStoffregen
0f5d22c67c Allow Pluggable Discovery recipes to use {runtime.platform.path} 2020-01-21 11:35:18 +01:00
Cristian Maglie
ff26dd58f8 Updated translations from transifex 2020-01-20 15:59:26 +01:00
Martino Facchin
6116a8e920 Starting 1.8.11 2019-09-19 12:54:30 +02:00
Cristian Maglie
0ce5e1ea02 Updated translations 2019-09-13 12:13:14 +02:00
Cristian Maglie
6179b15449 Force python2 when running Transifex updates 2019-09-13 12:13:04 +02:00
Cristian Maglie
5bb9f87fae Do not fail abruptly if signature verification fails
If the package_index.json signature is not valid, a dialog box asking
the user to "update" the index is shown. Previously a java-exception
was printed if running from terminal or the IDE would not start at
all (with no apparent reason) if lanched from GUI.
2019-08-20 18:01:58 +02:00
Cristian Maglie
842c35be3e Added warning about forcing untrusted contributions 2019-08-20 17:06:36 +02:00
Mattia Bertorello
94dd695355 Add areInsecurePackagesAllowed method 2019-08-20 17:06:36 +02:00
Mattia Bertorello
76852465d2 Add the copy the sig to the destination file when the skip verification is true 2019-08-20 17:06:36 +02:00
Mattia Bertorello
df5a52407e Add PREF_CONTRIBUTIONS_TRUST_ALL and download the signature in any case 2019-08-20 17:06:36 +02:00
Cristian Maglie
da6c73102f fixed comment 2019-08-02 11:52:15 +02:00
Mattia Bertorello
01d3d02a0f Use the BoardCloudResolver instead of the Platform class to get cloud vid pid 2019-08-02 11:48:07 +02:00
Mattia Bertorello
bcb8e90534 Remove getBoardWithMatchingVidPidFromCloud and make a new class BoardCloudResolver 2019-08-02 11:48:07 +02:00
Martino Facchin
adabb08390 NetworkUpload. use ipAddress to start jSch session
Fixes #9097
2019-07-30 10:26:03 +02:00
Mattia Bertorello
f0722843f6 Add logging 2019-07-23 09:49:55 +02:00
Mattia Bertorello
dd1d713d19 Fix condition when the file is not expire but the lastETag is changed 2019-07-23 09:49:55 +02:00
Cristian Maglie
dcee1846bd Updated eclipse classpath 2019-07-18 14:24:59 +02:00
Huang Rui
c88ff311f1 Support .tar.xz for ArchiveExtractor
Now ```tar.xz``` format is widely used, and the official arduino
IDE download URL also shows that arduino uses ```tar.xz``` format.
(https://downloads.arduino.cc/arduino-1.8.9-linux64.tar.xz).

As we all know, the tar.xz format has the optimal size compared to tar,
tar.gz, tar.bz2, and zip.
(https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/)

Therefore, it is very unreasonable not to support tar.xz.

Supporting this format can save almost half of the bandwidth resources
and download time when compressing the gcc toolchain,
making users more comfortable.

Signed-off-by: Huang Rui <vowstar@gmail.com>
2019-07-18 12:16:27 +02:00
Martino Facchin
9ce5101df1
Merge branch 'master' into add-file-cache 2019-07-18 11:28:46 +02:00
Pieter12345
9aea65bee6 Use user-defined tab settings in new sketch generation
When creating a new sketch, it is initialized with the BareMinimum example sketch. This example sketch uses 2-width whitespace indentation, which might differ from the user-defined tab settings. This commit makes the generated example sketch consistent with the user-defined tab settings.
2019-07-18 10:40:19 +02:00
Cristian Maglie
4dc5176c0f Fix some linter suggestions 2019-07-18 10:37:36 +02:00
Cristian Maglie
745cb01ed5 Better names for ContributedLibrary dependencies fields 2019-07-18 10:37:36 +02:00
Cristian Maglie
492553cde0 When resolving dependencies consider installed contributions first
Consider a case where the user decides to install a library `A` that
depends on library `B` and `B` is not up-to-date (i.e. is installed a
version that is not the latest), then the user is asked to "install"
both libraries `A` and `B`, effectively upgrading `B`.

With this change the already installed library `B` is left untouched
and not displayed in the missing dependencies.
2019-07-18 10:37:36 +02:00
Cristian Maglie
07e1518b28 Now libraries are installed with all the dependencies
This is the base for the GUI that will be introduced in the
next commits.
2019-07-18 10:37:36 +02:00
Cristian Maglie
67e38bc80a LibraryInstaller now autodetects if a library is being replaced
It's no more required to pass this information from outside,
just library that is being installed is now sufficient.
2019-07-18 10:37:36 +02:00
Cristian Maglie
4266b3a700 Lib installer: factored out method to perform lib installation
The new method will be used in next commits to handle installations
of multiple libraries.
This commit fix also minor bug in progress bar.
2019-07-18 10:37:36 +02:00
Cristian Maglie
d6f561bd53 Added library-dependency resolver 2019-07-18 10:37:36 +02:00
Cristian Maglie
1ebdb02954 Added helper methods to compare versions 2019-07-18 10:37:36 +02:00
Cristian Maglie
d72cb2350d Renamed ContributedLibraryReference to ContributedLibraryDependency 2019-07-18 10:37:36 +02:00
Cristian Maglie
894b1abd8a Improved lib equality check 2019-07-18 10:37:36 +02:00
Mattia Bertorello
3c5dbe6f9d
Parse the old library index file also when the signature verify fail 2019-07-18 10:27:20 +02:00
Martino Facchin
ef8d669f6a Don't report an exception if waitForUploadPort fails after successfull upload
Fixes #8851
2019-07-18 10:11:43 +02:00