diff --git a/arduino-core/src/cc/arduino/Compiler.java b/arduino-core/src/cc/arduino/Compiler.java index f2af0f739c5..ae903530bca 100644 --- a/arduino-core/src/cc/arduino/Compiler.java +++ b/arduino-core/src/cc/arduino/Compiler.java @@ -212,10 +212,8 @@ private void callArduinoBuilder(TargetBoard board, TargetPlatform platform, Targ addPathFlagIfPathExists(cmd, "-tools", Paths.get(BaseNoGui.getHardwarePath(), "tools", "avr").toFile()); addPathFlagIfPathExists(cmd, "-tools", installedPackagesFolder); - cmd.add("-built-in-libraries"); - cmd.add(BaseNoGui.getContentFile("libraries").getAbsolutePath()); - cmd.add("-libraries"); - cmd.add(BaseNoGui.getSketchbookLibrariesFolder().getAbsolutePath()); + addPathFlagIfPathExists(cmd, "-built-in-libraries", BaseNoGui.getContentFile("libraries")); + addPathFlagIfPathExists(cmd, "-libraries", BaseNoGui.getSketchbookLibrariesFolder()); String fqbn = Stream.of(aPackage.getId(), platform.getId(), board.getId(), boardOptions(board)).filter(s -> !s.isEmpty()).collect(Collectors.joining(":")); cmd.add("-fqbn=" + fqbn); diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java index f38d81e4c67..bfb8fad7447 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java @@ -69,13 +69,14 @@ public class ContributionsIndexer { private final File builtInHardwareFolder; private final Platform platform; private final SignatureVerifier signatureVerifier; - private ContributionsIndex index; + private final ContributionsIndex index; public ContributionsIndexer(File preferencesFolder, File builtInHardwareFolder, Platform platform, SignatureVerifier signatureVerifier) { this.preferencesFolder = preferencesFolder; this.builtInHardwareFolder = builtInHardwareFolder; this.platform = platform; this.signatureVerifier = signatureVerifier; + index = new EmptyContributionIndex(); packagesFolder = new File(preferencesFolder, "packages"); stagingFolder = new File(preferencesFolder, "staging" + File.separator + "packages"); } @@ -83,7 +84,7 @@ public ContributionsIndexer(File preferencesFolder, File builtInHardwareFolder, public void parseIndex() throws Exception { // Read bundled index... File bundledIndexFile = new File(builtInHardwareFolder, Constants.BUNDLED_INDEX_FILE_NAME); - index = parseIndex(bundledIndexFile); + mergeContributions(bundledIndexFile); // ...and overlay the default index if present File defaultIndexFile = getIndexFile(Constants.DEFAULT_INDEX_FILE_NAME); @@ -93,7 +94,7 @@ public void parseIndex() throws Exception { throw new SignatureVerificationFailedException(Constants.DEFAULT_INDEX_FILE_NAME); } - mergeContributions(parseIndex(defaultIndexFile), defaultIndexFile); + mergeContributions(defaultIndexFile); } // Set main and bundled indexes as trusted @@ -104,8 +105,7 @@ public void parseIndex() throws Exception { for (File indexFile : indexFiles) { try { - ContributionsIndex contributionsIndex = parseIndex(indexFile); - mergeContributions(contributionsIndex, indexFile); + mergeContributions(indexFile); } catch (JsonProcessingException e) { System.err.println(I18n.format(tr("Skipping contributed index file {0}, parsing error occured:"), indexFile)); System.err.println(e); @@ -136,7 +136,11 @@ public void parseIndex() throws Exception { index.fillCategories(); } - private void mergeContributions(ContributionsIndex contributionsIndex, File indexFile) { + private void mergeContributions(File indexFile) throws IOException { + if (!indexFile.exists()) + return; + + ContributionsIndex contributionsIndex = parseIndex(indexFile); boolean signed = signatureVerifier.isSigned(indexFile); boolean trustall = PreferencesData.getBoolean(Constants.PREF_CONTRIBUTIONS_TRUST_ALL); diff --git a/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java b/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java new file mode 100644 index 00000000000..200dce3c2fe --- /dev/null +++ b/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java @@ -0,0 +1,42 @@ +/* + * This file is part of Arduino. + * + * Copyright 2014 Arduino LLC (http://www.arduino.cc/) + * + * Arduino is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + */ + +package cc.arduino.contributions.packages; + +import java.util.ArrayList; +import java.util.List; + +class EmptyContributionIndex extends ContributionsIndex { + List packs = new ArrayList<>(); + + @Override + public List getPackages() { + return packs; + } +} \ No newline at end of file diff --git a/build/arduino-builder-arm-1.3.23.tar.bz2.sha b/build/arduino-builder-linuxarm-1.3.23.tar.bz2.sha similarity index 100% rename from build/arduino-builder-arm-1.3.23.tar.bz2.sha rename to build/arduino-builder-linuxarm-1.3.23.tar.bz2.sha diff --git a/build/build.xml b/build/build.xml index c62ca9c8c5b..62f290e202b 100644 --- a/build/build.xml +++ b/build/build.xml @@ -472,21 +472,7 @@ - - - - - - - - - - - - - - - + @@ -706,21 +692,7 @@ - - - - - - - - - - - - - - - + @@ -738,21 +710,7 @@ - - - - - - - - - - - - - - - + @@ -770,21 +728,7 @@ - - - - - - - - - - - - - - - + @@ -827,6 +771,24 @@ + + + + + + + + + + + + + + + + + +