Сборка XAML помечает источники в начале сборки, а сборка vNext, похоже, помечает в конце сборки. Я заметил это, потому что я изменяю/проверяю/маркирую файлы во время сборки. Если я позволю vNext пометить сборку, она переместит метку, которую я применил к файлам после возврата, на предыдущую версию (версию, которая использовалась в GetSources).
Но я не видел маркировки vNext ни в одном лог-файле. Я пропустил это? Мне придется отключить маркировку в vnext и сделать это в моем скрипте msbuild...
edit: отключена маркировка в определении сборки vnext и создана встроенная задача msbuild для маркировки источников рабочей области. Теперь я могу пометить все исходники в начале сборки и переместить метку для файлов, которые были изменены во время сборки :)
Если кто-то хочет сделать что-то подобное, вот моя встроенная задача:
<!--
TaskName="LabelWorkspaceSources"
- input: TfexeFullPath is the path to tf.exe
- input: BaseDirectory is the mapped folder of the software to build
- input: Label to apply
- input: Version is the changeset to apply the label to
-->
<UsingTask TaskName="LabelWorkspaceSources" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<TfexeFullPath Required="true" />
<BaseDirectory Required="true" />
<Label Required="true" />
<Version Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
//--- get the workspace mapping ---
System.Diagnostics.Process tfProcess = new System.Diagnostics.Process();
tfProcess.StartInfo.FileName = TfexeFullPath;
tfProcess.StartInfo.Arguments = "workfold";
tfProcess.StartInfo.UseShellExecute = false;
tfProcess.StartInfo.CreateNoWindow = true;
tfProcess.StartInfo.RedirectStandardOutput = true;
tfProcess.StartInfo.WorkingDirectory = BaseDirectory;
tfProcess.Start();
string output = tfProcess.StandardOutput.ReadToEnd();
tfProcess.WaitForExit();
string workfoldOutput = output.Trim();
Log.LogMessage(workfoldOutput, MessageImportance.High);
string[] linesWorkfoldOutput = workfoldOutput.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
List<string> mappedFolders = new List<string>();
Log.LogMessage("Trying to parse mapped folders.", MessageImportance.High);
foreach (string line in linesWorkfoldOutput)
{
//e.g. $/TPA: C:\TFS_Source\TPA
if (line.Contains("$/"))
{
string[] lineSplit = line.Split(new string[] { ": " }, StringSplitOptions.RemoveEmptyEntries);
//entry lineSplit[0] now contains the server path, lineSplit[1] contains the local folder
mappedFolders.Add(lineSplit[1]);
Log.LogMessage("Found mapped folder: " + lineSplit[1], MessageImportance.High);
}
}
//--- label all the mapped folders ---
foreach (string mappedFolder in mappedFolders)
{
tfProcess = new System.Diagnostics.Process();
tfProcess.StartInfo.FileName = TfexeFullPath;
tfProcess.StartInfo.Arguments = "label " + Label + " \"" + mappedFolder + "\" /child:replace /recursive /comment:\"Label created by task LabelWorkspaceSources\" /version:" + Version;
tfProcess.StartInfo.UseShellExecute = false;
tfProcess.StartInfo.CreateNoWindow = true;
tfProcess.StartInfo.RedirectStandardOutput = true;
tfProcess.StartInfo.WorkingDirectory = mappedFolder;
tfProcess.Start();
output = tfProcess.StandardOutput.ReadToEnd();
tfProcess.WaitForExit();
Log.LogMessage(tfProcess.StartInfo.Arguments, MessageImportance.High);
Log.LogMessage(output, MessageImportance.High);
}
]]>
</Code>
</Task>
</UsingTask>
person
PainElemental
schedule
13.11.2017