Skip to content

Commit

Permalink
#1339 packages Seem to work.
Browse files Browse the repository at this point in the history
Still needs lots of cleanup
  • Loading branch information
jantje committed Nov 7, 2021
1 parent 3d8ae10 commit 6708628
Show file tree
Hide file tree
Showing 27 changed files with 2,270 additions and 2,212 deletions.
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$

}

}
54 changes: 0 additions & 54 deletions io.sloeber.core/src/io/sloeber/core/Gson/LibraryDeserializer.java

This file was deleted.

171 changes: 0 additions & 171 deletions io.sloeber.core/src/io/sloeber/core/Gson/LibraryIndexJson.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.InstanceScope;

import io.sloeber.core.api.Json.packages.ArduinoPlatform;
import io.sloeber.core.common.Common;
import io.sloeber.core.common.ConfigurationPreferences;
import io.sloeber.core.managers.ArduinoPlatform;
import io.sloeber.core.managers.InternalPackageManager;
import io.sloeber.core.tools.Helpers;
import io.sloeber.core.tools.KeyValue;
Expand Down
Loading

0 comments on commit 6708628

Please sign in to comment.