@@ -75,6 +75,7 @@ public class Helpers extends Common {
75
75
76
76
private static final String ENV_KEY_BUILD_ARCH = ERASE_START + "build.arch" ; //$NON-NLS-1$
77
77
private static final String ENV_KEY_BUILD_PATH = ERASE_START + "build.path" ; //$NON-NLS-1$
78
+ private static final String ENV_KEY_BUILD_SOURCE_PATH = ERASE_START + "build.source.path" ; //$NON-NLS-1$
78
79
private static final String ENV_KEY_BUILD_GENERIC_PATH = ERASE_START + "build.generic.path" ; //$NON-NLS-1$
79
80
private static final String ENV_KEY_HARDWARE_PATH = ERASE_START + "runtime.hardware.path" ; //$NON-NLS-1$
80
81
private static final String ENV_KEY_PLATFORM_PATH = ERASE_START + "runtime.platform.path" ; //$NON-NLS-1$
@@ -431,31 +432,33 @@ private static void removeAllEraseEnvironmentVariables(IContributedEnvironment c
431
432
* needed for avr and sam
432
433
*/
433
434
434
- private static void setTheEnvironmentVariablesSetTheDefaults (String projectName , IContributedEnvironment contribEnv ,
435
+ private static void setTheEnvironmentVariablesSetTheDefaults (IProject project , IContributedEnvironment contribEnv ,
435
436
ICConfigurationDescription confDesc , BoardDescriptor boardDescriptor ) {
436
437
// Set some default values because the platform.txt does not contain
437
438
// them
438
- IPath platformPath = boardDescriptor .getreferencingPlatformPath ();
439
- IPath hardwarePath = boardDescriptor .getreferencedHardwarePath ();
440
439
String architecture = boardDescriptor .getArchitecture ();
441
440
442
441
boardDescriptor .saveConfiguration (confDesc , contribEnv );
443
442
setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_BUILD_ARCH , architecture .toUpperCase ());
444
- setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_HARDWARE_PATH , hardwarePath .toString ());
445
- setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_PLATFORM_PATH , platformPath .toString ());
443
+ setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_HARDWARE_PATH ,
444
+ boardDescriptor .getreferencedHardwarePath ());
445
+ setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_PLATFORM_PATH ,
446
+ boardDescriptor .getreferencingPlatformPath ());
447
+ setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_BUILD_SOURCE_PATH , project .getLocation ());
448
+ // ={ProjDirPath}
449
+
446
450
// work around needed because of
447
451
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=560330
448
452
// it should have been
449
453
// A.BUILD.PATH={ProjDirPath}{DirectoryDelimiter}{ConfigName}
450
454
// in pre_processing_platform_default.txt
451
- String buildPath = confDesc .getProjectDescription ().getProject ().getLocation ().append (confDesc .getName ())
452
- .toOSString ();
455
+ IPath buildPath = confDesc .getProjectDescription ().getProject ().getLocation ().append (confDesc .getName ());
453
456
setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_BUILD_PATH , buildPath );
454
457
// end of workaround
455
458
456
459
if (Const .isWindows ) {
457
460
setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_JANTJE_MAKE_LOCATION ,
458
- ConfigurationPreferences .getMakePath ().toOSString () + File . separator );
461
+ ConfigurationPreferences .getMakePath ().addTrailingSeparator () );
459
462
}
460
463
461
464
// some glue to make it work
@@ -476,7 +479,7 @@ private static void setTheEnvironmentVariablesSetTheDefaults(String projectName,
476
479
477
480
}
478
481
479
- private static void setTheEnvironmentVariablesAddAFile (IContributedEnvironment contribEnv ,
482
+ private static void setTheEnvironmentVariablesAddAFile (IContributedEnvironment contribEnv ,
480
483
ICConfigurationDescription confDesc , File envVarFile ) {
481
484
setTheEnvironmentVariablesAddAFile (ERASE_START , contribEnv , confDesc , envVarFile );
482
485
}
@@ -638,12 +641,12 @@ private static void addDependentTools(Iterable<ToolDependency> tools, IContribut
638
641
+ tool .getVersion () + " Installpath is null" )); //$NON-NLS-1$
639
642
}
640
643
} else {
641
- String valueString = theTool .getInstallPath (). toOSString ();
642
- setBuildEnvironmentVariable (contribEnv , confDesc , keyString , valueString );
644
+ IPath installPath = theTool .getInstallPath ();
645
+ setBuildEnvironmentVariable (contribEnv , confDesc , keyString , installPath );
643
646
keyString = MakeKeyString ("runtime.tools." + tool .getName () + tool .getVersion () + ".path" ); //$NON-NLS-1$ //$NON-NLS-2$
644
- setBuildEnvironmentVariable (contribEnv , confDesc , keyString , valueString );
647
+ setBuildEnvironmentVariable (contribEnv , confDesc , keyString , installPath );
645
648
keyString = MakeKeyString ("runtime.tools." + tool .getName () + '-' + tool .getVersion () + ".path" ); //$NON-NLS-1$ //$NON-NLS-2$
646
- setBuildEnvironmentVariable (contribEnv , confDesc , keyString , valueString );
649
+ setBuildEnvironmentVariable (contribEnv , confDesc , keyString , installPath );
647
650
}
648
651
}
649
652
@@ -715,7 +718,7 @@ public static void setTheEnvironmentVariables(IProject project, ICConfigurationD
715
718
// first remove all Arduino Variables so there is no memory effect
716
719
removeAllEraseEnvironmentVariables (contribEnv , confDesc );
717
720
718
- setTheEnvironmentVariablesSetTheDefaults (project . getName () , contribEnv , confDesc , boardsDescriptor );
721
+ setTheEnvironmentVariablesSetTheDefaults (project , contribEnv , confDesc , boardsDescriptor );
719
722
720
723
// add the stuff that comes with the plugin that are marked as pre
721
724
setTheEnvironmentVariablesAddAFile (new String (), contribEnv , confDesc , pluginPreProcessingPlatformTxt );
0 commit comments