Skip to content

Commit 9b1422a

Browse files
author
jan
committed
Refactor rename/move to get some controll over the code
1 parent 7c9c628 commit 9b1422a

File tree

86 files changed

+984
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+984
-497
lines changed

io.sloeber.autoBuild/build.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ bin.includes = .,\
1010
icons/
1111
jars.compile.order = .
1212
src.includes = schema/,\
13-
src/,\
1413
template/,\
1514
icons/

io.sloeber.autoBuild/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@
20722072
<extension
20732073
point="org.eclipse.cdt.core.LanguageSettingsProvider">
20742074
<provider
2075-
class="io.sloeber.autoBuild.internal.AutoBuildLanguageSettingsProvider"
2075+
class="io.sloeber.autoBuild.extensionPoint.providers.AutoBuildLanguageSettingsProvider"
20762076
id="io.sloeber.autoBuild.AutoBuildLanguageSettingsProvider"
20772077
name="%autoBuildLanguageStingsProvider"
20782078
prefer-non-shared="false">

io.sloeber.autoBuild/src/io/sloeber/autoBuild/internal/AutoBuildLanguageSettingsProvider.java renamed to io.sloeber.autoBuild/src/io/sloeber/autoBuild/extensionPoint/providers/AutoBuildLanguageSettingsProvider.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Andrew Gvozdev - initial API and implementation
1313
*******************************************************************************/
1414

15-
package io.sloeber.autoBuild.internal;
15+
package io.sloeber.autoBuild.extensionPoint.providers;
1616

1717
import static io.sloeber.autoBuild.helpers.api.AutoBuildConstants.*;
1818

@@ -67,14 +67,15 @@
6767
import io.sloeber.autoBuild.api.IAutoBuildConfigurationDescription;
6868
import io.sloeber.autoBuild.core.Activator;
6969
import io.sloeber.autoBuild.core.Messages;
70-
import io.sloeber.autoBuild.extensionPoint.providers.InternalBuildRunner;
70+
import io.sloeber.autoBuild.internal.AutoBuildRunnerHelper;
7171
import io.sloeber.autoBuild.schema.api.IOption;
7272

7373
/**
7474
* Implementation of language settings provider for autoBuild.
7575
*/
7676
public class AutoBuildLanguageSettingsProvider extends AbstractExecutableExtensionBase
7777
implements ILanguageSettingsBroadcastingProvider {
78+
private static final boolean LOG_TO_STD_OUT =false;
7879

7980
private static final String SCANNER_DISCOVERY_CONSOLE = "io.Sloeber.autoBuild.ScannerDiscoveryConsole"; //$NON-NLS-1$
8081
private static final String SCANNER_DISCOVERY_GLOBAL_CONSOLE = "io.Sloeber.autoBuild.ScannerDiscoveryGlobalConsole"; //$NON-NLS-1$
@@ -332,8 +333,9 @@ private List<ICLanguageSettingEntry> runForLanguage(String currentLanguageId, St
332333
buildRunnerHelper.greeting(MessageFormat.format(
333334
Messages.RunningScannerDiscovery , getName())
334335
);
335-
336-
System.out.println(currentCommandResolved);
336+
if(LOG_TO_STD_OUT) {
337+
System.out.println(currentCommandResolved);
338+
}
337339
InternalBuildRunner.launchCommand(currentCommandResolved, autoConf,
338340
monitor, buildRunnerHelper);
339341

@@ -410,7 +412,9 @@ public void startup(ICConfigurationDescription cfgDescription, IWorkingDirectory
410412

411413
@Override
412414
public boolean processLine(String line) {
413-
System.out.println(line);
415+
if(LOG_TO_STD_OUT) {
416+
System.out.println(line);
417+
}
414418

415419
for (Entry<Pattern, outputTypes> curMatcher : outputMatchers.entrySet()) {
416420
Pattern pat = curMatcher.getKey();

io.sloeber.core/META-INF/MANIFEST.MF

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ Require-Bundle:
3232
Export-Package: cc.arduino.packages;x-internal:=true,
3333
cc.arduino.packages.discoverers;x-internal:=true,
3434
cc.arduino.packages.ssh;x-internal:=true,
35-
com.jcraft.jsch,
36-
com.jcraft.jsch.jce;uses:="com.jcraft.jsch",
37-
com.jcraft.jsch.jcraft;uses:="com.jcraft.jsch",
38-
com.jcraft.jsch.jgss;uses:="com.jcraft.jsch",
39-
io.sloeber.core;x-friends:="io.sloeber.tests",
40-
io.sloeber.core.Gson;uses:="com.google.gson,io.sloeber.core.api",
35+
io.sloeber.arduinoFramework.api,
4136
io.sloeber.core.api;
4237
uses:="io.sloeber.core.common,
4338
org.eclipse.debug.core.model,
@@ -48,20 +43,12 @@ Export-Package: cc.arduino.packages;x-internal:=true,
4843
org.eclipse.cdt.core.settings.model,
4944
org.eclipse.core.resources,
5045
io.sloeber.core.api.Json",
51-
io.sloeber.core.api.Json;uses:="org.eclipse.core.runtime,com.google.gson,io.sloeber.core.api",
52-
io.sloeber.core.builder;x-internal:=true,
5346
io.sloeber.core.common;x-friends:="io.sloeber.tests",
5447
io.sloeber.core.communication;x-internal:=true,
5548
io.sloeber.core.core;x-internal:=true,
56-
io.sloeber.core.eclipseIntegrations;uses:="org.eclipse.core.variables",
57-
io.sloeber.core.internal;x-friends:="io.sloeber.tests",
58-
io.sloeber.core.listeners;x-internal:=true,
59-
io.sloeber.core.managers;x-internal:=true,
49+
io.sloeber.core.internal,
6050
io.sloeber.core.natures;x-internal:=true,
6151
io.sloeber.core.templates;x-internal:=true,
62-
io.sloeber.core.toolchain;x-internal:=true,
63-
io.sloeber.core.tools;x-friends:="io.sloeber.tests",
64-
io.sloeber.core.tools.uploaders;x-internal:=true,
6552
io.sloeber.core.txt;x-friends:="io.sloeber.tests"
6653
Import-Package: io.sloeber.autoBuild.schema.api,
6754
org.apache.commons.io;version="2.13.0",

io.sloeber.core/src/io/sloeber/core/api/Json/ArduinoInstallable.java renamed to io.sloeber.core/src/io/sloeber/arduinoFramework/api/ArduinoInstallable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.sloeber.core.api.Json;
1+
package io.sloeber.arduinoFramework.api;
22

33
import org.eclipse.core.runtime.IPath;
44

io.sloeber.core/src/io/sloeber/core/api/BoardDescription.java renamed to io.sloeber.core/src/io/sloeber/arduinoFramework/api/BoardDescription.java

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package io.sloeber.core.api;
1+
package io.sloeber.arduinoFramework.api;
22

33
import static io.sloeber.core.Messages.*;
44
import static io.sloeber.core.api.Common.*;
@@ -26,11 +26,14 @@
2626
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
2727
import org.eclipse.core.runtime.preferences.InstanceScope;
2828

29+
import io.sloeber.arduinoFramework.internal.ArduinoPlatformTooldDependency;
2930
import io.sloeber.autoBuild.api.IAutoBuildConfigurationDescription;
3031
import io.sloeber.autoBuild.helpers.api.KeyValueTree;
31-
import io.sloeber.core.api.Json.ArduinoPlatform;
32-
import io.sloeber.core.api.Json.ArduinoPlatformTooldDependency;
33-
import io.sloeber.core.api.Json.ArduinoPlatformVersion;
32+
import io.sloeber.core.api.Common;
33+
import io.sloeber.core.api.ConfigurationPreferences;
34+
import io.sloeber.core.api.Const;
35+
import io.sloeber.core.api.Preferences;
36+
import io.sloeber.core.api.VersionNumber;
3437
import io.sloeber.core.tools.KeyValue;
3538
import io.sloeber.core.txt.BoardTxtFile;
3639
import io.sloeber.core.txt.PlatformTxtFile;
@@ -54,9 +57,9 @@ public class BoardDescription {
5457
private String myBoardsVariant = null;
5558
private String myUploadTool = null;
5659

57-
private ArduinoPlatformVersion myReferencedPlatformVariant = null;
58-
private ArduinoPlatformVersion myReferencedPlatformCore = null;
59-
private ArduinoPlatformVersion myReferencedPlatformUpload = null;
60+
private IArduinoPlatformVersion myReferencedPlatformVariant = null;
61+
private IArduinoPlatformVersion myReferencedPlatformCore = null;
62+
private IArduinoPlatformVersion myReferencedPlatformUpload = null;
6063

6164
private boolean isDirty = true;
6265

@@ -281,7 +284,7 @@ public static List<BoardDescription> makeBoardDescriptors(File boardFile) {
281284
* @param options
282285
* if null default options are taken
283286
*/
284-
BoardDescription(File boardsFile, String boardID, Map<String, String> options) {
287+
public BoardDescription(File boardsFile, String boardID, Map<String, String> options) {
285288
myBoardID = boardID;
286289
myUserSelectedBoardsTxtFile = boardsFile;
287290
mySloeberBoardTxtFile = new BoardTxtFile(resolvePathEnvironmentString(myUserSelectedBoardsTxtFile));
@@ -295,9 +298,9 @@ public BoardDescription() {
295298
myUserSelectedBoardsTxtFile = new File(myStorageNode.get(KEY_LAST_USED_BOARDS_FILE, EMPTY));
296299
if (!myUserSelectedBoardsTxtFile.exists()) {
297300

298-
ArduinoPlatformVersion platform = BoardsManager.getNewestInstalledPlatform(VENDOR_ARDUINO, AVR);
301+
IArduinoPlatformVersion platform = BoardsManager.getNewestInstalledPlatform(VENDOR_ARDUINO, AVR);
299302
if (platform == null) {
300-
List<ArduinoPlatformVersion> platforms = BoardsManager.getInstalledPlatforms();
303+
List<IArduinoPlatformVersion> platforms = BoardsManager.getInstalledPlatforms();
301304
//If you crash on the next line no platform have been installed
302305
platform = platforms.get(0);
303306
}
@@ -644,11 +647,11 @@ public IPath getreferencedCoreHardwarePath() {
644647
*/
645648
public IPath getArduinoPlatformPath() {
646649
updateWhenDirty();
647-
ArduinoPlatform platform = BoardsManager.getPlatform(VENDOR_ARDUINO, getArchitecture());
650+
IArduinoPlatform platform = BoardsManager.getPlatform(VENDOR_ARDUINO, getArchitecture());
648651
if (platform == null) {
649652
return null;
650653
}
651-
ArduinoPlatformVersion platformVersion = platform.getNewestInstalled();
654+
IArduinoPlatformVersion platformVersion = platform.getNewestInstalled();
652655
if (platformVersion == null) {
653656
return null;
654657
}
@@ -938,14 +941,14 @@ private Map<String, String> getEnVarPlatformInfo() {
938941
}
939942

940943
IPath referencingPlatformPath = getreferencingPlatformPath();
941-
ArduinoPlatformVersion referencingPlatform = BoardsManager.getPlatform(referencingPlatformPath);
944+
IArduinoPlatformVersion referencingPlatform = BoardsManager.getPlatform(referencingPlatformPath);
942945

943946
if (referencingPlatform == null) {
944947
// This is the case for private hardware
945948
//there is no need to specify tool path as they do not use them
946949
return ret;
947950
}
948-
ArduinoPlatformVersion latestArduinoPlatform = BoardsManager.getNewestInstalledPlatform(Const.VENDOR_ARDUINO,
951+
IArduinoPlatformVersion latestArduinoPlatform = BoardsManager.getNewestInstalledPlatform(Const.VENDOR_ARDUINO,
949952
referencingPlatform.getArchitecture());
950953
if (latestArduinoPlatform != null) {
951954
ret.putAll(getEnvVarPlatformFileTools(latestArduinoPlatform));
@@ -978,7 +981,7 @@ private Map<String, String> getEnVarPlatformInfo() {
978981
* @param platformVersion
979982
* @return environment variables pointing to the tools used by the platform
980983
*/
981-
private static Map<String, String> getEnvVarPlatformFileTools(ArduinoPlatformVersion platformVersion) {
984+
private static Map<String, String> getEnvVarPlatformFileTools(IArduinoPlatformVersion platformVersion) {
982985
HashMap<String, String> vars = new HashMap<>();
983986
for (ArduinoPlatformTooldDependency tool : platformVersion.getToolsDependencies()) {
984987
IPath installPath = tool.getInstallPath();

0 commit comments

Comments
 (0)