@@ -574,6 +574,12 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
574
574
var = new EnvironmentVariable (ENV_KEY_archive_file , "arduino.ar" );
575
575
contribEnv .addVariable (var , confDesc );
576
576
577
+ IPathVariableManager pathMan = confDesc .getProjectDescription ().getProject ().getPathVariableManager ();
578
+ URI buildVariantURI = pathMan .getURIValue (ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PINS );
579
+ buildVariantURI = pathMan .resolveURI (buildVariantURI );
580
+ String buildVariantPath = buildVariantURI .getPath () + "/${" + ArduinoConst .ENV_KEY_build_variant + "}" ;
581
+ var = new EnvironmentVariable (ENV_KEY_build_variant_path , buildVariantPath );
582
+ contribEnv .addVariable (var , confDesc );
577
583
// IPath platformPath = new Path(arduinoProperties.getPlatformFolder());
578
584
// IPath PinPath = platformPath.append(ArduinoConst.VARIANTS_FOLDER);
579
585
@@ -773,18 +779,11 @@ public static void setTheEnvironmentVariables(IProject project, ICConfigurationD
773
779
* @param confDesc
774
780
*/
775
781
private static void setTheEnvironmentVariablesPostProcessing (IContributedEnvironment contribEnv , ICConfigurationDescription confDesc ) {
776
- IPathVariableManager pathMan = confDesc .getProjectDescription ().getProject ().getPathVariableManager ();
777
-
778
- // TODO consider moving this to the set defaults (not sure why this is here. If it needs to be here document why
779
- IEnvironmentVariable var = new EnvironmentVariable (ENV_KEY_build_variant_path , pathMan .getURIValue (
780
- ArduinoConst .PATH_VARIABLE_NAME_ARDUINO_PINS ).getPath ()
781
- + "/${" + ArduinoConst .ENV_KEY_build_variant + "}" );
782
- contribEnv .addVariable (var , confDesc );
783
782
784
783
String recipes [] = { ENV_KEY_recipe_c_o_pattern , ENV_KEY_recipe_cpp_o_pattern , ENV_KEY_recipe_S_o_pattern ,
785
784
ENV_KEY_recipe_objcopy_hex_pattern , ENV_KEY_recipe_objcopy_eep_pattern , ENV_KEY_recipe_size_pattern , ENV_KEY_recipe_AR_pattern ,
786
785
ENV_KEY_recipe_c_combine_pattern };
787
- var = null ;
786
+ IEnvironmentVariable var = null ;
788
787
for (int curRecipe = 0 ; curRecipe < recipes .length ; curRecipe ++) {
789
788
String recipe = getBuildEnvironmentVariable (confDesc , recipes [curRecipe ], "" , false );
790
789
0 commit comments