mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-07 01:54:26 +01:00
Merge remote-tracking branch 'arduino/master' into HEAD
This commit is contained in:
commit
c102995e92
@ -33,14 +33,12 @@ import cc.arduino.contributions.filters.BuiltInPredicate;
|
|||||||
import cc.arduino.contributions.filters.InstalledPredicate;
|
import cc.arduino.contributions.filters.InstalledPredicate;
|
||||||
import cc.arduino.contributions.packages.ContributedPackage;
|
import cc.arduino.contributions.packages.ContributedPackage;
|
||||||
import cc.arduino.contributions.packages.ContributedPlatform;
|
import cc.arduino.contributions.packages.ContributedPlatform;
|
||||||
import cc.arduino.view.Event;
|
|
||||||
import processing.app.Base;
|
import processing.app.Base;
|
||||||
import processing.app.BaseNoGui;
|
import processing.app.BaseNoGui;
|
||||||
import processing.app.I18n;
|
import processing.app.I18n;
|
||||||
import processing.app.PreferencesData;
|
import processing.app.PreferencesData;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -48,7 +48,13 @@ import static processing.app.I18n.tr;
|
|||||||
public class Preferences extends javax.swing.JDialog {
|
public class Preferences extends javax.swing.JDialog {
|
||||||
|
|
||||||
private final Language[] languages;
|
private final Language[] languages;
|
||||||
|
|
||||||
|
// Languages that are not translated at least to 65% are
|
||||||
|
// kept in the "missingLanguages" array until they have enough
|
||||||
|
// translated strings.
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final Language[] missingLanguages;
|
private final Language[] missingLanguages;
|
||||||
|
|
||||||
private final WarningItem[] warningItems;
|
private final WarningItem[] warningItems;
|
||||||
private final Base base;
|
private final Base base;
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import java.awt.event.WindowEvent;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public abstract class AbstractMonitor extends JFrame implements ActionListener {
|
public abstract class AbstractMonitor extends JFrame implements ActionListener {
|
||||||
|
|
||||||
private boolean monitorEnabled;
|
|
||||||
private boolean closed;
|
private boolean closed;
|
||||||
|
|
||||||
private StringBuffer updateBuffer;
|
private StringBuffer updateBuffer;
|
||||||
@ -78,7 +77,6 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
|
|||||||
updateTimer = new Timer(33, this); // redraw serial monitor at 30 Hz
|
updateTimer = new Timer(33, this); // redraw serial monitor at 30 Hz
|
||||||
updateTimer.start();
|
updateTimer.start();
|
||||||
|
|
||||||
monitorEnabled = true;
|
|
||||||
closed = false;
|
closed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +84,6 @@ public abstract class AbstractMonitor extends JFrame implements ActionListener {
|
|||||||
|
|
||||||
public void enableWindow(boolean enable) {
|
public void enableWindow(boolean enable) {
|
||||||
onEnableWindow(enable);
|
onEnableWindow(enable);
|
||||||
monitorEnabled = enable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void onEnableWindow(boolean enable);
|
protected abstract void onEnableWindow(boolean enable);
|
||||||
|
@ -748,7 +748,7 @@ public class Base {
|
|||||||
try {
|
try {
|
||||||
File file = createNewUntitled();
|
File file = createNewUntitled();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
Editor editor = handleOpen(file, true);
|
handleOpen(file, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -24,13 +24,10 @@ package processing.app;
|
|||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
|
||||||
import processing.app.helpers.OSUtils;
|
import processing.app.helpers.OSUtils;
|
||||||
import processing.app.helpers.PreferencesMap;
|
import processing.app.helpers.PreferencesMap;
|
||||||
import processing.app.syntax.SketchTextArea;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,12 +21,8 @@
|
|||||||
|
|
||||||
package processing.app;
|
package processing.app;
|
||||||
|
|
||||||
import processing.app.helpers.PreferencesHelper;
|
|
||||||
import processing.app.helpers.PreferencesMap;
|
import processing.app.helpers.PreferencesMap;
|
||||||
|
|
||||||
import java.awt.*;
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage class for user preferences and environment settings.
|
* Storage class for user preferences and environment settings.
|
||||||
|
@ -34,7 +34,6 @@ import org.junit.Test;
|
|||||||
import processing.app.helpers.SketchTextAreaFixture;
|
import processing.app.helpers.SketchTextAreaFixture;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotEquals;
|
|
||||||
|
|
||||||
public class AutoformatProducesOneUndoActionTest extends AbstractGUITest {
|
public class AutoformatProducesOneUndoActionTest extends AbstractGUITest {
|
||||||
|
|
||||||
|
@ -33,50 +33,55 @@ import org.junit.Test;
|
|||||||
import processing.app.TestHelper;
|
import processing.app.TestHelper;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static processing.app.macosx.SystemProfilerParser.extractVIDAndPID;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
public class SystemProfilerParserTest {
|
public class SystemProfilerParserTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shouldCorrectlyParse() throws Exception {
|
public void shouldCorrectlyParse() throws Exception {
|
||||||
String output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output.txt"));
|
String output = getFileContent("system_profiler_output.txt");
|
||||||
|
assertEquals("0X2341_0X0044", extractVIDAndPID(output, "/dev/cu.usbmodemfa121"));
|
||||||
|
assertEquals("0X2341_0X0044", extractVIDAndPID(output, "/dev/tty.usbmodemfa121"));
|
||||||
|
|
||||||
assertEquals("0X2341_0X0044", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodemfa121"));
|
output = getFileContent("system_profiler_output2.txt");
|
||||||
assertEquals("0X2341_0X0044", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodemfa121"));
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/cu.usbmodemfd131"));
|
||||||
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/tty.usbmodemfd131"));
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output2.txt"));
|
output = getFileContent("system_profiler_output3.txt");
|
||||||
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/cu.usbmodemfd121"));
|
||||||
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/tty.usbmodemfd121"));
|
||||||
|
|
||||||
assertEquals("0X2341_0X8036", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodemfd131"));
|
output = getFileContent("system_profiler_output4.txt");
|
||||||
assertEquals("0X2341_0X8036", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodemfd131"));
|
assertEquals("0X2341_0X0041", extractVIDAndPID(output, "/dev/cu.usbmodem411"));
|
||||||
|
assertEquals("0X2341_0X0041", extractVIDAndPID(output, "/dev/tty.usbmodem411"));
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output3.txt"));
|
output = getFileContent("system_profiler_output5.txt");
|
||||||
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/cu.usbmodem621"));
|
||||||
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/tty.usbmodem621"));
|
||||||
|
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodemfd121"));
|
output = getFileContent("system_profiler_output6.txt");
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodemfd121"));
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/cu.usbmodem1421"));
|
||||||
|
assertEquals("0X2341_0X8041", extractVIDAndPID(output, "/dev/tty.usbmodem1421"));
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output4.txt"));
|
output = getFileContent("system_profiler_output7.txt");
|
||||||
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/cu.usbmodem24131"));
|
||||||
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/tty.usbmodem24131"));
|
||||||
|
assertEquals("0X0403_0X6015", extractVIDAndPID(output, "/dev/cu.usbserial-DN0031EV"));
|
||||||
|
assertEquals("0X0403_0X6015", extractVIDAndPID(output, "/dev/tty.usbserial-DN0031EV"));
|
||||||
|
|
||||||
assertEquals("0X2341_0X0041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodem411"));
|
output = getFileContent("system_profiler_output8.txt");
|
||||||
assertEquals("0X2341_0X0041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodem411"));
|
assertEquals("0X03EB_0X2157", extractVIDAndPID(output, "/dev/tty.usbmodemfd132"));
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output5.txt"));
|
// OSX El Capitan
|
||||||
|
output = getFileContent("system_profiler_output9.txt");
|
||||||
|
assertEquals("0X2341_0X8036", extractVIDAndPID(output, "/dev/tty.usbmodemFA121"));
|
||||||
|
}
|
||||||
|
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodem621"));
|
private String getFileContent(String filename) throws IOException {
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodem621"));
|
InputStream resource = SystemProfilerParserTest.class.getResourceAsStream(filename);
|
||||||
|
return TestHelper.inputStreamToString(resource);
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output6.txt"));
|
|
||||||
|
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodem1421"));
|
|
||||||
assertEquals("0X2341_0X8041", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodem1421"));
|
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output7.txt"));
|
|
||||||
|
|
||||||
assertEquals("0X2341_0X8036", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbmodem24131"));
|
|
||||||
assertEquals("0X2341_0X8036", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodem24131"));
|
|
||||||
assertEquals("0X0403_0X6015", new SystemProfilerParser().extractVIDAndPID(output, "/dev/cu.usbserial-DN0031EV"));
|
|
||||||
assertEquals("0X0403_0X6015", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbserial-DN0031EV"));
|
|
||||||
|
|
||||||
output = TestHelper.inputStreamToString(SystemProfilerParserTest.class.getResourceAsStream("system_profiler_output8.txt"));
|
|
||||||
|
|
||||||
assertEquals("0X03EB_0X2157", new SystemProfilerParser().extractVIDAndPID(output, "/dev/tty.usbmodemfd132"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
117
app/test/processing/app/macosx/system_profiler_output9.txt
Normal file
117
app/test/processing/app/macosx/system_profiler_output9.txt
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
USB:
|
||||||
|
|
||||||
|
USB 2.0 Bus:
|
||||||
|
|
||||||
|
Host Controller Driver: AppleUSBEHCIPCI
|
||||||
|
PCI Device ID: 0x1c2d
|
||||||
|
PCI Revision ID: 0x0005
|
||||||
|
PCI Vendor ID: 0x8086
|
||||||
|
|
||||||
|
Hub:
|
||||||
|
|
||||||
|
Product ID: 0x2513
|
||||||
|
Vendor ID: 0x0424 (SMSC)
|
||||||
|
Version: b.b3
|
||||||
|
Speed: Up to 480 Mb/sec
|
||||||
|
Location ID: 0xfa100000 / 1
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 2
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
Arduino Leonardo:
|
||||||
|
|
||||||
|
Product ID: 0x8036
|
||||||
|
Vendor ID: 0x2341
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Arduino LLC
|
||||||
|
Location ID: 0xfa120000 / 3
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 500
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
BRCM20702 Hub:
|
||||||
|
|
||||||
|
Product ID: 0x4500
|
||||||
|
Vendor ID: 0x0a5c (Broadcom Corp.)
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Apple Inc.
|
||||||
|
Location ID: 0xfa110000 / 4
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 94
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
Bluetooth USB Host Controller:
|
||||||
|
|
||||||
|
Product ID: 0x8281
|
||||||
|
Vendor ID: 0x05ac (Apple Inc.)
|
||||||
|
Version: 1.51
|
||||||
|
Speed: Up to 12 Mb/sec
|
||||||
|
Manufacturer: Apple Inc.
|
||||||
|
Location ID: 0xfa113000 / 2
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 0
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
USB 2.0 Bus:
|
||||||
|
|
||||||
|
Host Controller Driver: AppleUSBEHCIPCI
|
||||||
|
PCI Device ID: 0x1c26
|
||||||
|
PCI Revision ID: 0x0005
|
||||||
|
PCI Vendor ID: 0x8086
|
||||||
|
|
||||||
|
Hub:
|
||||||
|
|
||||||
|
Product ID: 0x2513
|
||||||
|
Vendor ID: 0x0424 (SMSC)
|
||||||
|
Version: b.b3
|
||||||
|
Speed: Up to 480 Mb/sec
|
||||||
|
Location ID: 0xfd100000 / 1
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 2
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
USB Keyboard:
|
||||||
|
|
||||||
|
Product ID: 0x2000
|
||||||
|
Vendor ID: 0x040b (Weltrend Semiconductor)
|
||||||
|
Version: 2.05
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: Generic
|
||||||
|
Location ID: 0xfd130000 / 4
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
USB OPTICAL MOUSE:
|
||||||
|
|
||||||
|
Product ID: 0x2510
|
||||||
|
Vendor ID: 0x093a (Pixart Imaging, Inc.)
|
||||||
|
Version: 1.00
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: PIXART
|
||||||
|
Location ID: 0xfd120000 / 3
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
|
||||||
|
IR Receiver:
|
||||||
|
|
||||||
|
Product ID: 0x8242
|
||||||
|
Vendor ID: 0x05ac (Apple Inc.)
|
||||||
|
Version: 0.16
|
||||||
|
Speed: Up to 1.5 Mb/sec
|
||||||
|
Manufacturer: Apple Computer, Inc.
|
||||||
|
Location ID: 0xfd110000 / 2
|
||||||
|
Current Available (mA): 1000
|
||||||
|
Current Required (mA): 100
|
||||||
|
Extra Operating Current (mA): 0
|
||||||
|
Built-In: Yes
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,8 +32,6 @@ package processing.app.syntax;
|
|||||||
import org.fife.ui.rsyntaxtextarea.TokenTypes;
|
import org.fife.ui.rsyntaxtextarea.TokenTypes;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import processing.app.AbstractWithPreferencesTest;
|
import processing.app.AbstractWithPreferencesTest;
|
||||||
import processing.app.BaseNoGui;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
|
|
||||||
|
@ -97,13 +97,13 @@ public class GPGDetachedSignatureVerifier extends SignatureVerifier {
|
|||||||
private PGPPublicKey readPublicKey(InputStream input, String keyId) throws IOException, PGPException {
|
private PGPPublicKey readPublicKey(InputStream input, String keyId) throws IOException, PGPException {
|
||||||
PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator());
|
PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator());
|
||||||
|
|
||||||
Iterator keyRingIter = pgpPub.getKeyRings();
|
Iterator<PGPPublicKeyRing> keyRingIter = pgpPub.getKeyRings();
|
||||||
while (keyRingIter.hasNext()) {
|
while (keyRingIter.hasNext()) {
|
||||||
PGPPublicKeyRing keyRing = (PGPPublicKeyRing) keyRingIter.next();
|
PGPPublicKeyRing keyRing = keyRingIter.next();
|
||||||
|
|
||||||
Iterator keyIter = keyRing.getPublicKeys();
|
Iterator<PGPPublicKey> keyIter = keyRing.getPublicKeys();
|
||||||
while (keyIter.hasNext()) {
|
while (keyIter.hasNext()) {
|
||||||
PGPPublicKey key = (PGPPublicKey) keyIter.next();
|
PGPPublicKey key = keyIter.next();
|
||||||
|
|
||||||
if (Long.toHexString(key.getKeyID()).toUpperCase().endsWith(keyId)) {
|
if (Long.toHexString(key.getKeyID()).toUpperCase().endsWith(keyId)) {
|
||||||
return key;
|
return key;
|
||||||
|
@ -33,6 +33,7 @@ import processing.app.I18n;
|
|||||||
|
|
||||||
import static processing.app.I18n.tr;
|
import static processing.app.I18n.tr;
|
||||||
|
|
||||||
|
@SuppressWarnings("serial")
|
||||||
public class SignatureVerificationFailedException extends Exception {
|
public class SignatureVerificationFailedException extends Exception {
|
||||||
|
|
||||||
public SignatureVerificationFailedException(String filename) {
|
public SignatureVerificationFailedException(String filename) {
|
||||||
|
@ -164,7 +164,7 @@ public class ArchiveExtractor {
|
|||||||
while (stripPath > 0) {
|
while (stripPath > 0) {
|
||||||
slash = name.indexOf("/", slash);
|
slash = name.indexOf("/", slash);
|
||||||
if (slash == -1) {
|
if (slash == -1) {
|
||||||
throw new IOException("Invalid archive: it must contains a single root folder");
|
throw new IOException("Invalid archive: it must contain a single root folder");
|
||||||
}
|
}
|
||||||
slash++;
|
slash++;
|
||||||
stripPath--;
|
stripPath--;
|
||||||
@ -174,7 +174,7 @@ public class ArchiveExtractor {
|
|||||||
|
|
||||||
// Strip the common path prefix when requested
|
// Strip the common path prefix when requested
|
||||||
if (!name.startsWith(pathPrefix)) {
|
if (!name.startsWith(pathPrefix)) {
|
||||||
throw new IOException("Invalid archive: it must contains a single root folder while file " + name + " is outside " + pathPrefix);
|
throw new IOException("Invalid archive: it must contain a single root folder while file " + name + " is outside " + pathPrefix);
|
||||||
}
|
}
|
||||||
name = name.substring(pathPrefix.length());
|
name = name.substring(pathPrefix.length());
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
@ -185,7 +185,7 @@ public class ArchiveExtractor {
|
|||||||
File outputLinkedFile = null;
|
File outputLinkedFile = null;
|
||||||
if (isLink) {
|
if (isLink) {
|
||||||
if (!linkName.startsWith(pathPrefix)) {
|
if (!linkName.startsWith(pathPrefix)) {
|
||||||
throw new IOException("Invalid archive: it must contains a single root folder while file " + linkName + " is outside " + pathPrefix);
|
throw new IOException("Invalid archive: it must contain a single root folder while file " + linkName + " is outside " + pathPrefix);
|
||||||
}
|
}
|
||||||
linkName = linkName.substring(pathPrefix.length());
|
linkName = linkName.substring(pathPrefix.length());
|
||||||
outputLinkedFile = new File(destFolder, linkName);
|
outputLinkedFile = new File(destFolder, linkName);
|
||||||
|
@ -53,11 +53,6 @@ public class SketchCode {
|
|||||||
|
|
||||||
private boolean modified;
|
private boolean modified;
|
||||||
|
|
||||||
/**
|
|
||||||
* where this code starts relative to the concat'd code
|
|
||||||
*/
|
|
||||||
private int preprocOffset;
|
|
||||||
|
|
||||||
private Object metadata;
|
private Object metadata;
|
||||||
|
|
||||||
public SketchCode(File file) {
|
public SketchCode(File file) {
|
||||||
@ -190,16 +185,6 @@ public class SketchCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setPreprocOffset(int preprocOffset) {
|
|
||||||
this.preprocOffset = preprocOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void addPreprocOffset(int extra) {
|
|
||||||
preprocOffset += extra;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load this piece of code from a file.
|
* Load this piece of code from a file.
|
||||||
*/
|
*/
|
||||||
|
@ -172,7 +172,7 @@ public class Platform extends processing.app.Platform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String vidPid = new SystemProfilerParser().extractVIDAndPID(devicesListOutput, serial);
|
String vidPid = SystemProfilerParser.extractVIDAndPID(devicesListOutput, serial);
|
||||||
|
|
||||||
if (vidPid == null) {
|
if (vidPid == null) {
|
||||||
return super.resolveDeviceAttachedTo(serial, packages, devicesListOutput);
|
return super.resolveDeviceAttachedTo(serial, packages, devicesListOutput);
|
||||||
|
@ -19,19 +19,12 @@ public class SystemProfilerParser {
|
|||||||
private static final String DEV_TTY_USBMODEM = "/dev/tty.usbmodem";
|
private static final String DEV_TTY_USBMODEM = "/dev/tty.usbmodem";
|
||||||
private static final String DEV_CU_USBMODEM = "/dev/cu.usbmodem";
|
private static final String DEV_CU_USBMODEM = "/dev/cu.usbmodem";
|
||||||
|
|
||||||
private final Pattern vidRegex;
|
private static final Pattern serialNumberRegex = Pattern.compile("^Serial Number: (.+)$");
|
||||||
private final Pattern serialNumberRegex;
|
private static final Pattern locationRegex = Pattern.compile("^Location ID: (.+)$");
|
||||||
private final Pattern locationRegex;
|
private static final Pattern pidRegex = Pattern.compile("^Product ID: (.+)$");
|
||||||
private final Pattern pidRegex;
|
private static final Pattern vidRegex = Pattern.compile("^Vendor ID: (.+)$");
|
||||||
|
|
||||||
public SystemProfilerParser() {
|
public synchronized static String extractVIDAndPID(String output, String serial) throws IOException {
|
||||||
this.serialNumberRegex = Pattern.compile("^Serial Number: (.+)$");
|
|
||||||
this.locationRegex = Pattern.compile("^Location ID: (.+)$");
|
|
||||||
this.pidRegex = Pattern.compile("^Product ID: (.+)$");
|
|
||||||
this.vidRegex = Pattern.compile("^Vendor ID: (.+)$");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String extractVIDAndPID(String output, String serial) throws IOException {
|
|
||||||
BufferedReader reader = new BufferedReader(new StringReader(output));
|
BufferedReader reader = new BufferedReader(new StringReader(output));
|
||||||
|
|
||||||
String devicePrefix;
|
String devicePrefix;
|
||||||
@ -80,7 +73,7 @@ public class SystemProfilerParser {
|
|||||||
String computedDevicePath = device.get(DEVICE_PATH);
|
String computedDevicePath = device.get(DEVICE_PATH);
|
||||||
String computedDevicePathMinusChar = computedDevicePath.substring(0, computedDevicePath.length() - 1);
|
String computedDevicePathMinusChar = computedDevicePath.substring(0, computedDevicePath.length() - 1);
|
||||||
String serialMinusChar = serial.substring(0, serial.length() - 1);
|
String serialMinusChar = serial.substring(0, serial.length() - 1);
|
||||||
if (computedDevicePath.equals(serial) || computedDevicePathMinusChar.equals(serialMinusChar)) {
|
if (computedDevicePath.equalsIgnoreCase(serial) || computedDevicePathMinusChar.equalsIgnoreCase(serialMinusChar)) {
|
||||||
return (device.get(VID) + "_" + device.get(PID)).toUpperCase();
|
return (device.get(VID) + "_" + device.get(PID)).toUpperCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
build/linux/dist/arduino
vendored
23
build/linux/dist/arduino
vendored
@ -3,9 +3,9 @@
|
|||||||
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
|
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
|
||||||
|
|
||||||
for LIB in \
|
for LIB in \
|
||||||
$APPDIR/java/lib/rt.jar \
|
"$APPDIR"/java/lib/rt.jar \
|
||||||
$APPDIR/java/lib/tools.jar \
|
"$APPDIR"/java/lib/tools.jar \
|
||||||
$APPDIR/lib/*.jar \
|
"$APPDIR"/lib/*.jar \
|
||||||
;
|
;
|
||||||
do
|
do
|
||||||
CLASSPATH="${CLASSPATH}:${LIB}"
|
CLASSPATH="${CLASSPATH}:${LIB}"
|
||||||
@ -17,18 +17,19 @@ export LD_LIBRARY_PATH
|
|||||||
|
|
||||||
export PATH="${APPDIR}/java/bin:${PATH}"
|
export PATH="${APPDIR}/java/bin:${PATH}"
|
||||||
|
|
||||||
if [[ "$@" == *"--upload"* || "$@" == *"--verify"* || "$@" == *"--get-pref"* || "$@" == *"--install-board"* || "$@" == *"--install-library"* ]] ; then
|
|
||||||
SPLASH=""
|
|
||||||
else
|
|
||||||
SPLASH="-splash:$APPDIR/lib/splash.png"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`
|
export JAVA_TOOL_OPTIONS=`echo $JAVA_TOOL_OPTIONS | sed 's|-javaagent:/usr/share/java/jayatanaag.jar||g'`
|
||||||
|
|
||||||
JAVA=java
|
JAVA=java
|
||||||
if [ -x $APPDIR/java/bin/java ]; then
|
if [ -x "$APPDIR/java/bin/java" ]; then
|
||||||
JAVA=$APPDIR/java/bin/java
|
JAVA=$APPDIR/java/bin/java
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$JAVA -DAPP_DIR="$APPDIR" -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base "$@"
|
# Collect options to java in an array, to properly handle whitespace in options
|
||||||
|
JAVA_OPTIONS=("-DAPP_DIR=$APPDIR" "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel")
|
||||||
|
|
||||||
|
if [[ "$@" != *"--upload"* && "$@" != *"--verify"* && "$@" != *"--get-pref"* && "$@" != *"--install-board"* && "$@" != *"--install-library"* ]] ; then
|
||||||
|
JAVA_OPTIONS+=("-splash:$APPDIR/lib/splash.png")
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$JAVA" "${JAVA_OPTIONS[@]}" processing.app.Base "$@"
|
||||||
|
|
||||||
|
@ -54,6 +54,11 @@ int HID_::getDescriptor(USBSetup& setup)
|
|||||||
return -1;
|
return -1;
|
||||||
total += res;
|
total += res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset the protocol on reenumeration. Normally the host should not assume the state of the protocol
|
||||||
|
// due to the USB specs, but Windows and Linux just assumes its in report mode.
|
||||||
|
protocol = HID_REPORT_PROTOCOL;
|
||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +145,7 @@ bool HID_::setup(USBSetup& setup)
|
|||||||
|
|
||||||
HID_::HID_(void) : PluggableUSBModule(1, 1, epType),
|
HID_::HID_(void) : PluggableUSBModule(1, 1, epType),
|
||||||
rootNode(NULL), descriptorSize(0),
|
rootNode(NULL), descriptorSize(0),
|
||||||
protocol(1), idle(1)
|
protocol(HID_REPORT_PROTOCOL), idle(1)
|
||||||
{
|
{
|
||||||
epType[0] = EP_TYPE_INTERRUPT_IN;
|
epType[0] = EP_TYPE_INTERRUPT_IN;
|
||||||
PluggableUSB().plug(this);
|
PluggableUSB().plug(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user