Skip to content

#1339 add deserialisation clases #1417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 53 commits into from
Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3d8ae10
Library json is working
Nov 6, 2021
6708628
#1339 packages Seem to work.
Nov 7, 2021
deb3175
#1339 merged the 2 version implementations
Nov 7, 2021
8b88e2f
#1339 removed platformtree, internalPackageManager and more
Nov 7, 2021
743d816
removed system hash
Nov 8, 2021
206dd61
#1339 replaced LibraryDescriptor class by LibraryJson class
Nov 8, 2021
0f1493d
#1339 moved libraryTree class to gui
Nov 9, 2021
0a880a1
#1339 amend to previous commit
Nov 9, 2021
517418f
#1339 introduced library and LibraryVersion library manager now works
Nov 10, 2021
2e18bd0
#1339 boardsmanager now has a platform and platform version
Nov 13, 2021
416e5d8
#1339 move uninstall to boardsmanager
Nov 15, 2021
b6cd455
#1339 cater for platform not found
Nov 15, 2021
36b6dca
#1339 regression. Referenced variants boards do not have variant folder
Nov 15, 2021
e1cd692
#1339 starting to run regression test default ino on all boards
Nov 17, 2021
ff38afb
#1339 env var build.system.path not properly set
Nov 17, 2021
78bf51e
#1339 tools(versions) wer not yet in a tree
Nov 17, 2021
727a772
#1339 all kind of fixes to try to make it work
Nov 19, 2021
979f0ed
#1411 take the packager into account when installing a platform
Nov 19, 2021
4b6659d
#1339 fix build.system.path environment var
Nov 20, 2021
5df1340
#1412 was fixed in a previous change but here I fix finding the tool
Nov 21, 2021
722ee7d
#1339 board manager board list and json list not sorted
Nov 21, 2021
2d0debc
undo changes that should not have been checked in
Nov 21, 2021
68ad550
#1339 fix lots of todo's
Nov 21, 2021
b0581bb
#1339 fixing lots of TODO's mostly code related
Nov 23, 2021
c5d1fbf
#1380 as I was testing examples I fixed this
Nov 23, 2021
3c8978a
Library json is working
Nov 6, 2021
ee7b5ca
#1339 packages Seem to work.
Nov 7, 2021
fe85e24
#1339 merged the 2 version implementations
Nov 7, 2021
26074ea
#1339 removed platformtree, internalPackageManager and more
Nov 7, 2021
05aef0f
removed system hash
Nov 8, 2021
04d9d94
#1339 replaced LibraryDescriptor class by LibraryJson class
Nov 8, 2021
3df8802
#1339 moved libraryTree class to gui
Nov 9, 2021
b201237
#1339 amend to previous commit
Nov 9, 2021
1fd4470
#1339 introduced library and LibraryVersion library manager now works
Nov 10, 2021
c5154a7
#1339 boardsmanager now has a platform and platform version
Nov 13, 2021
658fbc3
#1339 move uninstall to boardsmanager
Nov 15, 2021
230d130
#1339 cater for platform not found
Nov 15, 2021
fa0e587
#1339 regression. Referenced variants boards do not have variant folder
Nov 15, 2021
1e173fc
#1339 starting to run regression test default ino on all boards
Nov 17, 2021
4d3e9e0
#1339 env var build.system.path not properly set
Nov 17, 2021
23ac555
#1339 tools(versions) wer not yet in a tree
Nov 17, 2021
1da8e7a
#1339 all kind of fixes to try to make it work
Nov 19, 2021
4184d28
#1411 take the packager into account when installing a platform
Nov 19, 2021
ada7bd0
#1339 fix build.system.path environment var
Nov 20, 2021
511110b
#1412 was fixed in a previous change but here I fix finding the tool
Nov 21, 2021
594a3b4
#1339 board manager board list and json list not sorted
Nov 21, 2021
01d8555
undo changes that should not have been checked in
Nov 21, 2021
e62a7cb
#1339 fix lots of todo's
Nov 21, 2021
6cbe857
#1339 fixing lots of TODO's mostly code related
Nov 23, 2021
9604219
#1380 as I was testing examples I fixed this
Nov 23, 2021
3db5f0f
purely testing stuff optimisations
Nov 25, 2021
39b14d6
Merge branch '#1339_Add_deserialisation_clases' of
Nov 25, 2021
94063a9
#1339 fix another null case
jantje Dec 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions io.sloeber.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Export-Package: cc.arduino.packages;x-internal:=true,
cc.arduino.packages.ssh;x-internal:=true,
io.sloeber.core;x-friends:="io.sloeber.tests",
io.sloeber.core.api,
io.sloeber.core.api.Json,
io.sloeber.core.builder;x-internal:=true,
io.sloeber.core.common;x-friends:="io.sloeber.tests",
io.sloeber.core.communication;x-internal:=true,
Expand Down
1 change: 0 additions & 1 deletion io.sloeber.core/config/pre_processing_platform_default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ recipe.objcopy.hex.pattern=${recipe.objcopy.bin.pattern}
archive_file=arduino.ar
archive_file_path=${build.path}/${archive_file}
runtime.ide.version=10812
build.system.path=${referenced.core.path}${DirectoryDelimiter}system
serial.port=${com_port}
build.project_name=${ProjName}

Expand Down
15 changes: 7 additions & 8 deletions io.sloeber.core/src/io/sloeber/core/Activator.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.sloeber.core;

import static io.sloeber.core.common.Const.*;
import static io.sloeber.core.managers.InternalPackageManager.*;
import static org.eclipse.core.resources.IResource.*;

import java.io.File;
Expand Down Expand Up @@ -42,13 +41,14 @@
import org.osgi.service.prefs.Preferences;

import cc.arduino.packages.discoverers.SloeberNetworkDiscovery;
import io.sloeber.core.api.PackageManager;
import io.sloeber.core.api.BoardsManager;
import io.sloeber.core.common.Common;
import io.sloeber.core.common.ConfigurationPreferences;
import io.sloeber.core.common.InstancePreferences;
import io.sloeber.core.listeners.ConfigurationChangeListener;
import io.sloeber.core.listeners.IndexerListener;
import io.sloeber.core.listeners.resourceChangeListener;
import io.sloeber.core.tools.PackageManager;

/**
* generated code
Expand Down Expand Up @@ -207,14 +207,13 @@ private static void initializeImportantVariables() {
try {
workspace.setDescription(workspaceDesc);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Common.log(new Status(IStatus.ERROR, CORE_PLUGIN_ID, e.getMessage(), e));
}
// Make sure some important variables are being initialized
InstancePreferences.setPrivateLibraryPaths(InstancePreferences.getPrivateLibraryPaths());
InstancePreferences.setPrivateHardwarePaths(InstancePreferences.getPrivateHardwarePaths());
InstancePreferences.setAutomaticallyImportLibraries(InstancePreferences.getAutomaticallyImportLibraries());
PackageManager.setJsonURLs(PackageManager.getJsonURLs());
BoardsManager.setJsonURLs(BoardsManager.getJsonURLs());
}

private void runPluginCoreStartInstantiatorJob() {
Expand Down Expand Up @@ -252,7 +251,7 @@ protected IStatus run(IProgressMonitor monitor) {

installOtherStuff();

startup_Pluging(monitor);
BoardsManager.startup_Pluging(monitor);

monitor.setTaskName("Done!");
if (InstancePreferences.useBonjour()) {
Expand Down Expand Up @@ -418,14 +417,14 @@ private static void installOtherStuff() {
}
if (!localMakePath.append(MAKE_EXE).toFile().exists()) {
IProgressMonitor monitor = new NullProgressMonitor();
Common.log(downloadAndInstall(MAKE_URL, MAKE_ZIP, localMakePath, false, monitor));
Common.log(PackageManager.downloadAndInstall(MAKE_URL, MAKE_ZIP, localMakePath, false, monitor));
}

// Install awk if needed
IPath localAwkPath = ConfigurationPreferences.getAwkPath();
if (!localAwkPath.append(AWK_EXE).toFile().exists()) {
IProgressMonitor monitor = new NullProgressMonitor();
Common.log(downloadAndInstall(AWK_URL, AWK_ZIP, localAwkPath, false, monitor));
Common.log(PackageManager.downloadAndInstall(AWK_URL, AWK_ZIP, localAwkPath, false, monitor));
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions io.sloeber.core/src/io/sloeber/core/Gson/GsonConverter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.sloeber.core.Gson;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

import io.sloeber.core.api.VersionNumber;

public class GsonConverter {
public static String getSafeString(JsonObject jsonObject, String fieldName) {
JsonElement field = jsonObject.get(fieldName);
if (field == null) {
return "no info found in file"; //$NON-NLS-1$
}
return field.getAsString();

}

public static VersionNumber getSafeVersion(JsonObject jsonObject, String fieldName) {
JsonElement field = jsonObject.get(fieldName);
if (field == null) {
return new VersionNumber("no version number provided"); //$NON-NLS-1$
}
return new VersionNumber(field.getAsString());

}

public static String getSafeString(JsonObject jsonObject, String fieldName1, String fieldName2) {
JsonElement field = jsonObject.get(fieldName1);
if (field != null) {
field = field.getAsJsonObject().get(fieldName2);
if (field != null) {
return field.getAsString();
}
}

return "no info found in file"; //$NON-NLS-1$

}

}
Loading