Skip to content

Commit b985a2f

Browse files
author
jan
committed
Add teensy package url to the default package url's #1615
1 parent 80e9164 commit b985a2f

13 files changed

+31
-67
lines changed

io.sloeber.core/src/io/sloeber/core/api/BoardsManager.java

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class BoardsManager {
7373
+ "https://raw.githubusercontent.com/jantje/hardware/master/package_jantje_index.json\n" //$NON-NLS-1$
7474
+ "https://raw.githubusercontent.com/jantje/ArduinoLibraries/master/library_jantje_index.json\n" //$NON-NLS-1$
7575
+ "https://arduino.esp8266.com/stable/package_esp8266com_index.json\n" //$NON-NLS-1$
76+
+ "https://www.pjrc.com/teensy/package_teensy_index.json\n" //$NON-NLS-1$
7677
+ KEY_MANAGER_ARDUINO_LIBRARY_JSON_URL;
7778

7879
protected static List<ArduinoPlatformPackageIndex> packageIndices;

io.sloeber.core/src/io/sloeber/core/tools/PackageManager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static IStatus downloadAndInstall(String pURL, String pArchiveFileName, I
6868
pMonitor.subTask("Downloading " + pArchiveFileName + " .."); //$NON-NLS-1$ //$NON-NLS-2$
6969
myCopy(dl, archivePath.toFile(), true);
7070
}
71-
} catch (IOException e) {
71+
} catch (Exception e) {
7272
return new Status(IStatus.ERROR, Activator.getId(), Messages.Manager_Failed_to_download.replace(FILE, pURL),
7373
e);
7474
}

io.sloeber.tests/src/io/sloeber/core/CompileAndUpload.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import io.sloeber.providers.ESP32;
4141
import io.sloeber.providers.ESP8266;
4242
import io.sloeber.providers.MCUBoard;
43+
import io.sloeber.providers.Teensy;
4344
import io.sloeber.ui.monitor.SerialConnection;
4445

4546
@SuppressWarnings({"nls","unused"})
@@ -134,8 +135,7 @@ public static void installAdditionalBoards() {
134135
Arduino.installLatestSamDBoards();
135136
Arduino.installLatestIntellCurieBoards();
136137
Arduino.installLatestSamBoards();
137-
138-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
138+
Teensy.installLatest();
139139

140140
}
141141

io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ private static boolean skipExample(Example example) {
101101
}
102102

103103
public static void installAdditionalBoards() {
104-
if (MySystem.getTeensyPlatform().isEmpty()) {
105-
System.err.println("ERROR: Teensy not installed/configured skipping tests!!!");
106-
} else {
107-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
108-
}
109-
104+
Teensy.installLatest();
110105
}
111106

112107
@Test

io.sloeber.tests/src/io/sloeber/core/CreateAndCompileDefaultInoOnAllBoardsTest.java

-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public class CreateAndCompileDefaultInoOnAllBoardsTest {
3131
private static final boolean removeAllinstallationInfoAtStartup = false;
3232
private static final boolean skipPlatformInstallation = false;
3333
private static final boolean apply_known_work_Arounds = true;
34-
private static final boolean testPrivateHardware = true;
3534
private static final boolean closeFailedProjects = false;
3635
private static int myBuildCounter = 0;
3736
private static int myTotalFails = 0;
@@ -323,10 +322,6 @@ public static void installAdditionalBoards() {
323322
}
324323
BoardsManager.setPackageURLs(toAddList, true);
325324

326-
if (testPrivateHardware) {
327-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
328-
}
329-
330325
if (!skipPlatformInstallation) {
331326
BoardsManager.installAllLatestPlatforms();
332327
// PackageManager.installsubsetOfLatestPlatforms(0,5);

io.sloeber.tests/src/io/sloeber/core/CreateAndCompileLibraryExamplesTest.java

-5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ public static void installAdditionalBoards() {
106106
LibraryManager.installAllLatestLibraries();
107107
// LibraryManager.onlyKeepLatestPlatforms();
108108
}
109-
if (MySystem.getTeensyPlatform().isEmpty()) {
110-
System.err.println("ERROR: Teensy not installed/configured skipping tests!!!");
111-
} else {
112-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
113-
}
114109
BoardsManager.installAllLatestPlatforms();
115110

116111
}

io.sloeber.tests/src/io/sloeber/core/MySystem.java

-14
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
@SuppressWarnings("nls")
1616
public class MySystem {
1717
private static final String jantjesWindowsMachine = "1248215851";
18-
//the one below is based on one mac address Fysiek adres (MAC): C0-3F-D5-66-04-58
1918
private static final String jantjesLinuxMachine = "88937904";
2019
private static final String currentMachine = getMachine();
2120

@@ -30,20 +29,7 @@ private static String getMachine() {
3029
return new String();
3130
}
3231

33-
public static String getTeensyPlatform() {
34-
switch (currentMachine) {
35-
case jantjesWindowsMachine:
36-
return "E:\\arduino\\arduino-1.8.12 - teensy\\hardware\\teensy";
37-
case jantjesLinuxMachine:
38-
return "/home/jan/teensyduino/arduino-1.8.12/hardware/teensy";
39-
default:
40-
return new String();
41-
}
42-
}
4332

44-
public static String getTeensyBoard_txt() {
45-
return getTeensyPlatform() + "/avr/boards.txt";
46-
}
4733

4834
public static MCUBoard[] getUploadBoards() {
4935
switch (currentMachine) {

io.sloeber.tests/src/io/sloeber/core/RegressionTest.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
1515
import org.eclipse.core.resources.IFile;
1616
import org.eclipse.core.resources.IProject;
17-
import org.eclipse.core.resources.IProjectDescription;
1817
import org.eclipse.core.resources.IncrementalProjectBuilder;
1918
import org.eclipse.core.runtime.CoreException;
2019
import org.eclipse.core.runtime.IPath;
@@ -66,10 +65,8 @@ public static void installAdditionalBoards() {
6665
ESP8266.installLatest();
6766
ESP32.installLatest();
6867
Arduino.installLatestAVRBoards();
68+
Teensy.installLatest();
6969

70-
if (!MySystem.getTeensyPlatform().isEmpty()) {
71-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
72-
}
7370
}
7471

7572
/**
@@ -78,13 +75,6 @@ public static void installAdditionalBoards() {
7875
*/
7976
@Test
8077
public void issue555() {
81-
if (MySystem.getTeensyPlatform().isEmpty()) {
82-
// skip test due to no teensy install folder provided
83-
// do not fail as this will always fail on travis
84-
System.out.println("skipping the test because teensy is not installed.");
85-
return;
86-
}
87-
System.out.println("Teensy is installed at " + MySystem.getTeensyPlatform());
8878
BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor();
8979
BoardDescription teensyBoardid = Teensy.Teensy3_1().getBoardDescriptor();
9080

io.sloeber.tests/src/io/sloeber/core/RegressionTestFailingOnTravis.java

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public static void WaitForInstallerToFinish() {
3535
public static void installAdditionalBoards() {
3636
String[] packageUrlsToAdd = { "http://talk2arduino.wisen.com.au/master/package_talk2.wisen.com_index.json" };
3737
BoardsManager.addPackageURLs(new HashSet<>(Arrays.asList(packageUrlsToAdd)), false);
38-
if (!MySystem.getTeensyPlatform().isEmpty()) {
39-
BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform());
40-
}
4138
}
4239

4340
/**

io.sloeber.tests/src/io/sloeber/providers/ESP8266.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ESP8266 extends MCUBoard {
1313
private static final String provider = "esp8266";
1414
private static final String architectureName = "esp8266";
1515
private static final String jsonFileName = "package_esp8266com_index.json";
16-
public static final String packageURL = "http://arduino.esp8266.com/stable/package_esp8266com_index.json";
16+
public static final String packageURL = "https://arduino.esp8266.com/stable/package_esp8266com_index.json";
1717

1818
public static MCUBoard wemosD1() {
1919
Map<String, String> options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
@@ -32,7 +32,7 @@ public static MCUBoard ESPressoLite() {
3232
}
3333

3434
public ESP8266(String boardName, Map<String, String> options) {
35-
this.myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, provider, architectureName, boardName,
35+
myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, provider, architectureName, boardName,
3636
options);
3737
if (this.myBoardDescriptor == null) {
3838
fail(boardName + " Board not found");

io.sloeber.tests/src/io/sloeber/providers/Jantje.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class Jantje extends MCUBoard {
1919
private static final String localDebugArchitectureName = "pc";
2020
private static final String jsonFileName = "package_jantje_index.json";
2121
// the below json url is need as esp8266 is a referenced platform
22-
public static final String additionalJsonURL = "http://arduino.esp8266.com/stable/package_esp8266com_index.json";
22+
public static final String additionalJsonURL = "https://arduino.esp8266.com/stable/package_esp8266com_index.json";
2323

2424
@Override
2525
public boolean isExampleSupported(Example example) {
@@ -38,8 +38,8 @@ public boolean isExampleSupported(Example example) {
3838
return super.isExampleSupported(example);
3939
}
4040

41-
public static List<MCUBoard> getAllBoards() {
42-
return getAllBoards(provider, Arduino.uno());
41+
public static List<MCUBoard> getAllBoards() {
42+
return getAllBoards(provider, uno());
4343
}
4444

4545
@Override
@@ -52,6 +52,10 @@ public Jantje(BoardDescription boardDesc) {
5252
myBoardDescriptor = boardDesc;
5353
setAttributes();
5454
}
55+
56+
public static MCUBoard uno() {
57+
return new Jantje( Arduino.unoID);
58+
}
5559

5660
public Jantje(String boardName) {
5761
Map<String, String> options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);

io.sloeber.tests/src/io/sloeber/providers/MCUBoard.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public abstract class MCUBoard {
2424

2525
protected abstract void setAttributes();
2626

27-
public static List<MCUBoard> getAllBoards(String provider, MCUBoard creator) {
27+
public static List<MCUBoard> getAllBoards(String provider, MCUBoard board) {
2828
List<MCUBoard> ret = new LinkedList<>();
2929
ArduinoPackage arduinoPkg = BoardsManager.getPackageByProvider(provider);
3030
for (ArduinoPlatform curPlatform : arduinoPkg.getPlatforms()) {
@@ -33,7 +33,7 @@ public static List<MCUBoard> getAllBoards(String provider, MCUBoard creator) {
3333
List<BoardDescription> boardDescriptions = BoardDescription
3434
.makeBoardDescriptors(curPlatformVersion.getBoardsFile());
3535
for (BoardDescription curBoardDesc : boardDescriptions) {
36-
MCUBoard curBoard = creator.createMCUBoard(curBoardDesc);
36+
MCUBoard curBoard = board.createMCUBoard(curBoardDesc);
3737
curBoard.myAttributes.boardID = curBoardDesc.getBoardID();
3838
ret.add(curBoard);
3939
}

io.sloeber.tests/src/io/sloeber/providers/Teensy.java

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package io.sloeber.providers;
22

3-
import static io.sloeber.core.common.Const.*;
4-
import static org.junit.Assert.*;
5-
63
import java.util.List;
74
import java.util.Map;
85
import java.util.TreeMap;
96

107
import io.sloeber.core.BoardAttributes;
118
import io.sloeber.core.Example;
12-
import io.sloeber.core.MySystem;
139
import io.sloeber.core.api.BoardDescription;
1410
import io.sloeber.core.api.BoardsManager;
1511

@@ -23,7 +19,10 @@ public class Teensy extends MCUBoard {
2319
public final static String Teensy3_5_ID = "teensy35";
2420
public final static String Teensy3_6_ID = "teensy36";
2521
public final static String Teensy_LC_ID = "teensyLC";
26-
public final static String TEENSY_ARCHITECTURE_ID = "teensy";
22+
public final static String TEENSY_PLATFORM_ID = "avr";
23+
public final static String TEENSY_PROVIDER= "teensy";
24+
private static final String jsonFileName = "package_teensy_index.json";
25+
public static final String packageURL = "https://www.pjrc.com/teensy/package_teensy_index.json";
2726

2827
public static MCUBoard Teensy_LC() {
2928
return new Teensy(Teensy_LC_ID);
@@ -72,12 +71,8 @@ private Teensy(String boardName) {
7271
default:
7372
break;
7473
}
74+
myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, TEENSY_PROVIDER, TEENSY_PLATFORM_ID,boardName,options);
7575

76-
myBoardDescriptor = BoardsManager.getBoardDescription(LOCAL, MySystem.getTeensyBoard_txt(), "ignored",
77-
boardName, options);
78-
if (myBoardDescriptor == null) {
79-
fail(boardName + " Board not found");
80-
}
8176
setUploadPort("none");
8277
setAttributes();
8378
}
@@ -117,9 +112,6 @@ public Map<String, String> getBoardOptions(Example example) {
117112
return ret;
118113
}
119114

120-
public static List<MCUBoard> getAllBoards() {
121-
return getAllBoards(MySystem.getTeensyPlatform(), teensy2());
122-
}
123115

124116
@Override
125117
public MCUBoard createMCUBoard(BoardDescription boardDescriptor) {
@@ -146,4 +138,13 @@ protected void setAttributes() {
146138
myAttributes.wire1 = true;
147139
myAttributes.myArchitectures.add(myBoardDescriptor.getArchitecture());
148140
}
141+
142+
public static void installLatest() {
143+
BoardsManager.installLatestPlatform(jsonFileName, TEENSY_PROVIDER, TEENSY_PLATFORM_ID);
144+
}
145+
146+
public static List<MCUBoard> getAllBoards() {
147+
// TODO Auto-generated method stub
148+
return null;
149+
}
149150
}

0 commit comments

Comments
 (0)