diff --git a/.classpath b/.classpath index 1ebf54417..574e1c7f8 100644 --- a/.classpath +++ b/.classpath @@ -23,7 +23,6 @@ - diff --git a/app/.classpath b/app/.classpath index 4a1f51314..27164be5b 100644 --- a/app/.classpath +++ b/app/.classpath @@ -34,7 +34,6 @@ - diff --git a/app/lib/jackson-module-mrbean-2.9.5.jar b/app/lib/jackson-module-mrbean-2.9.5.jar deleted file mode 100644 index dc7f5a057..000000000 Binary files a/app/lib/jackson-module-mrbean-2.9.5.jar and /dev/null differ diff --git a/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java b/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java index f57700c62..0892c3615 100644 --- a/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/GzippedJsonDownloaderTest.java @@ -4,7 +4,6 @@ import cc.arduino.contributions.libraries.LibrariesIndex; import cc.arduino.utils.MultiStepProgress; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.module.mrbean.MrBeanModule; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -47,7 +46,6 @@ public class GzippedJsonDownloaderTest { InputStream indexIn = new FileInputStream(tempFile); ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new MrBeanModule()); mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); mapper.configure(DeserializationFeature.EAGER_DESERIALIZER_FETCH, true); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); diff --git a/app/test/cc/arduino/contributions/JsonDownloaderTest.java b/app/test/cc/arduino/contributions/JsonDownloaderTest.java index 98555be4d..1315fe223 100644 --- a/app/test/cc/arduino/contributions/JsonDownloaderTest.java +++ b/app/test/cc/arduino/contributions/JsonDownloaderTest.java @@ -4,7 +4,6 @@ import cc.arduino.contributions.libraries.LibrariesIndex; import cc.arduino.utils.MultiStepProgress; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.module.mrbean.MrBeanModule; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -46,7 +45,6 @@ public class JsonDownloaderTest { InputStream indexIn = new FileInputStream(tempFile); ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new MrBeanModule()); mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); mapper.configure(DeserializationFeature.EAGER_DESERIALIZER_FETCH, true); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); diff --git a/arduino-core/.classpath b/arduino-core/.classpath index a74c83fd6..b4f9733f8 100644 --- a/arduino-core/.classpath +++ b/arduino-core/.classpath @@ -20,7 +20,6 @@ - diff --git a/arduino-core/lib/jackson-module-mrbean-2.9.5.jar b/arduino-core/lib/jackson-module-mrbean-2.9.5.jar deleted file mode 100644 index dc7f5a057..000000000 Binary files a/arduino-core/lib/jackson-module-mrbean-2.9.5.jar and /dev/null differ diff --git a/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java b/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java index 692a3dfb2..ecfa136be 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibrary.java @@ -35,38 +35,69 @@ import processing.app.packages.UserLibrary; import static processing.app.I18n.tr; import java.util.Comparator; +import java.util.ArrayList; import java.util.List; import java.util.Optional; import cc.arduino.contributions.VersionHelper; -public abstract class ContributedLibrary extends DownloadableContribution { +public class ContributedLibrary extends DownloadableContribution { - public abstract String getName(); + private String url; + public String getUrl() { return url; } - public abstract String getMaintainer(); + private String version; + public String getVersion() { return version; } - public abstract String getAuthor(); + private String checksum; + public String getChecksum() { return checksum; } - public abstract String getWebsite(); + private long size; + public long getSize() { return size; } - public abstract String getCategory(); + private String archiveFileName; + public String getArchiveFileName() { return archiveFileName; } - public abstract void setCategory(String category); - public abstract String getLicense(); - public abstract String getParagraph(); + private String name; + public String getName() { return name; } - public abstract String getSentence(); + private String maintainer; + public String getMaintainer() { return maintainer; } - public abstract List getArchitectures(); + private String author; + public String getAuthor() { return author; } - public abstract List getTypes(); + private String website; + public String getWebsite() { return website; } + + private String category; + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + + private String licence; + public String getLicense() { return licence; } + + private String paragraph; + public String getParagraph() { return paragraph; } + + private String sentence; + public String getSentence() { return sentence; } + + private ArrayList architectures; + public List getArchitectures() { return architectures; } + + private ArrayList types; + public List getTypes() { return types; } + + private ArrayList dependencies; + public List getDependencies() { return dependencies; } + + private ArrayList providesIncludes; + public List getProvidesIncludes() { return providesIncludes; } - public abstract List getDependencies(); - public abstract List getProvidesIncludes(); public static final Comparator CASE_INSENSITIVE_ORDER = (o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName()); diff --git a/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibraryDependency.java b/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibraryDependency.java index e8e500dd5..1f0e0fc6c 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibraryDependency.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/ContributedLibraryDependency.java @@ -29,11 +29,13 @@ package cc.arduino.contributions.libraries; -public abstract class ContributedLibraryDependency { +public class ContributedLibraryDependency { - public abstract String getName(); + private String name; + public String getName() { return name; } - public abstract String getVersion(); + private String version; + public String getVersion() { return version; } @Override public String toString() { diff --git a/arduino-core/src/cc/arduino/contributions/libraries/EmptyLibrariesIndex.java b/arduino-core/src/cc/arduino/contributions/libraries/EmptyLibrariesIndex.java deleted file mode 100644 index f85ab46ef..000000000 --- a/arduino-core/src/cc/arduino/contributions/libraries/EmptyLibrariesIndex.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of Arduino. - * - * Copyright 2016 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.libraries; - -import java.util.ArrayList; -import java.util.List; - -public class EmptyLibrariesIndex extends LibrariesIndex { - - private List list = new ArrayList<>(); - - @Override - public List getLibraries() { - return list; - } - -} diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndex.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndex.java index d66a31fd3..02ff0475c 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndex.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndex.java @@ -40,9 +40,13 @@ import java.util.stream.Collectors; import cc.arduino.contributions.VersionComparator; -public abstract class LibrariesIndex { +public class LibrariesIndex { - public abstract List getLibraries(); + private ArrayList list = new ArrayList<>(); + + public List getLibraries() { + return list; + } public List find(final String name) { return getLibraries().stream() // diff --git a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java index c43a4a094..fb0b0c76a 100644 --- a/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/libraries/LibrariesIndexer.java @@ -36,7 +36,6 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.module.mrbean.MrBeanModule; import org.apache.commons.compress.utils.IOUtils; import processing.app.BaseNoGui; import processing.app.I18n; @@ -76,7 +75,7 @@ public class LibrariesIndexer { } public void parseIndex() throws IOException { - index = new EmptyLibrariesIndex(); // Fallback + index = new LibrariesIndex(); // Fallback if (!indexFile.exists()) { return; @@ -92,7 +91,6 @@ public class LibrariesIndexer { try { indexIn = new FileInputStream(file); ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new MrBeanModule()); mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); mapper.configure(DeserializationFeature.EAGER_DESERIALIZER_FETCH, true); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedBoard.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedBoard.java index 7017ced5d..c29110376 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedBoard.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedBoard.java @@ -29,8 +29,9 @@ package cc.arduino.contributions.packages; -public interface ContributedBoard { +public class ContributedBoard { - String getName(); + private String name; + public String getName() { return name; } } diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedHelp.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedHelp.java index a8f998f66..2156f5c48 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedHelp.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedHelp.java @@ -29,8 +29,9 @@ package cc.arduino.contributions.packages; -public abstract class ContributedHelp { +public class ContributedHelp { - public abstract String getOnline(); + private String online; + public String getOnline() { return online; } } diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedPackage.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedPackage.java index 507a63be1..2d4530cea 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedPackage.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedPackage.java @@ -29,23 +29,31 @@ package cc.arduino.contributions.packages; +import java.util.ArrayList; import java.util.List; -public abstract class ContributedPackage { +public class ContributedPackage { - public abstract String getName(); + private String name; + public String getName() { return name; } - public abstract String getMaintainer(); + private String maintainer; + public String getMaintainer() { return maintainer; } - public abstract String getWebsiteURL(); + private String websiteURL; + public String getWebsiteURL() { return websiteURL; } - public abstract String getEmail(); + private String email; + public String getEmail() { return email; } - public abstract List getPlatforms(); + private ArrayList platforms = new ArrayList(); + public List getPlatforms() { return platforms; } - public abstract List getTools(); + private ArrayList tools = new ArrayList(); + public List getTools() { return tools; } - public abstract ContributedHelp getHelp(); + private ContributedHelp help; + public ContributedHelp getHelp() { return help; } private boolean trusted; diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedPlatform.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedPlatform.java index 3149aea1e..d6bf12996 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedPlatform.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedPlatform.java @@ -35,24 +35,42 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import java.io.File; import java.util.*; -public abstract class ContributedPlatform extends DownloadableContribution { +public class ContributedPlatform extends DownloadableContribution { - public abstract String getName(); + private String url; + public String getUrl() { return url; } - public abstract String getCategory(); + private String version; + public String getVersion() { return version; } - public abstract void setCategory(String category); + private long size; + public long getSize() { return size; } - public abstract String getArchitecture(); + private String archiveFileName; + public String getArchiveFileName() { return archiveFileName; } + private String name; + public String getName() { return name; } + + private String category; + public String getCategory() { return category; } + public void setCategory(String category) { this.category = category; } + + private String architecture; + public String getArchitecture() { return architecture; } + + private String checksum; @Override - public abstract String getChecksum(); + public String getChecksum() { return checksum; } - public abstract List getToolsDependencies(); + private ArrayList toolsDependencies = new ArrayList(); + public List getToolsDependencies() { return toolsDependencies; } - public abstract List getBoards(); + private ArrayList boards = new ArrayList(); + public List getBoards() { return boards; } - public abstract ContributedHelp getHelp(); + private ContributedHelp help; + public ContributedHelp getHelp() { return help; } private boolean installed; diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedTool.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedTool.java index cafeb9aef..a96c04954 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedTool.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedTool.java @@ -33,15 +33,19 @@ import cc.arduino.contributions.DownloadableContribution; import processing.app.Platform; import java.io.File; +import java.util.ArrayList; import java.util.List; -public abstract class ContributedTool { +public class ContributedTool { - public abstract String getName(); + private String name; + public String getName() { return name; } - public abstract String getVersion(); + private String version; + public String getVersion() { return version; } - public abstract List getSystems(); + private ArrayList systems = new ArrayList(); + public List getSystems() { return systems; } private boolean installed; diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributedToolReference.java b/arduino-core/src/cc/arduino/contributions/packages/ContributedToolReference.java index 7d86f234f..0da2990dd 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributedToolReference.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributedToolReference.java @@ -31,13 +31,16 @@ package cc.arduino.contributions.packages; import java.util.Collection; -public abstract class ContributedToolReference { +public class ContributedToolReference { - public abstract String getName(); + private String name; + public String getName() { return name; } - public abstract String getVersion(); + private String version; + public String getVersion() { return version; } - public abstract String getPackager(); + private String packager; + public String getPackager() { return packager; } public ContributedTool resolve(Collection packages) { for (ContributedPackage pack : packages) { diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java index 4ca658639..0a9b19cc3 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java @@ -38,9 +38,10 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -public abstract class ContributionsIndex { +public class ContributionsIndex { - public abstract List getPackages(); + private ArrayList packages = new ArrayList(); + public List getPackages() { return packages; } public ContributedPackage findPackage(String packageName) { for (ContributedPackage pack : getPackages()) { diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java index 2a97e0e7d..060a94e6a 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java @@ -35,7 +35,6 @@ import cc.arduino.contributions.SignatureVerifier; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.module.mrbean.MrBeanModule; import org.apache.commons.compress.utils.IOUtils; import processing.app.BaseNoGui; @@ -73,7 +72,7 @@ public class ContributionsIndexer { this.builtInHardwareFolder = builtInHardwareFolder; this.platform = platform; this.signatureVerifier = signatureVerifier; - index = new EmptyContributionIndex(); + index = new ContributionsIndex(); packagesFolder = new File(preferencesFolder, "packages"); stagingFolder = new File(preferencesFolder, "staging" + File.separator + "packages"); } @@ -208,7 +207,6 @@ public class ContributionsIndexer { try { inputStream = new FileInputStream(indexFile); ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new MrBeanModule()); mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); mapper.configure(DeserializationFeature.EAGER_DESERIALIZER_FETCH, true); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); diff --git a/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java b/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java deleted file mode 100644 index 200dce3c2..000000000 --- a/arduino-core/src/cc/arduino/contributions/packages/EmptyContributionIndex.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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/arduino-core/src/cc/arduino/contributions/packages/HostDependentDownloadableContribution.java b/arduino-core/src/cc/arduino/contributions/packages/HostDependentDownloadableContribution.java index cb7137d86..f3e038a83 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/HostDependentDownloadableContribution.java +++ b/arduino-core/src/cc/arduino/contributions/packages/HostDependentDownloadableContribution.java @@ -32,9 +32,25 @@ package cc.arduino.contributions.packages; import cc.arduino.contributions.DownloadableContribution; import processing.app.Platform; -public abstract class HostDependentDownloadableContribution extends DownloadableContribution { +public class HostDependentDownloadableContribution extends DownloadableContribution { - public abstract String getHost(); + private String url; + public String getUrl() { return url; } + + private String version; + public String getVersion() { return version; } + + private String checksum; + public String getChecksum() { return checksum; } + + private long size; + public long getSize() { return size; } + + private String archiveFileName; + public String getArchiveFileName() { return archiveFileName; } + + private String host; + public String getHost() { return host; } @Override public String toString() { diff --git a/build/windows/launcher/config.xml b/build/windows/launcher/config.xml index 6fbdd02bd..affef023c 100644 --- a/build/windows/launcher/config.xml +++ b/build/windows/launcher/config.xml @@ -40,7 +40,6 @@ %EXEDIR%/lib/jackson-annotations-2.9.5.jar %EXEDIR%/lib/jackson-core-2.9.5.jar %EXEDIR%/lib/jackson-databind-2.9.5.jar - %EXEDIR%/lib/jackson-module-mrbean-2.9.5.jar %EXEDIR%/lib/java-semver-0.8.0.jar %EXEDIR%/lib/jmdns-3.5.3.jar %EXEDIR%/lib/jtouchbar-1.0.0.jar diff --git a/build/windows/launcher/config_debug.xml b/build/windows/launcher/config_debug.xml index 4da3bc3b6..59d5a35ae 100644 --- a/build/windows/launcher/config_debug.xml +++ b/build/windows/launcher/config_debug.xml @@ -40,7 +40,6 @@ %EXEDIR%/lib/jackson-annotations-2.9.5.jar %EXEDIR%/lib/jackson-core-2.9.5.jar %EXEDIR%/lib/jackson-databind-2.9.5.jar - %EXEDIR%/lib/jackson-module-mrbean-2.9.5.jar %EXEDIR%/lib/java-semver-0.8.0.jar %EXEDIR%/lib/jmdns-3.5.3.jar %EXEDIR%/lib/jtouchbar-1.0.0.jar