-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDirectory.Build.targets
More file actions
66 lines (50 loc) · 3.24 KB
/
Copy pathDirectory.Build.targets
File metadata and controls
66 lines (50 loc) · 3.24 KB
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
<Project>
<PropertyGroup Condition="'$(IsSourceKitPackage)' == 'true' or '$(IsSourceKitCorePackage)' == 'true'">
<SourceKitPackageOutputPath>$(SolutionDir)bin\packages</SourceKitPackageOutputPath>
<PackageId>$(AssemblyName)</PackageId>
<Title>$(AssemblyName)</Title>
<Authors>ronimizy</Authors>
<Description>Source generator extensions</Description>
<PackageProjectUrl>https://github.com/itmo-is-dev/SourceKit</PackageProjectUrl>
<RepositoryUrl>https://github.com/itmo-is-dev/SourceKit</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
</PropertyGroup>
<ItemGroup Condition="'$(IsSourceKitPackage)' == 'true' or '$(IsSourceKitCorePackage)' == 'true'">
<None Include="README.md" Pack="true" PackagePath="\" Condition="Exists('README.md')"/>
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" Condition="!Exists('README.md')"/>
<None Include="$(MSBuildThisFileDirectory)LICENSE.md" Pack="true" PackagePath="\"/>
</ItemGroup>
<ItemGroup Condition="'$(IsSourceKitPackage)' == 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)src\SourceKit\SourceKit.csproj" PrivateAssets="all"/>
<PackageReference Include="SourceKit.Runtime" Condition="'$(IsWarmupBuild)' != 'true'"/>
<PackageReference Include="PolySharp" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.Common" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all"/>
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" PrivateAssets="all"/>
</ItemGroup>
<Target Name="CopyPackageToGlobalPath"
AfterTargets="Pack"
Condition="'$(IsSourceKitPackage)' == 'true' or '$(IsSourceKitCorePackage)' == 'true'">
<Message Importance="high" Text="Copied package '$(PackageId)'"/>
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg"
DestinationFolder="$(SourceKitPackageOutputPath)"/>
</Target>
<Target Name="Clear NuGet package cache"
Condition="('$(IsSourceKitPackage)' == 'true' or '$(IsSourceKitCorePackage)' == 'true') and '$(IsPackageBuild)' != 'true' and '$(IsWarmupBuild)' != 'true'"
AfterTargets="Pack">
<Message Importance="high" Text="Clearing cache for $(PackageId)"/>
<Exec Command="dotnet nuget locals global-packages --list | awk '{print $2}'"
ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="NuGetCachePath"/>
</Exec>
<RemoveDir Directories="$(NuGetCachePath)$(PackageId)\$(Version)"/>
<Exec Command="dotnet restore $([System.IO.Path]::Combine($(MSBuildThisFileDirectory), 'samples', 'SourceKit.RestoreSentinel', 'SourceKit.RestoreSentinel.csproj')) /p:CustomPackageName=$(PackageId)"/>
</Target>
<PropertyGroup Condition="'$(IsWarmupBuild)' == 'true'">
<GeneratePackageOnBuild Condition="'$(IsSourceKitCorePackage)' != 'true'">
false
</GeneratePackageOnBuild>
</PropertyGroup>
</Project>