@@ -915,18 +915,37 @@ private static void EmitTaskItemArraySwitch(CommandLineBuilder builder, ToolSwit
915915 ITaskItem [ ] taskItemArray = toolSwitch . TaskItemArray ;
916916 foreach ( ITaskItem taskItem in taskItemArray )
917917 {
918+ #if __REMOVE
918919 builder . AppendSwitchIfNotNull ( toolSwitch . SwitchValue , Environment . ExpandEnvironmentVariables ( taskItem . ItemSpec ) ) ;
920+ #else
921+ var ExpandItemSpec = Environment . ExpandEnvironmentVariables ( toolSwitch . TaskItem . ItemSpec ) ;
922+ if ( toolSwitch . TaskItemFullPath )
923+ {
924+ ExpandItemSpec = FileUtilities . NormalizePath ( ExpandItemSpec ) ;
925+ }
926+
927+ builder . AppendSwitchIfNotNull ( toolSwitch . SwitchValue , ExpandItemSpec ) ;
928+ #endif
919929 }
920930 return ;
921931 }
922932 ITaskItem [ ] array = new ITaskItem [ toolSwitch . TaskItemArray . Length ] ;
923933 for ( int j = 0 ; j < toolSwitch . TaskItemArray . Length ; j ++ )
924934 {
935+ #if __REMOVE
925936 array [ j ] = new TaskItem ( Environment . ExpandEnvironmentVariables ( toolSwitch . TaskItemArray [ j ] . ItemSpec ) ) ;
926- //if (format == CommandLineFormat.ForTracking)
927- //{
928- // array[j].ItemSpec = array[j].ItemSpec.ToUpperInvariant();
929- //}
937+ if ( format == CommandLineFormat . ForTracking )
938+ {
939+ array [ j ] . ItemSpec = array [ j ] . ItemSpec . ToUpperInvariant ( ) ;
940+ }
941+ #else
942+ var ExpandItemSpec = Environment . ExpandEnvironmentVariables ( toolSwitch . TaskItemArray [ j ] . ItemSpec ) ;
943+ if ( toolSwitch . TaskItemFullPath )
944+ {
945+ ExpandItemSpec = FileUtilities . NormalizePath ( ExpandItemSpec ) ;
946+ }
947+ array [ j ] = new TaskItem ( ExpandItemSpec ) ;
948+ #endif
930949 }
931950 builder . AppendSwitchIfNotNull ( toolSwitch . SwitchValue , array , toolSwitch . Separator ) ;
932951 }
@@ -935,7 +954,16 @@ private static void EmitTaskItemSwitch(CommandLineBuilder builder, ToolSwitch to
935954 {
936955 if ( ! string . IsNullOrEmpty ( toolSwitch . TaskItem . ItemSpec ) )
937956 {
957+ #if __REMOVE
938958 builder . AppendFileNameIfNotNull ( Environment . ExpandEnvironmentVariables ( toolSwitch . TaskItem . ItemSpec + toolSwitch . Separator ) ) ;
959+ #else
960+ var ExpandItemSpec = Environment . ExpandEnvironmentVariables ( toolSwitch . TaskItem . ItemSpec ) ;
961+ if ( toolSwitch . TaskItemFullPath )
962+ {
963+ ExpandItemSpec = FileUtilities . NormalizePath ( ExpandItemSpec ) ;
964+ }
965+ builder . AppendFileNameIfNotNull ( ExpandItemSpec + toolSwitch . Separator ) ;
966+ #endif
939967 }
940968 }
941969
0 commit comments