Skip to content

Commit c3d22bb

Browse files
committed
Merge pull request #1 from arduino/master
Update from original
2 parents c28e6b2 + c5824fd commit c3d22bb

File tree

1,122 files changed

+99039
-318321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,122 files changed

+99039
-318321
lines changed

.classpath

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<classpathentry excluding="processing/app/tools/format/|processing/app/tools/format/src/|processing/app/Trace.java|processing/app/RunnerClassLoader.java" kind="src" path="app/src"/>
44
<classpathentry kind="src" path="app/test"/>
55
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6-
<classpathentry kind="lib" path="app/lib/antlr.jar"/>
76
<classpathentry kind="lib" path="app/lib/apple.jar"/>
87
<classpathentry kind="lib" path="app/lib/ecj.jar"/>
98
<classpathentry kind="lib" path="app/test-lib/junit-4.11.jar"/>
@@ -16,15 +15,16 @@
1615
<classpathentry kind="lib" path="app/lib/commons-exec-1.1.jar"/>
1716
<classpathentry kind="lib" path="app/lib/commons-httpclient-3.1.jar"/>
1817
<classpathentry kind="lib" path="app/lib/commons-logging-1.0.4.jar"/>
18+
<classpathentry kind="lib" path="app/lib/commons-net-3.3.jar"/>
1919
<classpathentry kind="lib" path="app/lib/jmdns-3.4.1.jar"/>
2020
<classpathentry kind="lib" path="app/lib/jsch-0.1.50.jar"/>
2121
<classpathentry kind="lib" path="app/lib/jssc-2.8.0.jar"/>
2222
<classpathentry kind="lib" path="app/lib/bcpg-jdk15on-152.jar"/>
2323
<classpathentry kind="lib" path="app/lib/bcprov-jdk15on-152.jar"/>
24-
<classpathentry kind="lib" path="app/lib/jackson-core-2.2.3.jar"/>
25-
<classpathentry kind="lib" path="app/lib/jackson-databind-2.2.3.jar"/>
26-
<classpathentry kind="lib" path="app/lib/jackson-module-mrbean-2.2.3.jar"/>
27-
<classpathentry kind="lib" path="app/lib/jackson-annotations-2.2.3.jar"/>
24+
<classpathentry kind="lib" path="app/lib/jackson-core-2.6.3.jar"/>
25+
<classpathentry kind="lib" path="app/lib/jackson-databind-2.6.3.jar"/>
26+
<classpathentry kind="lib" path="app/lib/jackson-module-mrbean-2.6.3.jar"/>
27+
<classpathentry kind="lib" path="app/lib/jackson-annotations-2.6.3.jar"/>
2828
<classpathentry kind="lib" path="app/lib/commons-compress-1.8.jar"/>
2929
<classpathentry combineaccessrules="false" kind="src" path="/arduino-core"/>
3030
<classpathentry kind="output" path="app/bin"/>

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ hardware/arduino/bootloaders/caterina_LUFA/Caterina.elf
1414
hardware/arduino/bootloaders/caterina_LUFA/Caterina.eep
1515
hardware/arduino/bootloaders/caterina_LUFA/.dep/
1616
build/*.zip
17+
build/*.tar.bz2
1718
build/windows/work/
1819
build/windows/*.zip
1920
build/windows/*.tgz
@@ -33,7 +34,7 @@ build/macosx/libastylej*
3334
build/macosx/appbundler*.jar
3435
build/macosx/appbundler*.zip
3536
build/macosx/appbundler
36-
build/macosx/appbundler-1.0ea-arduino3
37+
build/macosx/appbundler-1.0ea-arduino?
3738
build/macosx/appbundler-1.0ea-arduino*.zip
3839
build/macosx/appbundler-1.0ea-upstream*.zip
3940
build/linux/work/

README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ IDE can be downloaded for free at http://www.arduino.cc/en/Main/Software
1010

1111
* For more information, see the website at: http://www.arduino.cc/
1212
or the forums at: http://www.arduino.cc/forum/
13-
You can also follow Arduino on twitter at: https://twitter.com/arduino or like Arduino on Facebook at: https://www.facebook.com/official.arduino
13+
You can also follow Arduino on twitter at: https://twitter.com/arduino or
14+
like Arduino on Facebook at: https://www.facebook.com/official.arduino
1415

1516
* To report a *bug* in the software or to request *a simple enhancement* go to:
1617
http://github.com/arduino/Arduino/issues
@@ -35,11 +36,18 @@ Credits
3536
--------
3637
Arduino is an open source project, supported by many.
3738

38-
The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe,
39-
Gianluca Martino, Daniela Antonietti, and David A. Mellis.
40-
41-
Arduino uses the [GNU avr-gcc toolchain](http://gcc.gnu.org/wiki/avr-gcc), [avrdude](http://www.nongnu.org/avrdude/), [avr-libc](http://www.nongnu.org/avr-libc/), and code from
42-
[Processing](http://www.processing.org) and [Wiring](http://wiring.org.co).
39+
The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe
40+
and David A. Mellis.
41+
42+
Arduino uses
43+
[GNU avr-gcc toolchain](http://gcc.gnu.org/wiki/avr-gcc),
44+
[GCC ARM Embedded toolchain](https://launchpad.net/gcc-arm-embedded),
45+
[avr-libc](http://www.nongnu.org/avr-libc/),
46+
[avrdude](http://www.nongnu.org/avrdude/),
47+
[bossac](http://www.shumatech.com/web/products/bossa),
48+
[openOCD](http://openocd.org/)
49+
and code from [Processing](http://www.processing.org)
50+
and [Wiring](http://wiring.org.co).
4351

4452
Icon and about image designed by [ToDo](http://www.todo.to.it/)
4553

app/.classpath

+6-8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<classpathentry excluding="processing/app/tools/format/" kind="src" path="src"/>
44
<classpathentry kind="src" path="test"/>
55
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
6-
<classpathentry kind="lib" path="lib/antlr.jar"/>
7-
<classpathentry kind="lib" path="lib/ecj.jar"/>
86
<classpathentry kind="lib" path="lib/apple.jar"/>
97
<classpathentry kind="lib" path="lib/bcpg-jdk15on-152.jar"/>
108
<classpathentry kind="lib" path="lib/bcprov-jdk15on-152.jar"/>
@@ -13,10 +11,11 @@
1311
<classpathentry kind="lib" path="lib/commons-exec-1.1.jar"/>
1412
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
1513
<classpathentry kind="lib" path="lib/commons-logging-1.0.4.jar"/>
16-
<classpathentry kind="lib" path="lib/jackson-annotations-2.2.3.jar"/>
17-
<classpathentry kind="lib" path="lib/jackson-core-2.2.3.jar"/>
18-
<classpathentry kind="lib" path="lib/jackson-databind-2.2.3.jar"/>
19-
<classpathentry kind="lib" path="lib/jackson-module-mrbean-2.2.3.jar"/>
14+
<classpathentry kind="lib" path="lib/commons-net-3.3.jar"/>
15+
<classpathentry kind="lib" path="lib/jackson-annotations-2.6.3.jar"/>
16+
<classpathentry kind="lib" path="lib/jackson-core-2.6.3.jar"/>
17+
<classpathentry kind="lib" path="lib/jackson-databind-2.6.3.jar"/>
18+
<classpathentry kind="lib" path="lib/jackson-module-mrbean-2.6.3.jar"/>
2019
<classpathentry kind="lib" path="lib/jmdns-3.4.1.jar"/>
2120
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>
2221
<classpathentry kind="lib" path="lib/jssc-2.8.0.jar"/>
@@ -28,8 +27,7 @@
2827
<classpathentry combineaccessrules="false" kind="src" path="/arduino-core"/>
2928
<classpathentry kind="lib" path="test-lib/jcip-annotations-1.0.jar"/>
3029
<classpathentry kind="lib" path="lib/commons-lang3-3.3.2.jar"/>
31-
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>
3230
<classpathentry kind="lib" path="lib/java-semver-0.8.0.jar"/>
33-
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.5.7.1+arduino.jar"/>
31+
<classpathentry kind="lib" path="lib/rsyntaxtextarea-2.5.8.1+arduino.jar"/>
3432
<classpathentry kind="output" path="bin"/>
3533
</classpath>

app/.classpath_macosx

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<classpathentry combineaccessrules="false" kind="src" path="/pdf"/>
1414
<classpathentry combineaccessrules="false" kind="src" path="/serial"/>
1515
<classpathentry combineaccessrules="false" kind="src" path="/video"/>
16-
<classpathentry kind="lib" path="lib/antlr.jar"/>
1716
<classpathentry kind="lib" path="lib/ecj.jar"/>
1817
<classpathentry kind="output" path="bin"/>
1918
</classpath>

app/build.xml

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
<fileset dir="test" includes="**/*.json*" />
103103
<fileset dir="test" includes="**/*.key" />
104104
<fileset dir="test" includes="**/*.hex" />
105+
<fileset dir="test" includes="**/*.pac" />
105106
</copy>
106107

107108
<junit printsummary="yes" dir="${work.dir}" fork="true">

app/lib/antlr-2.7.7.LICENSE.PUBLIC-DOMAIN.txt

Whitespace-only changes.

app/lib/antlr.jar

-433 KB
Binary file not shown.

app/lib/commons-net-3.3.jar

274 KB
Binary file not shown.

app/lib/guava-18.0.LICENSE.ASL-2.0.txt renamed to app/lib/commons-net.LICENSE.ASL-2.0.txt

-1
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,3 @@
200200
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201201
See the License for the specific language governing permissions and
202202
limitations under the License.
203-

app/lib/ecj.LICENSE.EPL-1.0.txt

Whitespace-only changes.

app/lib/ecj.jar

-1.57 MB
Binary file not shown.

app/lib/guava-18.0.jar

-2.15 MB
Binary file not shown.

app/lib/jackson-annotations-2.2.3.jar

-32.7 KB
Binary file not shown.

app/lib/jackson-annotations-2.6.3.jar

45.9 KB
Binary file not shown.

app/lib/jackson-core-2.2.3.jar

-188 KB
Binary file not shown.

app/lib/jackson-core-2.6.3.jar

253 KB
Binary file not shown.

app/lib/jackson-databind-2.2.3.jar

-846 KB
Binary file not shown.

app/lib/jackson-databind-2.6.3.jar

1.12 MB
Binary file not shown.
-67.3 KB
Binary file not shown.
78 KB
Binary file not shown.

app/src/cc/arduino/ConsoleOutputStream.java

+18-41
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
import javax.swing.*;
4242
import javax.swing.text.BadLocationException;
43-
import javax.swing.text.Document;
4443
import javax.swing.text.SimpleAttributeSet;
4544
import java.io.ByteArrayOutputStream;
4645
import java.io.PrintStream;
@@ -55,70 +54,48 @@ public class ConsoleOutputStream extends ByteArrayOutputStream {
5554

5655
private final SimpleAttributeSet attributes;
5756
private final PrintStream printStream;
58-
private final StringBuilder buffer;
5957
private final Timer timer;
60-
private JScrollPane scrollPane;
61-
private Document document;
58+
59+
private volatile EditorConsole editorConsole;
60+
private volatile boolean newLinePrinted;
6261

6362
public ConsoleOutputStream(SimpleAttributeSet attributes, PrintStream printStream) {
6463
this.attributes = attributes;
6564
this.printStream = printStream;
66-
this.buffer = new StringBuilder();
65+
this.newLinePrinted = false;
6766

68-
this.timer = new Timer(100, (e) -> {
69-
if (scrollPane != null) {
70-
synchronized (scrollPane) {
71-
scrollPane.getHorizontalScrollBar().setValue(0);
72-
scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum());
73-
}
67+
this.timer = new Timer(500, (e) -> {
68+
if (editorConsole != null && newLinePrinted) {
69+
editorConsole.scrollDown();
70+
newLinePrinted = false;
7471
}
7572
});
7673
timer.setRepeats(false);
7774
}
7875

79-
public synchronized void setCurrentEditorConsole(EditorConsole console) {
80-
this.scrollPane = console;
81-
this.document = console.getDocument();
76+
public void setCurrentEditorConsole(EditorConsole console) {
77+
this.editorConsole = console;
8278
}
8379

8480
public synchronized void flush() {
85-
String message = toString();
81+
String text = toString();
8682

87-
if (message.length() == 0) {
83+
if (text.length() == 0) {
8884
return;
8985
}
9086

91-
handleAppend(message);
87+
printStream.print(text);
88+
printInConsole(text);
9289

9390
reset();
9491
}
9592

96-
private void handleAppend(String message) {
97-
resetBufferIfDocumentEmpty();
98-
99-
buffer.append(message);
100-
101-
clearBuffer();
102-
}
103-
104-
private void resetBufferIfDocumentEmpty() {
105-
if (document != null && document.getLength() == 0) {
106-
buffer.setLength(0);
107-
}
108-
}
109-
110-
private void clearBuffer() {
111-
String line = buffer.toString();
112-
buffer.setLength(0);
113-
114-
printStream.print(line);
115-
116-
if (document != null) {
93+
private void printInConsole(String text) {
94+
newLinePrinted = newLinePrinted || text.contains("\n");
95+
if (editorConsole != null) {
11796
SwingUtilities.invokeLater(() -> {
11897
try {
119-
String lineWithoutSlashR = line.replace("\r\n", "\n").replace("\r", "\n");
120-
int offset = document.getLength();
121-
document.insertString(offset, lineWithoutSlashR, attributes);
98+
editorConsole.insertString(text, attributes);
12299
} catch (BadLocationException ble) {
123100
//ignore
124101
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* This file is part of Arduino.
3+
*
4+
* Arduino is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*
18+
* As a special exception, you may use this file as part of a free software
19+
* library without restriction. Specifically, if other files instantiate
20+
* templates or use macros or inline functions from this file, or you compile
21+
* this file and link it with other files to produce an executable, this
22+
* file does not by itself cause the resulting executable to be covered by
23+
* the GNU General Public License. This exception does not however
24+
* invalidate any other reasons why the executable file might be covered by
25+
* the GNU General Public License.
26+
*
27+
* Copyright 2015 Arduino LLC (http://www.arduino.cc/)
28+
*/
29+
30+
package cc.arduino;
31+
32+
import processing.app.Base;
33+
34+
import javax.swing.event.HyperlinkEvent;
35+
import javax.swing.event.HyperlinkListener;
36+
import java.net.URL;
37+
38+
public class UpdatableBoardsLibsFakeURLsHandler implements HyperlinkListener {
39+
40+
private static final String BOARDSMANAGER = "boardsmanager";
41+
private static final String LIBRARYMANAGER = "librarymanager";
42+
43+
private final Base base;
44+
45+
public UpdatableBoardsLibsFakeURLsHandler(Base base) {
46+
this.base = base;
47+
}
48+
49+
@Override
50+
public void hyperlinkUpdate(HyperlinkEvent event) {
51+
if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
52+
return;
53+
}
54+
55+
URL url = event.getURL();
56+
57+
if (BOARDSMANAGER.equals(url.getHost())) {
58+
try {
59+
base.openBoardsManager("", "DropdownUpdatableCoresItem");
60+
} catch (Exception e) {
61+
e.printStackTrace();
62+
}
63+
return;
64+
}
65+
66+
if (LIBRARYMANAGER.equals(url.getHost())) {
67+
base.openLibraryManager("DropdownUpdatableLibrariesItem");
68+
return;
69+
}
70+
71+
throw new IllegalArgumentException(url.getHost() + " is invalid");
72+
}
73+
74+
}

app/src/cc/arduino/contributions/BuiltInCoreIsNewerCheck.java

+9-13
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,17 @@
3333
import cc.arduino.contributions.filters.InstalledPredicate;
3434
import cc.arduino.contributions.packages.ContributedPackage;
3535
import cc.arduino.contributions.packages.ContributedPlatform;
36-
import cc.arduino.view.Event;
37-
import com.google.common.collect.Collections2;
38-
import com.google.common.collect.Iterables;
39-
import com.google.common.collect.Lists;
4036
import processing.app.Base;
4137
import processing.app.BaseNoGui;
4238
import processing.app.I18n;
4339
import processing.app.PreferencesData;
4440

4541
import javax.swing.*;
46-
import java.awt.event.ActionEvent;
47-
import java.util.LinkedList;
42+
import java.util.Collection;
4843
import java.util.List;
4944
import java.util.stream.Collectors;
5045

51-
import static processing.app.I18n._;
46+
import static processing.app.I18n.tr;
5247

5348
public class BuiltInCoreIsNewerCheck implements Runnable {
5449

@@ -72,7 +67,7 @@ private void builtInPackageIsNewerCheck() throws InterruptedException {
7267
return;
7368
}
7469

75-
LinkedList<ContributedPlatform> contributedPlatforms = Lists.newLinkedList(Iterables.concat(Collections2.transform(BaseNoGui.indexer.getPackages(), ContributedPackage::getPlatforms)));
70+
List<ContributedPlatform> contributedPlatforms = BaseNoGui.indexer.getPackages().stream().map(ContributedPackage::getPlatforms).flatMap(Collection::stream).collect(Collectors.toList());
7671

7772
List<ContributedPlatform> installedBuiltInPlatforms = contributedPlatforms.stream().filter(new InstalledPredicate()).filter(new BuiltInPredicate()).collect(Collectors.toList());
7873
if (installedBuiltInPlatforms.size() != 1) {
@@ -93,12 +88,13 @@ private void builtInPackageIsNewerCheck() throws InterruptedException {
9388
SwingUtilities.invokeLater(() -> {
9489
PreferencesData.setInteger("builtin_platform_is_newer", BaseNoGui.REVISION);
9590
assert base.hasActiveEditor();
96-
int chosenOption = JOptionPane.showConfirmDialog(base.getActiveEditor(), I18n.format(_("The IDE includes an updated {0} package, but you're using an older one.\nDo you want to upgrade {0}?"), installedBuiltIn.getName()), I18n.format(_("A newer {0} package is available"), installedBuiltIn.getName()), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
91+
int chosenOption = JOptionPane.showConfirmDialog(base.getActiveEditor(), I18n.format(tr("The IDE includes an updated {0} package, but you're using an older one.\nDo you want to upgrade {0}?"), installedBuiltIn.getName()), I18n.format(tr("A newer {0} package is available"), installedBuiltIn.getName()), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
9792
if (chosenOption == JOptionPane.YES_OPTION) {
98-
Action openBoardsManager = base.getOpenBoardsManager();
99-
Event event = new Event(base.getActiveEditor(), ActionEvent.ACTION_PERFORMED, installedBuiltIn.getName());
100-
event.getPayload().put("filterText", installedBuiltIn.getName());
101-
openBoardsManager.actionPerformed(event);
93+
try {
94+
base.openBoardsManager(installedBuiltIn.getName(), "");
95+
} catch (Exception e) {
96+
e.printStackTrace();
97+
}
10298
}
10399
});
104100
}

0 commit comments

Comments
 (0)