File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 146146 <WriteLinesToFile File =" $(MSBuildProjectDirectory)\Properties\launchSettings.json"
147147 Lines =" { }"
148148 Condition =" !Exists('$(MSBuildProjectDirectory)\Properties\launchSettings.json')" />
149+ <SortItems Items =" @(StartupFile)" >
150+ <Output TaskParameter =" SortedItems" ItemName =" SortedStartupFile" />
151+ </SortItems >
149152 <JsonPoke ContentPath =" $(MSBuildProjectDirectory)\Properties\launchSettings.json"
150- Query =" $.profiles['%(StartupFile .Filename)%(StartupFile .Extension)'].commandName"
151- Value =" Project" />
153+ Query =" $.profiles['%(SortedStartupFile .Filename)%(SortedStartupFile .Extension)'].commandName"
154+ Value =" Project" />
152155 </Target >
153156
154157 <ItemGroup >
155158 <!-- Ensure changes we make to this file trigger a new DTB -->
156159 <UpToDateCheckBuilt Include =" Properties\launchSettings.json" />
157160 </ItemGroup >
158161
162+ <UsingTask TaskName =" SortItems" TaskFactory =" RoslynCodeTaskFactory" AssemblyFile =" $(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
163+ <ParameterGroup >
164+ <!-- ITaskItem[] input and sorted output -->
165+ <Items ParameterType =" Microsoft.Build.Framework.ITaskItem[]" Required =" true" />
166+ <SortedItems ParameterType =" Microsoft.Build.Framework.ITaskItem[]" Output =" true" />
167+ </ParameterGroup >
168+ <Task >
169+ <Using Namespace =" System" />
170+ <Code Type =" Fragment" Language =" cs" >
171+ <![CDATA[
172+ SortedItems = Items.OrderBy(i => i.ItemSpec).ToArray();
173+ ]]>
174+ </Code >
175+ </Task >
176+ </UsingTask >
177+
159178</Project >
You can’t perform that action at this time.
0 commit comments