-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sign the
*.VSInsertionMetadata
optprof package
- Loading branch information
Showing
8 changed files
with
83 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.Build.NoTargets"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\VSRepo\</PackageOutputPath> | ||
<IncludeSymbols>false</IncludeSymbols> | ||
<EnableDefaultSignFiles>false</EnableDefaultSignFiles> | ||
<Description>Contains metadata for insertion into VS.</Description> | ||
</PropertyGroup> | ||
<Import Project="VSInsertionMetadata.targets" /> | ||
</Project> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<Project> | ||
<UsingTask TaskName="ReplaceFileText" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll"> | ||
<ParameterGroup> | ||
<InputFilename ParameterType="System.String" Required="true" /> | ||
<OutputFilename ParameterType="System.String" Required="true" /> | ||
<MatchExpression ParameterType="System.String" Required="true" /> | ||
<ReplacementText ParameterType="System.String" Required="true" /> | ||
</ParameterGroup> | ||
<Task> | ||
<Using Namespace="System" /> | ||
<Using Namespace="System.IO" /> | ||
<Using Namespace="System.Text.RegularExpressions" /> | ||
<Code Type="Fragment" Language="cs"> | ||
<![CDATA[ | ||
File.WriteAllText( | ||
OutputFilename, | ||
Regex.Replace(File.ReadAllText(InputFilename), MatchExpression, ReplacementText) | ||
); | ||
]]> | ||
</Code> | ||
</Task> | ||
</UsingTask> | ||
|
||
<PropertyGroup> | ||
<TargetsForTfmSpecificContentInPackage> | ||
$(TargetsForTfmSpecificContentInPackage); | ||
SubstituteProfilingInputsMacro; | ||
SubstituteProfilingInputsMacroWarning; | ||
</TargetsForTfmSpecificContentInPackage> | ||
</PropertyGroup> | ||
|
||
<Target Name="SubstituteProfilingInputsMacroWarning" Condition="'$(ProfilingInputsDropName)'==''"> | ||
<Warning Text="The ProfilingInputsDropName msbuild property has not been set, and the OptProf will not contain accurate content."/> | ||
</Target> | ||
<Target Name="SubstituteProfilingInputsMacro" Condition="'$(ProfilingInputsDropName)'!=''"> | ||
<ItemGroup> | ||
<ProfilingInputsSource Include="ProfilingInputs.props" /> | ||
<ProfilingInputsTarget Include="$(IntermediateOutputPath)ProfilingInputs.props" /> | ||
</ItemGroup> | ||
<ReplaceFileText | ||
Condition="'$(ProfilingInputsDropName)' != ''" | ||
InputFilename="@(ProfilingInputsSource)" | ||
OutputFilename="@(ProfilingInputsTarget)" | ||
MatchExpression="%TESTSTORE%" | ||
ReplacementText="vstsdrop:$(ProfilingInputsDropName)" /> | ||
<ItemGroup> | ||
<TfmSpecificPackageFile Include="@(ProfilingInputsTarget)" PackagePath="InsertionVS/" /> | ||
</ItemGroup> | ||
</Target> | ||
<Target Name="EnsureUniquePackageVersion" | ||
Condition="'$(Build_BuildId)' != ''" | ||
AfterTargets="GetBuildVersion"> | ||
<!-- | ||
We must ensure unique versions for the insertion metadata package so | ||
it can contain information that is unique to this build. | ||
In particular it includes the ProfilingInputsDropName, which contains the BuildId. | ||
A non-unique package version here may collide with a prior run of this same commit, | ||
ultimately resulting in a failure of the optprof run. | ||
--> | ||
<PropertyGroup> | ||
<PackageVersion>$(PackageVersion).$(Build_BuildId)</PackageVersion> | ||
</PropertyGroup> | ||
</Target> | ||
</Project> |