@@ -353,17 +353,26 @@ public static void setProjectPathVariables(IProject project, IPath platformPath)
353
353
354
354
try {
355
355
Path arduinoPath = new Path (pathMan .getURIValue (ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_ARDUINO ).getRawPath ());
356
- // Path ArduinoPath = new Path(ArduinoURI.toString());
357
- String prefix = "${" + ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_ARDUINO + "}/" ;
358
- String test = prefix + arduinoHardwareLibraryPath .makeRelativeTo (arduinoPath ).toString ();
359
- URI uriTest = URIUtil .toURI (test );
360
- pathMan .setURIValue (ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_HARDWARE_LIB , uriTest );
361
- test = prefix + platformPath .makeRelativeTo (arduinoPath ).toString ();
362
- uriTest = URIUtil .toURI (test );
363
- pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PLATFORM , uriTest );
364
- test = prefix + PinPath .makeRelativeTo (arduinoPath ).toString ();
365
- uriTest = URIUtil .toURI (test );
366
- pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PINS , uriTest );
356
+ // TODO the code below was changed for issue #34 (better multiple user support) but fails on Mac
357
+ // So i split it to use the old code on mac.
358
+ // but they should be merged
359
+ if (Platform .getOS ().equals (Platform .OS_MACOSX )) {
360
+ pathMan .setURIValue (ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_HARDWARE_LIB , URIUtil .toURI (arduinoHardwareLibraryPath ));
361
+ pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PLATFORM , URIUtil .toURI (platformPath ));
362
+ pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PINS , URIUtil .toURI (PinPath ));
363
+ } else {
364
+
365
+ String prefix = "${" + ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_ARDUINO + "}/" ;
366
+ String test = prefix + arduinoHardwareLibraryPath .makeRelativeTo (arduinoPath ).toString ();
367
+ URI uriTest = URIUtil .toURI (test );
368
+ pathMan .setURIValue (ArduinoConst .WORKSPACE_PATH_VARIABLE_NAME_HARDWARE_LIB , uriTest );
369
+ test = prefix + platformPath .makeRelativeTo (arduinoPath ).toString ();
370
+ uriTest = URIUtil .toURI (test );
371
+ pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PLATFORM , uriTest );
372
+ test = prefix + PinPath .makeRelativeTo (arduinoPath ).toString ();
373
+ uriTest = URIUtil .toURI (test );
374
+ pathMan .setURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PINS , uriTest );
375
+ }
367
376
} catch (CoreException e ) {
368
377
Common .log (new Status (IStatus .ERROR , ArduinoConst .CORE_PLUGIN_ID ,
369
378
"Failed to create the path variable variables. The setup will not work properly" , e ));
0 commit comments