-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProjectAssets.props
58 lines (53 loc) · 3.02 KB
/
ProjectAssets.props
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
<!--
SPDX-FileCopyrightText: 2022 smdn <[email protected]>
SPDX-License-Identifier: MIT
-->
<Project>
<PropertyGroup>
<SmdnProjectAssets_Common_PackageVersion Condition=" '$(SmdnProjectAssets_Common_PackageVersion)' == '' ">1.4.1</SmdnProjectAssets_Common_PackageVersion>
<SmdnProjectAssets_Library_PackageVersion Condition=" '$(SmdnProjectAssets_Library_PackageVersion)' == '' ">1.7.3</SmdnProjectAssets_Library_PackageVersion>
</PropertyGroup>
<!--
NuGetPackageRoot is not set until `pack` or `restore` is executed, so set an alternative default path here
ref: https://github.com/NuGet/Home/issues/9150
-->
<PropertyGroup>
<_NuGetPackageAltRoot>$(NuGetPackageRoot)</_NuGetPackageAltRoot>
<_NuGetPackageAltRoot Condition="('$(_NuGetPackageAltRoot)' == '') and ('$(NUGET_PACKAGES)' != '')">$(NUGET_PACKAGES)\</_NuGetPackageAltRoot>
<_NuGetPackageAltRoot Condition="('$(_NuGetPackageAltRoot)' == '') and $([MSBuild]::IsOSUnixLike())">$(HOME)\.nuget\packages\</_NuGetPackageAltRoot>
<_NuGetPackageAltRoot Condition="('$(_NuGetPackageAltRoot)' == '')">$(USERPROFILE)\.nuget\packages\</_NuGetPackageAltRoot>
</PropertyGroup>
<!--
Set the path to *.props/*targets files of asset library according to the switching property.
-->
<PropertyGroup>
<_SmdnProjectAssets_Common_PathToPackageRoot Condition=" '$(_SmdnProjectAssets_Common_PathToPackageRoot)' == '' ">$(_NuGetPackageAltRoot)smdn.msbuild.projectassets.common\$(SmdnProjectAssets_Common_PackageVersion)\</_SmdnProjectAssets_Common_PathToPackageRoot>
<_SmdnProjectAssets_Library_PathToPackageRoot Condition=" '$(_SmdnProjectAssets_Library_PathToPackageRoot)' == '' ">$(_NuGetPackageAltRoot)smdn.msbuild.projectassets.library\$(SmdnProjectAssets_Library_PackageVersion)\</_SmdnProjectAssets_Library_PathToPackageRoot>
</PropertyGroup>
<!--
Importing by *.nuget.g.props/*.nuget.g.targets file does not properly set the properties defined in the asset library,
so do not use PackageReference with IncludeAssets, and import *.props/*targets manually instead.
-->
<ItemGroup>
<PackageDownload
Include="Smdn.MSBuild.ProjectAssets.Common"
Version="[$(SmdnProjectAssets_Common_PackageVersion)]"
/>
<PackageDownload
Include="Smdn.MSBuild.ProjectAssets.Library"
Version="[$(SmdnProjectAssets_Library_PackageVersion)]"
/>
</ItemGroup>
<!--
Import *.props files.
-->
<Import Project="$(_SmdnProjectAssets_Common_PathToPackageRoot)project\Project.props" />
<Import Project="$(_SmdnProjectAssets_Library_PathToPackageRoot)project\Project.props" />
<!--
Define the path to *.targets files to be imported.
-->
<PropertyGroup>
<SmdnProjectAssets_TargetsImports>$(SmdnProjectAssets_TargetsImports);$(_SmdnProjectAssets_Common_PathToPackageRoot)project\Project.targets</SmdnProjectAssets_TargetsImports>
<SmdnProjectAssets_TargetsImports>$(SmdnProjectAssets_TargetsImports);$(_SmdnProjectAssets_Library_PathToPackageRoot)project\Project.targets</SmdnProjectAssets_TargetsImports>
</PropertyGroup>
</Project>