diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index f2263ed7f..8d980df51 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -3,9 +3,6 @@ name: Java CI with Maven - - - on: push: branches: [ master ] @@ -18,16 +15,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: show Maven - run: mvn -version - - uses: actions/checkout@v2 + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.9.6 - name: Set up JDK 17 uses: actions/setup-java@v2 with: java-version: '17' distribution: 'adopt' - - name: Build with Maven + - name: Build Sloeber with Maven run: mvn --no-transfer-progress verify -Pall,sloeber_release,NOSDK -Dtest=NightlyJenkins -DfailIfNoTests=false - name: Archive production artifacts @@ -55,3 +53,6 @@ jobs: with: name: macosx_arm path: io.sloeber.product/target/products/sloeber-ide-sloeber_release-macosx.cocoa.aarch64.zip + - name: Build Sloeber SDK with Maven + run: mvn clean verify -PSDK,win64,latest -DskipTests=true + \ No newline at end of file diff --git a/io.sloeber.core/META-INF/MANIFEST.MF b/io.sloeber.core/META-INF/MANIFEST.MF index 4ccc7651f..e2f4829c7 100644 --- a/io.sloeber.core/META-INF/MANIFEST.MF +++ b/io.sloeber.core/META-INF/MANIFEST.MF @@ -23,8 +23,10 @@ Require-Bundle: org.eclipse.core.variables, org.apache.commons.commons-io, org.apache.commons.commons-compress, + com.github.luben.zstd-jni;bundle-version="1.5.5", io.sloeber.autoBuild, org.eclipse.cdt.make.core + Export-Package: cc.arduino.packages;x-internal:=true, cc.arduino.packages.discoverers;x-internal:=true, cc.arduino.packages.ssh;x-internal:=true, diff --git a/io.sloeber.core/src/io/sloeber/core/api/BoardsManager.java b/io.sloeber.core/src/io/sloeber/core/api/BoardsManager.java index cf94b2e39..4da8f09db 100644 --- a/io.sloeber.core/src/io/sloeber/core/api/BoardsManager.java +++ b/io.sloeber.core/src/io/sloeber/core/api/BoardsManager.java @@ -71,6 +71,7 @@ public class BoardsManager { + "https://raw.githubusercontent.com/jantje/hardware/master/package_jantje_index.json\n" //$NON-NLS-1$ + "https://raw.githubusercontent.com/jantje/ArduinoLibraries/master/library_jantje_index.json\n" //$NON-NLS-1$ + "https://arduino.esp8266.com/stable/package_esp8266com_index.json\n" //$NON-NLS-1$ + + "https://www.pjrc.com/teensy/package_teensy_index.json\n" //$NON-NLS-1$ + KEY_MANAGER_ARDUINO_LIBRARY_JSON_URL; protected static List packageIndices; diff --git a/io.sloeber.core/src/io/sloeber/core/tools/FileModifiers.java b/io.sloeber.core/src/io/sloeber/core/tools/FileModifiers.java index 09d62a05f..93ffa5caa 100644 --- a/io.sloeber.core/src/io/sloeber/core/tools/FileModifiers.java +++ b/io.sloeber.core/src/io/sloeber/core/tools/FileModifiers.java @@ -3,6 +3,7 @@ import java.io.File; import java.io.IOException; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; @@ -33,8 +34,15 @@ public class FileModifiers { */ public static void appendString(File input, String addString) throws IOException { Path pathFile = Path.of(input.toString()); - String fileString = Files.readString(pathFile, Charset.defaultCharset()) + addString; + try { + String fileString = Files.readString(pathFile,StandardCharsets.UTF_8) + addString; Files.write(pathFile, fileString.getBytes(), StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); + }catch(IOException e) { + String fileString = Files.readString(pathFile,Charset.forName("Cp1252")) + addString; + Files.write(pathFile, fileString.getBytes(), StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); + + } + } /** diff --git a/io.sloeber.core/src/io/sloeber/core/tools/PackageManager.java b/io.sloeber.core/src/io/sloeber/core/tools/PackageManager.java index 52471dc5d..1bd976ea6 100644 --- a/io.sloeber.core/src/io/sloeber/core/tools/PackageManager.java +++ b/io.sloeber.core/src/io/sloeber/core/tools/PackageManager.java @@ -22,6 +22,7 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; +import org.apache.commons.compress.compressors.zstandard.ZstdCompressorInputStream; import org.apache.commons.io.FileUtils; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; @@ -68,7 +69,7 @@ public static IStatus downloadAndInstall(String pURL, String pArchiveFileName, I pMonitor.subTask("Downloading " + pArchiveFileName + " .."); //$NON-NLS-1$ //$NON-NLS-2$ myCopy(dl, archivePath.toFile(), true); } - } catch (IOException e) { + } catch (Exception e) { return new Status(IStatus.ERROR, Activator.getId(), Messages.Manager_Failed_to_download.replace(FILE, pURL), e); } @@ -80,27 +81,34 @@ private static IStatus processArchive(String pArchiveFileName, IPath pInstallPat // Create an ArchiveInputStream with the correct archiving algorithm String faileToExtractMessage = Messages.Manager_Failed_to_extract.replace(FILE, pArchiveFullFileName); if (pArchiveFileName.endsWith("tar.bz2")) { //$NON-NLS-1$ - try (ArchiveInputStream inStream = new TarArchiveInputStream( + try (TarArchiveInputStream inStream = new TarArchiveInputStream( new BZip2CompressorInputStream(new FileInputStream(pArchiveFullFileName)))) { return extract(inStream, pInstallPath.toFile(), 1, pForceDownload, pMonitor); } catch (IOException | InterruptedException e) { return new Status(IStatus.ERROR, Activator.getId(), faileToExtractMessage, e); } } else if (pArchiveFileName.endsWith("zip")) { //$NON-NLS-1$ - try (ArchiveInputStream in = new ZipArchiveInputStream(new FileInputStream(pArchiveFullFileName))) { + try (ZipArchiveInputStream in = new ZipArchiveInputStream(new FileInputStream(pArchiveFullFileName))) { return extract(in, pInstallPath.toFile(), 1, pForceDownload, pMonitor); } catch (IOException | InterruptedException e) { return new Status(IStatus.ERROR, Activator.getId(), faileToExtractMessage, e); } } else if (pArchiveFileName.endsWith("tar.gz")) { //$NON-NLS-1$ - try (ArchiveInputStream in = new TarArchiveInputStream( + try (TarArchiveInputStream in = new TarArchiveInputStream( new GzipCompressorInputStream(new FileInputStream(pArchiveFullFileName)))) { return extract(in, pInstallPath.toFile(), 1, pForceDownload, pMonitor); } catch (IOException | InterruptedException e) { return new Status(IStatus.ERROR, Activator.getId(), faileToExtractMessage, e); } + } else if (pArchiveFileName.endsWith("tar.zst")) { //$NON-NLS-1$ + try (TarArchiveInputStream in = new TarArchiveInputStream( + new ZstdCompressorInputStream(new FileInputStream(pArchiveFullFileName)))) { + return extract(in, pInstallPath.toFile(), 1, pForceDownload, pMonitor); + } catch (IOException | InterruptedException e) { + return new Status(IStatus.ERROR, Activator.getId(), faileToExtractMessage, e); + } } else if (pArchiveFileName.endsWith("tar")) { //$NON-NLS-1$ - try (ArchiveInputStream in = new TarArchiveInputStream(new FileInputStream(pArchiveFullFileName))) { + try (TarArchiveInputStream in = new TarArchiveInputStream(new FileInputStream(pArchiveFullFileName))) { return extract(in, pInstallPath.toFile(), 1, pForceDownload, pMonitor); } catch (IOException | InterruptedException e) { return new Status(IStatus.ERROR, Activator.getId(), faileToExtractMessage, e); @@ -110,7 +118,7 @@ private static IStatus processArchive(String pArchiveFileName, IPath pInstallPat } } - private static IStatus extract(ArchiveInputStream in, File destFolder, int stripPath, boolean overwrite, + private static IStatus extract(ArchiveInputStream in, File destFolder, int stripPath, boolean overwrite, IProgressMonitor pMonitor) throws IOException, InterruptedException { // Folders timestamps must be set at the end of archive extraction diff --git a/io.sloeber.parent/pom.xml b/io.sloeber.parent/pom.xml index 0f897b830..28c540ecf 100644 --- a/io.sloeber.parent/pom.xml +++ b/io.sloeber.parent/pom.xml @@ -80,7 +80,6 @@ - org.eclipse.justj.openjdk.hotspot.jre.full-17 @@ -96,7 +95,6 @@ org.apache.maven.plugins maven-release-plugin - 2.5.3 -Dgpg.passphrase=${gpg.passphrase} diff --git a/io.sloeber.product.sdk/arduino.product b/io.sloeber.product.sdk/arduino.product index 464f429d5..f46c71a7c 100644 --- a/io.sloeber.product.sdk/arduino.product +++ b/io.sloeber.product.sdk/arduino.product @@ -1,10 +1,10 @@ - + - + Sloeber, the Eclipse IDE for Arduino Developers @@ -36,10 +36,10 @@ https://github.com/sloeber/arduino-eclipse-plugin/graphs/contributors - + @@ -207,7 +207,6 @@ United States, other countries, or both. - @@ -224,7 +223,6 @@ United States, other countries, or both. - @@ -240,18 +238,13 @@ United States, other countries, or both. - - - - - @@ -266,6 +259,13 @@ United States, other countries, or both. + + + + + + + @@ -280,12 +280,11 @@ United States, other countries, or both. - - - - - - + + + + + diff --git a/io.sloeber.product.sdk/icons/eclipse_lg.png b/io.sloeber.product.sdk/icons/eclipse_lg.png new file mode 100644 index 000000000..d8315936e Binary files /dev/null and b/io.sloeber.product.sdk/icons/eclipse_lg.png differ diff --git a/io.sloeber.product.sdk/icons/logo_128.png b/io.sloeber.product.sdk/icons/logo_128.png new file mode 100644 index 000000000..4c153dd0d Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_128.png differ diff --git a/io.sloeber.product.sdk/icons/logo_16.png b/io.sloeber.product.sdk/icons/logo_16.png new file mode 100644 index 000000000..65562d1d8 Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_16.png differ diff --git a/io.sloeber.product.sdk/icons/logo_256.png b/io.sloeber.product.sdk/icons/logo_256.png new file mode 100644 index 000000000..e79f430d9 Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_256.png differ diff --git a/io.sloeber.product.sdk/icons/logo_32.png b/io.sloeber.product.sdk/icons/logo_32.png new file mode 100644 index 000000000..0ca0ad7e1 Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_32.png differ diff --git a/io.sloeber.product.sdk/icons/logo_48.png b/io.sloeber.product.sdk/icons/logo_48.png new file mode 100644 index 000000000..a4a097ff0 Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_48.png differ diff --git a/io.sloeber.product.sdk/icons/logo_64.png b/io.sloeber.product.sdk/icons/logo_64.png new file mode 100644 index 000000000..1e5091909 Binary files /dev/null and b/io.sloeber.product.sdk/icons/logo_64.png differ diff --git a/io.sloeber.product.sdk/icons/sample.png b/io.sloeber.product.sdk/icons/sample.png new file mode 100644 index 000000000..02c4b79e1 Binary files /dev/null and b/io.sloeber.product.sdk/icons/sample.png differ diff --git a/io.sloeber.product.sdk/icons/sample@2x.png b/io.sloeber.product.sdk/icons/sample@2x.png new file mode 100644 index 000000000..c1224d1fc Binary files /dev/null and b/io.sloeber.product.sdk/icons/sample@2x.png differ diff --git a/io.sloeber.product/sloeber.target b/io.sloeber.product/sloeber.target index c37f28055..c57f74d0a 100644 --- a/io.sloeber.product/sloeber.target +++ b/io.sloeber.product/sloeber.target @@ -2,11 +2,6 @@ - - - - - @@ -30,13 +25,38 @@ + + + + + + + + + + - - + + + + + + + + + + + + + com.github.luben + zstd-jni + 1.5.5-11 + jar + com.google.code.gson gson diff --git a/io.sloeber.tests/src/io/sloeber/core/CompileAndUpload.java b/io.sloeber.tests/src/io/sloeber/core/CompileAndUpload.java index 1eb9f19d3..0d4028aee 100644 --- a/io.sloeber.tests/src/io/sloeber/core/CompileAndUpload.java +++ b/io.sloeber.tests/src/io/sloeber/core/CompileAndUpload.java @@ -41,6 +41,7 @@ import io.sloeber.providers.ESP32; import io.sloeber.providers.ESP8266; import io.sloeber.providers.MCUBoard; +import io.sloeber.providers.Teensy; import io.sloeber.ui.monitor.SerialConnection; @SuppressWarnings({ "nls", "unused" }) @@ -130,9 +131,7 @@ public static void installAdditionalBoards() { Arduino.installLatestSamDBoards(); Arduino.installLatestIntellCurieBoards(); Arduino.installLatestSamBoards(); - - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - + Teensy.installLatest(); } @Test diff --git a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java index d98af2b61..5ed752304 100644 --- a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java +++ b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileArduinoIDEExamplesOnTeensyTest.java @@ -101,12 +101,7 @@ private static boolean skipExample(Example example) { } public static void installAdditionalBoards() { - if (MySystem.getTeensyPlatform().isEmpty()) { - System.err.println("ERROR: Teensy not installed/configured skipping tests!!!"); - } else { - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - } - + Teensy.installLatest(); } @Test diff --git a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileDefaultInoOnAllBoardsTest.java b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileDefaultInoOnAllBoardsTest.java index b45e6de55..ff6071d81 100644 --- a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileDefaultInoOnAllBoardsTest.java +++ b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileDefaultInoOnAllBoardsTest.java @@ -32,7 +32,6 @@ public class CreateAndCompileDefaultInoOnAllBoardsTest { private static final boolean removeAllinstallationInfoAtStartup = false; private static final boolean skipPlatformInstallation = false; private static final boolean apply_known_work_Arounds = true; - private static final boolean testPrivateHardware = true; private static final boolean closeFailedProjects = false; private static int myBuildCounter = 0; private static int myTotalFails = 0; @@ -324,10 +323,6 @@ public static void installAdditionalBoards() { } BoardsManager.setPackageURLs(toAddList, true); - if (testPrivateHardware) { - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - } - if (!skipPlatformInstallation) { BoardsManager.installAllLatestPlatforms(); // PackageManager.installsubsetOfLatestPlatforms(0,5); diff --git a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileLibraryExamplesTest.java b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileLibraryExamplesTest.java index 18c09f925..262f5f310 100644 --- a/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileLibraryExamplesTest.java +++ b/io.sloeber.tests/src/io/sloeber/core/CreateAndCompileLibraryExamplesTest.java @@ -106,11 +106,6 @@ public static void installAdditionalBoards() { LibraryManager.installAllLatestLibraries(); // LibraryManager.onlyKeepLatestPlatforms(); } - if (MySystem.getTeensyPlatform().isEmpty()) { - System.err.println("ERROR: Teensy not installed/configured skipping tests!!!"); - } else { - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - } BoardsManager.installAllLatestPlatforms(); } diff --git a/io.sloeber.tests/src/io/sloeber/core/MySystem.java b/io.sloeber.tests/src/io/sloeber/core/MySystem.java index 9be8a4d2e..ac85980a5 100644 --- a/io.sloeber.tests/src/io/sloeber/core/MySystem.java +++ b/io.sloeber.tests/src/io/sloeber/core/MySystem.java @@ -15,7 +15,6 @@ @SuppressWarnings("nls") public class MySystem { private static final String jantjesWindowsMachine = "1248215851"; - //the one below is based on one mac address Fysiek adres (MAC): C0-3F-D5-66-04-58 private static final String jantjesLinuxMachine = "88937904"; private static final String currentMachine = getMachine(); @@ -30,20 +29,7 @@ private static String getMachine() { return new String(); } - public static String getTeensyPlatform() { - switch (currentMachine) { - case jantjesWindowsMachine: - return "E:\\arduino\\arduino-1.8.12 - teensy\\hardware\\teensy"; - case jantjesLinuxMachine: - return "/home/jan/teensyduino/arduino-1.8.12/hardware/teensy"; - default: - return new String(); - } - } - public static String getTeensyBoard_txt() { - return getTeensyPlatform() + "/avr/boards.txt"; - } public static MCUBoard[] getUploadBoards() { switch (currentMachine) { diff --git a/io.sloeber.tests/src/io/sloeber/core/RegressionTest.java b/io.sloeber.tests/src/io/sloeber/core/RegressionTest.java index 82f3177ea..e365a81b4 100644 --- a/io.sloeber.tests/src/io/sloeber/core/RegressionTest.java +++ b/io.sloeber.tests/src/io/sloeber/core/RegressionTest.java @@ -64,10 +64,8 @@ public static void installAdditionalBoards() { ESP8266.installLatest(); ESP32.installLatest(); Arduino.installLatestAVRBoards(); + Teensy.installLatest(); - if (!MySystem.getTeensyPlatform().isEmpty()) { - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - } } /** @@ -77,14 +75,7 @@ public static void installAdditionalBoards() { * @throws CoreException */ @Test - public void issue555() throws CoreException { - if (MySystem.getTeensyPlatform().isEmpty()) { - // skip test due to no teensy install folder provided - // do not fail as this will always fail on travis - System.out.println("skipping the test because teensy is not installed."); - return; - } - System.out.println("Teensy is installed at " + MySystem.getTeensyPlatform()); + public void issue555() { BoardDescription unoBoardid = Arduino.uno().getBoardDescriptor(); BoardDescription teensyBoardid = Teensy.Teensy3_1().getBoardDescriptor(); diff --git a/io.sloeber.tests/src/io/sloeber/core/RegressionTestFailingOnTravis.java b/io.sloeber.tests/src/io/sloeber/core/RegressionTestFailingOnTravis.java index 4ea0e14c3..cc1c6f3eb 100644 --- a/io.sloeber.tests/src/io/sloeber/core/RegressionTestFailingOnTravis.java +++ b/io.sloeber.tests/src/io/sloeber/core/RegressionTestFailingOnTravis.java @@ -35,9 +35,6 @@ public static void WaitForInstallerToFinish() { public static void installAdditionalBoards() { String[] packageUrlsToAdd = { "http://talk2arduino.wisen.com.au/master/package_talk2.wisen.com_index.json" }; BoardsManager.addPackageURLs(new HashSet<>(Arrays.asList(packageUrlsToAdd)), false); - if (!MySystem.getTeensyPlatform().isEmpty()) { - BoardsManager.addPrivateHardwarePath(MySystem.getTeensyPlatform()); - } } /** diff --git a/io.sloeber.tests/src/io/sloeber/providers/ESP8266.java b/io.sloeber.tests/src/io/sloeber/providers/ESP8266.java index 8ada5c34b..2a5cb2d0c 100644 --- a/io.sloeber.tests/src/io/sloeber/providers/ESP8266.java +++ b/io.sloeber.tests/src/io/sloeber/providers/ESP8266.java @@ -13,7 +13,7 @@ public class ESP8266 extends MCUBoard { private static final String provider = "esp8266"; private static final String architectureName = "esp8266"; private static final String jsonFileName = "package_esp8266com_index.json"; - public static final String packageURL = "http://arduino.esp8266.com/stable/package_esp8266com_index.json"; + public static final String packageURL = "https://arduino.esp8266.com/stable/package_esp8266com_index.json"; public static MCUBoard wemosD1() { Map options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); @@ -32,7 +32,7 @@ public static MCUBoard ESPressoLite() { } public ESP8266(String boardName, Map options) { - this.myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, provider, architectureName, boardName, + myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, provider, architectureName, boardName, options); if (this.myBoardDescriptor == null) { fail(boardName + " Board not found"); diff --git a/io.sloeber.tests/src/io/sloeber/providers/Jantje.java b/io.sloeber.tests/src/io/sloeber/providers/Jantje.java index 46db7922f..62cba3e81 100644 --- a/io.sloeber.tests/src/io/sloeber/providers/Jantje.java +++ b/io.sloeber.tests/src/io/sloeber/providers/Jantje.java @@ -19,7 +19,7 @@ public class Jantje extends MCUBoard { private static final String localDebugArchitectureName = "pc"; private static final String jsonFileName = "package_jantje_index.json"; // the below json url is need as esp8266 is a referenced platform - public static final String additionalJsonURL = "http://arduino.esp8266.com/stable/package_esp8266com_index.json"; + public static final String additionalJsonURL = "https://arduino.esp8266.com/stable/package_esp8266com_index.json"; @Override public boolean isExampleSupported(Example example) { @@ -38,8 +38,8 @@ public boolean isExampleSupported(Example example) { return super.isExampleSupported(example); } - public static List getAllBoards() { - return getAllBoards(provider, Arduino.uno()); + public static List getAllBoards() { + return getAllBoards(provider, uno()); } @Override @@ -52,6 +52,10 @@ public Jantje(BoardDescription boardDesc) { myBoardDescriptor = boardDesc; setAttributes(); } + + public static MCUBoard uno() { + return new Jantje( Arduino.unoID); + } public Jantje(String boardName) { Map options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); diff --git a/io.sloeber.tests/src/io/sloeber/providers/MCUBoard.java b/io.sloeber.tests/src/io/sloeber/providers/MCUBoard.java index 6f6b7e788..8ba4aa537 100644 --- a/io.sloeber.tests/src/io/sloeber/providers/MCUBoard.java +++ b/io.sloeber.tests/src/io/sloeber/providers/MCUBoard.java @@ -24,7 +24,7 @@ public abstract class MCUBoard { protected abstract void setAttributes(); - public static List getAllBoards(String provider, MCUBoard creator) { + public static List getAllBoards(String provider, MCUBoard board) { List ret = new LinkedList<>(); ArduinoPackage arduinoPkg = BoardsManager.getPackageByProvider(provider); for (ArduinoPlatform curPlatform : arduinoPkg.getPlatforms()) { @@ -33,7 +33,7 @@ public static List getAllBoards(String provider, MCUBoard creator) { List boardDescriptions = BoardDescription .makeBoardDescriptors(curPlatformVersion.getBoardsFile()); for (BoardDescription curBoardDesc : boardDescriptions) { - MCUBoard curBoard = creator.createMCUBoard(curBoardDesc); + MCUBoard curBoard = board.createMCUBoard(curBoardDesc); curBoard.myAttributes.boardID = curBoardDesc.getBoardID(); ret.add(curBoard); } diff --git a/io.sloeber.tests/src/io/sloeber/providers/Teensy.java b/io.sloeber.tests/src/io/sloeber/providers/Teensy.java index 1508268bd..ece1c8947 100644 --- a/io.sloeber.tests/src/io/sloeber/providers/Teensy.java +++ b/io.sloeber.tests/src/io/sloeber/providers/Teensy.java @@ -1,15 +1,11 @@ package io.sloeber.providers; -import static io.sloeber.core.api.Const.*; -import static org.junit.Assert.*; - import java.util.List; import java.util.Map; import java.util.TreeMap; import io.sloeber.core.BoardAttributes; import io.sloeber.core.Example; -import io.sloeber.core.MySystem; import io.sloeber.core.api.BoardDescription; import io.sloeber.core.api.BoardsManager; @@ -23,7 +19,10 @@ public class Teensy extends MCUBoard { public final static String Teensy3_5_ID = "teensy35"; public final static String Teensy3_6_ID = "teensy36"; public final static String Teensy_LC_ID = "teensyLC"; - public final static String TEENSY_ARCHITECTURE_ID = "teensy"; + public final static String TEENSY_PLATFORM_ID = "avr"; + public final static String TEENSY_PROVIDER= "teensy"; + private static final String jsonFileName = "package_teensy_index.json"; + public static final String packageURL = "https://www.pjrc.com/teensy/package_teensy_index.json"; public static MCUBoard Teensy_LC() { return new Teensy(Teensy_LC_ID); @@ -72,12 +71,8 @@ private Teensy(String boardName) { default: break; } + myBoardDescriptor = BoardsManager.getBoardDescription(jsonFileName, TEENSY_PROVIDER, TEENSY_PLATFORM_ID,boardName,options); - myBoardDescriptor = BoardsManager.getBoardDescription(LOCAL, MySystem.getTeensyBoard_txt(), "ignored", - boardName, options); - if (myBoardDescriptor == null) { - fail(boardName + " Board not found"); - } setUploadPort("none"); setAttributes(); } @@ -117,9 +112,6 @@ public Map getBoardOptions(Example example) { return ret; } - public static List getAllBoards() { - return getAllBoards(MySystem.getTeensyPlatform(), teensy2()); - } @Override public MCUBoard createMCUBoard(BoardDescription boardDescriptor) { @@ -146,4 +138,13 @@ protected void setAttributes() { myAttributes.wire1 = true; myAttributes.myArchitectures.add(myBoardDescriptor.getArchitecture()); } + + public static void installLatest() { + BoardsManager.installLatestPlatform(jsonFileName, TEENSY_PROVIDER, TEENSY_PLATFORM_ID); + } + + public static List getAllBoards() { + // TODO Auto-generated method stub + return null; + } } \ No newline at end of file