Skip to content

Commit e1cd692

Browse files
author
jantje
committed
#1339 starting to run regression test default ino on all boards
1 parent 36b6dca commit e1cd692

File tree

7 files changed

+572
-637
lines changed

7 files changed

+572
-637
lines changed

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

Lines changed: 93 additions & 153 deletions
Large diffs are not rendered by default.

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

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ public static Map<String, String> getEnvironmentVariables() {
568568
return myWorkbenchEnvironmentVariables;
569569
}
570570
myWorkbenchEnvironmentVariables.clear();
571-
ArduinoPlatformVersion latestAvrPlatform = null;
571+
ArduinoPlatformVersion latestAvrPlatform = getNewestInstalledPlatform(Const.ARDUINO, Const.AVR);
572572
ArduinoPlatformVersion latestSamdPlatform = null;
573573
ArduinoPlatformVersion latestSamPlatform = null;
574574
for (ArduinoPlatformVersion curPlatform : getInstalledPlatforms()) {
@@ -604,6 +604,22 @@ public static Map<String, String> getEnvironmentVariables() {
604604
return myWorkbenchEnvironmentVariables;
605605
}
606606

607+
/**
608+
* given a vendor and a architecture provide the newest installed platform
609+
* version
610+
*
611+
* @param vendor
612+
* @param architecture
613+
* @return the found platformVersion or null if none found
614+
*/
615+
public static ArduinoPlatformVersion getNewestInstalledPlatform(String vendor, String architecture) {
616+
ArduinoPlatform platform = getPlatform(vendor, architecture);
617+
if (platform == null) {
618+
return null;
619+
}
620+
return platform.getNewestInstalled();
621+
}
622+
607623
//Below is what used to be the internal package manager class
608624

609625
private static boolean myIsReady = false;
@@ -734,27 +750,6 @@ public static ArduinoPlatform getPlatform(String vendor, String architecture) {
734750
return null;
735751
}
736752

737-
public static IPath getPlatformInstallPath(String vendor, String architecture) {
738-
739-
ArduinoPlatform platform = getPlatform(vendor, architecture);
740-
if (platform != null) {
741-
ArduinoPlatformVersion latestInstall = platform.getNewestInstalled();
742-
if (latestInstall == null) {
743-
return null;
744-
}
745-
return latestInstall.getInstallPath();
746-
}
747-
return null;
748-
}
749-
750-
public static IPath getPlatformInstallPath(String refVendor, String refArchitecture, VersionNumber refVersion) {
751-
ArduinoPlatformVersion platformVersion = BoardsManager.getPlatform(refVendor, refArchitecture, refVersion);
752-
if (platformVersion != null) {
753-
return platformVersion.getInstallPath();
754-
}
755-
return null;
756-
}
757-
758753
/**
759754
* Given a platform.txt file find the platform in the platform manager
760755
*

io.sloeber.core/src/io/sloeber/core/common/Common.java

Lines changed: 71 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public class Common {
2929

3030
public final static String sloeberHome = getSloeberHome();
3131
public final static IPath sloeberHomePath = new Path(sloeberHome);
32-
public final static String sloeberHomePathToOSString = sloeberHomePath.toOSString();
3332
public final static String sloeberHomePathToString = sloeberHomePath.toString();
3433

3534
private static String getSloeberHome() {
@@ -54,68 +53,66 @@ private static String getSloeberHome() {
5453
e));
5554
}
5655
return null;
57-
}
58-
59-
56+
}
6057

6158
public static final boolean isWindows = Platform.getOS().equals(Platform.OS_WIN32);
6259
public static final boolean isLinux = Platform.getOS().equals(Platform.OS_LINUX);
6360
public static final boolean isMac = Platform.getOS().equals(Platform.OS_MACOSX);
6461

65-
6662
/**
6763
* This method makes sure that a string can be used as a file or folder name
6864
* <br/>
6965
* To do this it replaces all unacceptable characters with underscores.<br/>
7066
* Currently it replaces (based on http://en.wikipedia.org/wiki/Filename ) /
7167
* slash used as a path name component separator in Unix-like, Windows, and
7268
* Amiga systems. (The MS-DOS command.com shell would consume it as a switch
73-
* character, but Windows itself always accepts it as a
69+
* character, but Windows itself always accepts it as a
7470
* separator.[6][vague]) \ backslash Also used as a path name component
7571
* separator in MS-DOS, OS/2 and Windows (where there are few differences
7672
* between slash and backslash); allowed in Unix filenames, see Note 1 ?
77-
* question mark used as a wildcard in Unix, Windows and AmigaOS; marks a
78-
* single character. Allowed in Unix filenames, see Note 1 % percent used as
79-
* a wildcard in RT-11; marks a single character. asterisk or star used as a
80-
* wildcard in Unix, MS-DOS, RT-11, VMS and Windows. Marks any sequence of
81-
* characters (Unix, Windows, later versions of MS-DOS) or any sequence of
82-
* characters in either the basename or extension (thus "*.*" in early
83-
* versions of MS-DOS means "all files". Allowed in Unix filenames, see note
84-
* 1 : colon used to determine the mount point / drive on Windows; used to
85-
* determine the virtual device or physical device such as a drive on
86-
* AmigaOS, RT-11 and VMS; used as a pathname separator in classic Mac OS.
87-
* Doubled after a name on VMS, indicates the DECnet nodename (equivalent to
88-
* a NetBIOS (Windows networking) hostname preceded by "\\".) | vertical bar
89-
* or pipe designates software pipelining in Unix and Windows; allowed in
90-
* Unix filenames, see Note 1 " quote used to mark beginning and end of
91-
* filenames containing spaces in Windows, see Note 1 < less than used to
92-
* redirect input, allowed in Unix filenames, see Note 1 > greater than used
93-
* to redirect output, allowed in Unix filenames, see Note 1 . period or dot
73+
* question mark used as a wildcard in Unix, Windows and AmigaOS; marks a
74+
* single character. Allowed in Unix filenames, see Note 1 % percent used as
75+
* a wildcard in RT-11; marks a single character. asterisk or star used as a
76+
* wildcard in Unix, MS-DOS, RT-11, VMS and Windows. Marks any sequence of
77+
* characters (Unix, Windows, later versions of MS-DOS) or any sequence of
78+
* characters in either the basename or extension (thus "*.*" in early
79+
* versions of MS-DOS means "all files". Allowed in Unix filenames, see note
80+
* 1 : colon used to determine the mount point / drive on Windows; used to
81+
* determine the virtual device or physical device such as a drive on
82+
* AmigaOS, RT-11 and VMS; used as a pathname separator in classic Mac OS.
83+
* Doubled after a name on VMS, indicates the DECnet nodename (equivalent to
84+
* a NetBIOS (Windows networking) hostname preceded by "\\".) | vertical bar
85+
* or pipe designates software pipelining in Unix and Windows; allowed in
86+
* Unix filenames, see Note 1 " quote used to mark beginning and end of
87+
* filenames containing spaces in Windows, see Note 1 < less than used to
88+
* redirect input, allowed in Unix filenames, see Note 1 > greater than used
89+
* to redirect output, allowed in Unix filenames, see Note 1 . period or dot
9490
*
95-
* # is excluded as it is seen as a special character by make
96-
=======
97-
* character, but Windows itself always accepts it as a separator.[6][vague]) \
98-
* backslash Also used as a path name component separator in MS-DOS, OS/2 and
99-
* Windows (where there are few differences between slash and backslash);
100-
* allowed in Unix filenames, see Note 1 ? question mark used as a wildcard in
101-
* Unix, Windows and AmigaOS; marks a single character. Allowed in Unix
102-
* filenames, see Note 1 % percent used as a wildcard in RT-11; marks a single
103-
* character. asterisk or star used as a wildcard in Unix, MS-DOS, RT-11, VMS
104-
* and Windows. Marks any sequence of characters (Unix, Windows, later versions
105-
* of MS-DOS) or any sequence of characters in either the basename or extension
106-
* (thus "*.*" in early versions of MS-DOS means "all files". Allowed in Unix
107-
* filenames, see note 1 : colon used to determine the mount point / drive on
108-
* Windows; used to determine the virtual device or physical device such as a
109-
* drive on AmigaOS, RT-11 and VMS; used as a pathname separator in classic Mac
110-
* OS. Doubled after a name on VMS, indicates the DECnet nodename (equivalent to
111-
* a NetBIOS (Windows networking) hostname preceded by "\\".) | vertical bar or
112-
* pipe designates software pipelining in Unix and Windows; allowed in Unix
91+
* # is excluded as it is seen as a special character by make
92+
* =======
93+
* character, but Windows itself always accepts it as a separator.[6][vague]) \
94+
* backslash Also used as a path name component separator in MS-DOS, OS/2 and
95+
* Windows (where there are few differences between slash and backslash);
96+
* allowed in Unix filenames, see Note 1 ? question mark used as a wildcard in
97+
* Unix, Windows and AmigaOS; marks a single character. Allowed in Unix
98+
* filenames, see Note 1 % percent used as a wildcard in RT-11; marks a single
99+
* character. asterisk or star used as a wildcard in Unix, MS-DOS, RT-11, VMS
100+
* and Windows. Marks any sequence of characters (Unix, Windows, later versions
101+
* of MS-DOS) or any sequence of characters in either the basename or extension
102+
* (thus "*.*" in early versions of MS-DOS means "all files". Allowed in Unix
103+
* filenames, see note 1 : colon used to determine the mount point / drive on
104+
* Windows; used to determine the virtual device or physical device such as a
105+
* drive on AmigaOS, RT-11 and VMS; used as a pathname separator in classic Mac
106+
* OS. Doubled after a name on VMS, indicates the DECnet nodename (equivalent to
107+
* a NetBIOS (Windows networking) hostname preceded by "\\".) | vertical bar or
108+
* pipe designates software pipelining in Unix and Windows; allowed in Unix
113109
* filenames, see Note 1 " quote used to mark beginning and end of filenames
114110
* containing spaces in Windows, see Note 1 < less than used to redirect input,
115111
* allowed in Unix filenames, see Note 1 > greater than used to redirect output,
116-
* allowed in Unix filenames, see Note 1 . period or dot
112+
* allowed in Unix filenames, see Note 1 . period or dot
117113
*
118-
* @param name the string that needs to be checked
114+
* @param name
115+
* the string that needs to be checked
119116
* @return a name safe to create files or folders
120117
*/
121118
public static String MakeNameCompileSafe(String name) {
@@ -127,7 +124,6 @@ public static String MakeNameCompileSafe(String name) {
127124
return ret;
128125
}
129126

130-
131127
/**
132128
* Logs the status information if status is OK then nothing happens
133129
*
@@ -145,23 +141,26 @@ public static void log(IStatus status) {
145141
stMan.handle(status, style);
146142
break;
147143
}
148-
case SLOEBER_STATUS_DEBUG:
144+
case SLOEBER_STATUS_DEBUG:
149145
// break;//remove break to add debugging
150-
default:
146+
default:
151147
Activator.getDefault().getLog().log(status);
152148
}
153149
}
154150

155-
156151
/**
157152
*
158153
* Provides the build environment variable based on project and string This
159154
* method does not add any knowledge.(like adding A.)
160155
*
161-
* @param project the project that contains the environment variable
162-
* @param configName the project configuration to use
163-
* @param envName the key that describes the variable
164-
* @param defaultvalue The return value if the variable is not found.
156+
* @param project
157+
* the project that contains the environment variable
158+
* @param configName
159+
* the project configuration to use
160+
* @param envName
161+
* the key that describes the variable
162+
* @param defaultvalue
163+
* The return value if the variable is not found.
165164
* @return The expanded build environment variable
166165
*/
167166
static public String getBuildEnvironmentVariable(IProject project, String configName, String envName,
@@ -175,10 +174,13 @@ static public String getBuildEnvironmentVariable(IProject project, String config
175174
* Provides the build environment variable based on project and string This
176175
* method does not add any knowledge.(like adding A.)
177176
*
178-
* @param project the project that contains the environment variable
177+
* @param project
178+
* the project that contains the environment variable
179179
*
180-
* @param envName the key that describes the variable
181-
* @param defaultvalue The return value if the variable is not found.
180+
* @param envName
181+
* the key that describes the variable
182+
* @param defaultvalue
183+
* The return value if the variable is not found.
182184
* @return The expanded build environment variable
183185
*/
184186
static public String getBuildEnvironmentVariable(IProject project, String envName, String defaultvalue) {
@@ -191,9 +193,12 @@ static public String getBuildEnvironmentVariable(IProject project, String envNam
191193
* Provides the build environment variable based on project and string This
192194
* method does not add any knowledge.(like adding A.)
193195
*
194-
* @param project the project that contains the environment variable
195-
* @param envName the key that describes the variable
196-
* @param defaultvalue The return value if the variable is not found.
196+
* @param project
197+
* the project that contains the environment variable
198+
* @param envName
199+
* the key that describes the variable
200+
* @param defaultvalue
201+
* The return value if the variable is not found.
197202
* @return The expanded build environment variable
198203
*/
199204
static public String getBuildEnvironmentVariable(ICConfigurationDescription configurationDescription,
@@ -229,25 +234,24 @@ public static IPath getWorkspaceRoot() {
229234
* @return modified string or the original
230235
*/
231236
public static String makePathEnvironmentString(IPath path) {
232-
return path.toOSString().replace(sloeberHomePathToOSString, SLOEBER_HOME_VAR);
233-
}
234-
235-
public static String makePathEnvironmentString(File file) {
236-
return file.getPath().replace(sloeberHomePathToOSString, SLOEBER_HOME_VAR);
237+
return path.toOSString().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
237238
}
238239

239240
public static String makePathVersionString(File file) {
240-
String osPathString = file.getPath();
241-
IPath path = new Path(osPathString);
242-
return path.toString().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
241+
return file.getPath().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
243242
}
244243

244+
/**
245+
* Support for the environment variable SLOBER_HOME
246+
*
247+
* @param file
248+
* @return
249+
*/
245250
public static File resolvePathEnvironmentString(File file) {
246-
String retString = file.getPath().replace(SLOEBER_HOME_VAR, sloeberHomePathToOSString);
251+
String retString = file.getPath().replace(SLOEBER_HOME_VAR, sloeberHomePathToString);
247252
return new File(retString);
248253
}
249254

250-
251255
/**
252256
* Converts a name to a tagged environment variable if variableName ="this" the
253257
* output is "${this}"
@@ -273,5 +277,4 @@ static public String getOldWayEnvVar(ICConfigurationDescription confDesc, String
273277
getBuildEnvironmentVariable(confDesc, envName.toUpperCase(), EMPTY, true), true);
274278
}
275279

276-
277280
}

0 commit comments

Comments
 (0)