forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Microsoft.Cadl.VS.targets
58 lines (52 loc) · 1.86 KB
/
Microsoft.Cadl.VS.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
<Project>
<Import
Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets"
Condition="'$(VSToolsPath)' != '' and '$(MSBuildRuntimeType)' != 'Core'"
/>
<!--
Deploy the appropriate extension when building in visual studio to support F5
-->
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'
and $([MSBuild]::VersionGreaterThanOrEquals($(VisualStudioVersion), $(VisualStudioMinVersionInclusive)))
and $([MSBuild]::VersionLessThan($(VisualStudioVersion), $(VisualStudioMaxVersionExclusive)))">
<DeployExtension>true</DeployExtension>
</PropertyGroup>
<!--
VS SDK does not currently support building with dotnet build.
-->
<Target
Name="WarnAboutDotnetBuildAndVsix"
Condition="'$(MSBuildRuntimeType)' == 'Core'"
AfterTargets="AfterBuild"
>
<Message
Importance="High"
Text="VSIX packaging skipped: not supported by `dotnet build`, use Visual Studio `msbuild` to package VSIX."
/>
</Target>
<!--
Stash debug source directory so deployed debug vsix can use it to find
and cadl-server under development in source tree.
-->
<Target
Name="WriteDebugSourceDirectory"
Condition="'$(Configuration)' == 'Debug'"
BeforeTargets="BeforeBuild"
>
<WriteLinesToFile
File="$(IntermediateOutputPath)DebugSourceDirectory.txt"
Lines="$(MSBuildThisFileDirectory)"
WriteOnlyWhenDifferent="true"
Overwrite="true"
/>
</Target>
<Target
Name="LogVsixDeployment"
BeforeTargets="DeployVsixExtensionFiles"
Condition="'$(DeployExtension)' == 'true'"
>
<Message Importance="High" Text="$(TargetVsixContainer) -> $(VsixDeploymentPath)" />
</Target>
<Target Name="GetPackageVersionForVsixManifest" Returns="$(Version)" />
<Target Name="GetVSVersionRangeForVsixManifest" Returns="$(VSVersionRange)" />
</Project>