Skip to content

Commit 9559d84

Browse files
author
jan
committed
Use OS specific path delimiters (to make esp32 V3.0.7 work
Use toOSString instead of toString Introduce the global variable PATH_SEPERATOR Use ${PathDelimiter} or PATH_SEPERATOR instead of / This also requires a new version string for the sloeber.txt file
1 parent 39b0ec7 commit 9559d84

File tree

13 files changed

+18
-17
lines changed

13 files changed

+18
-17
lines changed

io.sloeber.autoBuild/src/io/sloeber/autoBuild/api/AutoBuildCommon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static public String GetNiceFileName(IFolder buildPath, IFile path) {
368368
static public String GetNiceFileName(IPath buildPath, IPath filePath) {
369369
String ret;
370370
if (buildPath.isPrefixOf(filePath) || buildPath.removeLastSegments(3).isPrefixOf(filePath)) {
371-
ret = filePath.makeRelativeTo(buildPath).toString();
371+
ret = filePath.makeRelativeTo(buildPath).toOSString();
372372
} else {
373373
ret = filePath.toString();
374374
}

io.sloeber.autoBuild/src/io/sloeber/autoBuild/buildTools/internal/CDTBuildTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public String getPathExtension() {
9696

9797
@Override
9898
public String getDiscoveryCommand(ToolType toolType) {
99-
return getToolLocation().append( getCommand(toolType)).toString() + DISCOVERY_PARAMETERS;
99+
return getToolLocation().append( getCommand(toolType)).toOSString() + DISCOVERY_PARAMETERS;
100100
}
101101

102102
@Override

io.sloeber.autoBuild/src/io/sloeber/autoBuild/buildTools/internal/MinGWBuildTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public String getPathExtension() {
9292

9393
@Override
9494
public String getDiscoveryCommand(ToolType toolType) {
95-
return getToolLocation().append( getCommand(toolType)).toString() +DISCOVERY_PARAMETERS;
95+
return getToolLocation().append( getCommand(toolType)).toOSString() +DISCOVERY_PARAMETERS;
9696
}
9797

9898
@Override

io.sloeber.autoBuild/src/io/sloeber/autoBuild/extensionPoint/providers/AutoBuildMakeRule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public String[] getRecipes(IFolder buildFolder, AutoBuildConfigurationDescriptio
288288
IFile file = project.getWorkspace().getRoot()
289289
.getFile(IPath.forPosix(curEntry.getValue()));
290290
includeFiles = includeFiles + WHITESPACE + DOUBLE_QUOTE + CMD_LINE_INCLUDE_FILE
291-
+ file.getLocation().toString() + DOUBLE_QUOTE;
291+
+ file.getLocation().toOSString() + DOUBLE_QUOTE;
292292
break;
293293
}
294294
case ICSettingEntry.INCLUDE_PATH: {
@@ -300,7 +300,7 @@ public String[] getRecipes(IFolder buildFolder, AutoBuildConfigurationDescriptio
300300

301301
}else {
302302
includePath = includePath + WHITESPACE + DOUBLE_QUOTE + CMD_LINE_INCLUDE_FOLDER
303-
+ path.toString() + DOUBLE_QUOTE;
303+
+ path.toOSString() + DOUBLE_QUOTE;
304304
}
305305
break;
306306
}

io.sloeber.autoBuild/src/io/sloeber/autoBuild/helpers/api/AutoBuildConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class AutoBuildConstants {
4343
public static final String PROCENT = "%";
4444
public static final String SLACH = "/";
4545
public static final String BACKSLACH = "\\";
46+
public static final String PATH_SEPERATOR=isWindows?BACKSLACH:SLACH;
4647
public static final String FALSE = "FALSE";
4748
public static final String TRUE = "TRUE";
4849
public static final String COLON = ":";

io.sloeber.autoBuild/src/io/sloeber/autoBuild/schema/internal/Tool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ public String[] getRecipes(IAutoBuildConfigurationDescription autoBuildConfData,
562562
IPath toolPath = buildTools.getToolLocation();
563563
if (toolPath != null && !toolPath.toString().isBlank()) {
564564
//store the path
565-
toolCommandVars.put(CMD_LINE_TOOL_PATH, toolPath.toString().trim() + SLACH);
565+
toolCommandVars.put(CMD_LINE_TOOL_PATH, toolPath.toOSString().trim() + PATH_SEPERATOR);
566566
}
567567
Map<String, String> toolVariables = buildTools.getToolVariables();
568568
if (toolVariables != null && toolVariables.size() > 0) {

io.sloeber.core/config/pre_processing_platform_default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#this file contains default/fallback/rescue values
22
software=ARDUINO
33
archive_file=arduino.ar
4-
archive_file_path=${build.path}/${archive_file}
4+
archive_file_path=${build.path}${PathDelimiter}${archive_file}
55
ide_version=20302
66

77
serial.port=${com_port}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
import io.sloeber.core.txt.TxtFile;
4646

4747
public class BoardDescription {
48-
private static final String FIRST_SLOEBER_LINE = "#Sloeber created file please do not modify V1.00.test 06 "; //$NON-NLS-1$
48+
private static final String FIRST_SLOEBER_LINE = "#Sloeber created file please do not modify V1.00.test 07 "; //$NON-NLS-1$
4949
private static final IEclipsePreferences myStorageNode = InstanceScope.INSTANCE.getNode(NODE_ARDUINO);
5050

5151
/*
@@ -1072,7 +1072,7 @@ private Map<String, String> getEnvVarPlatformFileTools(IArduinoPlatformVersion p
10721072
for (ArduinoPlatformTooldDependency tool : platformVersion.getToolsDependencies()) {
10731073
IPath installPath = tool.getInstallPath();
10741074
if (installPath.toFile().exists()) {
1075-
String value = installPath.toString();
1075+
String value = installPath.toOSString();
10761076
String keyString = ENV_KEY_RUNTIME_TOOLS + tool.getName() + tool.getVersion() + DOT_PATH;
10771077
vars = vars + NEWLINE + keyString + EQUAL + value;
10781078
keyString = ENV_KEY_RUNTIME_TOOLS + tool.getName() + '-' + tool.getVersion() + DOT_PATH;

io.sloeber.core/src/io/sloeber/arduinoFramework/api/BoardsManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ private static IStatus uninstall(IArduinoPlatformVersion curPlatform) {
416416
deleteDirectory(installFolder);
417417
envVarsNeedUpdating = true;
418418
} catch (IOException e) {
419-
return new Status(IStatus.ERROR, Activator.getId(), "Failed to remove folder" + installFolder.toString(), //$NON-NLS-1$
419+
return new Status(IStatus.ERROR, Activator.getId(), "Failed to remove folder" + installFolder.toOSString(), //$NON-NLS-1$
420420
e);
421421
}
422422

io.sloeber.core/src/io/sloeber/arduinoFramework/api/LibraryManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static IStatus unInstall(IArduinoLibraryVersion lib, IProgressMonitor mon
174174
deleteDirectory(lib.getInstallPath().removeLastSegments(1));
175175
} catch (IOException e) {
176176
return new Status(IStatus.ERROR, Activator.getId(),
177-
"Failed to remove folder" + lib.getInstallPath().toString(), //$NON-NLS-1$
177+
"Failed to remove folder" + lib.getInstallPath().toOSString(), //$NON-NLS-1$
178178
e);
179179
}
180180

0 commit comments

Comments
 (0)