/
AfterSigning.targets
104 lines (92 loc) · 5.48 KB
/
AfterSigning.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<Project>
<Target Name="_EnsureVSIXWasGenerated" AfterTargets="GenerateVisualStudioInsertionManifests" Condition="'$(OS)'=='WINDOWS_NT' AND '$(ArcadeBuildFromSource)' != 'true'">
<PropertyGroup>
<VSSetupDir>$(ArtifactsDir)VSSetup\</VSSetupDir>
<RazorExtensionVSIXName>Microsoft.VisualStudio.RazorExtension.vsix</RazorExtensionVSIXName>
</PropertyGroup>
<Error
Text="$(RazorExtensionVSIXName) was not generated."
Condition="!Exists('$(VSSetupDir)$(Configuration)\$(RazorExtensionVSIXName)')" />
</Target>
<!--
Write a list of assembly names and versions that the insertion tool uses to update assembly versions in DevDiv.
We want to update these lines in VS's /src/ProductData/AssemblyVersions.tt:
const string RazorRuntimeAssemblyVersion = "7.0.0.0";
const string RazorToolingAssemblyVersion = "7.0.0.0";
Hence we write into VSSetup/DevDivPackages/DependentAssemblyVersions.csv:
RazorRuntimeAssembly,8.0.0.0
RazorToolingAssembly,8.0.0.0
-->
<PropertyGroup>
<_DependentAssemblyVersionsFile>$(VisualStudioBuildPackagesDir)DependentAssemblyVersions.csv</_DependentAssemblyVersionsFile>
<_RazorAssemblyVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion).0</_RazorAssemblyVersion>
</PropertyGroup>
<Target Name="_GenerateDependentAssemblyVersions"
AfterTargets="GenerateVisualStudioInsertionManifests"
Inputs="$(_RazorAssemblyVersion)"
Outputs="$(_DependentAssemblyVersionsFile)"
Condition="'$(OS)'=='WINDOWS_NT' AND '$(ArcadeBuildFromSource)' != 'true'">
<ItemGroup>
<_AssemblyVersionEntry Include="RazorRuntimeAssembly" />
<_AssemblyVersionEntry Include="RazorToolingAssembly" />
</ItemGroup>
<MakeDir Directories="$(VisualStudioBuildPackagesDir)"/>
<WriteLinesToFile Lines="@(_AssemblyVersionEntry->'%(Identity),$(_RazorAssemblyVersion)')" File="$(_DependentAssemblyVersionsFile)" Overwrite="true"/>
<ItemGroup>
<FileWrites Include="$(_DependentAssemblyVersionsFile)"/>
</ItemGroup>
</Target>
<Target Name="_ZipLanguageServerBinaries" AfterTargets="Pack" Condition="'$(ArcadeBuildFromSource)' != 'true'">
<!-- This target is defined in eng/targets/Packaging.targets and included in every project. -->
<MSBuild Projects="$(RepoRoot)src\Razor\src\Microsoft.AspNetCore.Razor.LanguageServer\Microsoft.AspNetCore.Razor.LanguageServer.csproj"
Targets="_GetPackageVersionInfo"
SkipNonexistentProjects="false">
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedPackageVersionInfo" />
</MSBuild>
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' -->
<PropertyGroup>
<RidsPublishDir>$(ArtifactsDir)LanguageServer\$(Configuration)\</RidsPublishDir>
<ZipOutputDir>$(RidsPublishDir)</ZipOutputDir>
<_PackageVersion>@(_ResolvedPackageVersionInfo->'%(PackageVersion)')</_PackageVersion>
<_DotNetPath>$(DOTNET_HOST_PATH)</_DotNetPath>
<_DotNetPath Condition="'$(_DotNetPath)' == ''">dotnet</_DotNetPath>
</PropertyGroup>
<ItemGroup>
<LanguageServiceBinaryDir Include="$([System.IO.Directory]::GetDirectories("$(RidsPublishDir)"))" />
<LanguageServiceBinary Include="@(LanguageServiceBinaryDir)">
<SourceDir>%(LanguageServiceBinaryDir.Identity)</SourceDir>
<ZipFile>$(ZipOutputDir)RazorLanguageServer-%(LanguageServiceBinaryDir.Filename)-$(_PackageVersion).zip</ZipFile>
</LanguageServiceBinary>
</ItemGroup>
<MakeDir Directories="$(ZipOutputDir)" />
<Delete Files="%(LanguageServiceBinary.ZipFile)" />
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' -->
<ZipDirectory SourceDirectory="%(LanguageServiceBinary.SourceDir)" DestinationFile="%(LanguageServiceBinary.ZipFile)" />
</Target>
<Target Name="_ZipDevKitTelemetryBinaries" AfterTargets="_ZipLanguageServerBinaries" Condition="'$(ArcadeBuildFromSource)' != 'true'">
<!-- This target is defined in eng/targets/Packaging.targets and included in every project. -->
<MSBuild Projects="$(RepoRoot)src\Razor\src\Microsoft.VisualStudio.DevKit.Razor\Microsoft.VisualStudio.DevKit.Razor.csproj"
Targets="_GetPackageVersionInfo"
SkipNonexistentProjects="false">
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedPackageVersionInfo" />
</MSBuild>
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' -->
<PropertyGroup>
<RidsPublishDir>$(ArtifactsDir)DevKitTelemetry\$(Configuration)\</RidsPublishDir>
<ZipOutputDir>$(RidsPublishDir)</ZipOutputDir>
<_DotNetPath>$(DOTNET_HOST_PATH)</_DotNetPath>
<_DotNetPath Condition="'$(_DotNetPath)' == ''">dotnet</_DotNetPath>
</PropertyGroup>
<ItemGroup>
<DevKitTelemetryBinaryDir Include="$([System.IO.Directory]::GetDirectories("$(RidsPublishDir)"))" />
<DevKitTelemetryBinary Include="@(DevKitTelemetryBinaryDir)">
<SourceDir>%(DevKitTelemetryBinaryDir.Identity)</SourceDir>
<ZipFile>$(ZipOutputDir)DevKitTelemetry-%(DevKitTelemetryBinaryDir.Filename)-$(_PackageVersion).zip</ZipFile>
</DevKitTelemetryBinary>
</ItemGroup>
<MakeDir Directories="$(ZipOutputDir)" />
<Delete Files="%(DevKitTelemetryBinary.ZipFile)" />
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' -->
<ZipDirectory SourceDirectory="%(DevKitTelemetryBinary.SourceDir)" DestinationFile="%(DevKitTelemetryBinary.ZipFile)" />
</Target>
</Project>