-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inner devloop improvements
- Loading branch information
Showing
5 changed files
with
111 additions
and
3 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 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,54 @@ | ||
<!-- | ||
*********************************************************************************************** | ||
NuGetizer.Cleanup.targets | ||
Cleans up previously built packages from the package output folder, as well | ||
as the local caches so that restoring packages (even using wildcards) will | ||
always pick the freshly built ones. | ||
Copyright (c) .NET Foundation. All rights reserved. | ||
*********************************************************************************************** | ||
--> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup Label="Hidden"> | ||
<HttpNuGetCache>$(LocalAppData)\NuGet\v3-cache</HttpNuGetCache> | ||
<!-- We clean the HTTP cache by default. This does *not* clear the cached installed packages --> | ||
<CleanHttpNuGetCacheOnPack Condition="'$(CleanHttpNuGetCacheOnPack)' == ''">true</CleanHttpNuGetCacheOnPack> | ||
<!-- The actual NuGet cache is only cleared for the *current* PackageId, so no need to turn off its clearing on build/pack --> | ||
<NuGetCache>$(UserProfile)\.nuget\packages</NuGetCache> | ||
</PropertyGroup> | ||
|
||
<Target Name="CleanPackageOutput" BeforeTargets="Build"> | ||
<ItemGroup> | ||
<_ExistingPackage Include="$(PackageOutputPath)\$(PackageId)*.nupkg" /> | ||
<_PackageToDelete Include="@(_ExistingPackage)" | ||
Condition="$([System.Text.RegularExpressions.Regex]::IsMatch('%(Filename)', '$(PackageId)\.\d\.\d\.\d.*'))" /> | ||
</ItemGroup> | ||
<Delete Files="@(_PackageToDelete)" ContinueOnError="true"> | ||
<Output TaskParameter="DeletedFiles" ItemName="_CleanedPackages" /> | ||
</Delete> | ||
<Message Text="Cleaned existing packages: @(_CleanedPackages -> '%(Filename)%(Extension)')" | ||
Condition="'@(_CleanedPackages)' != ''" /> | ||
</Target> | ||
|
||
<!-- Clears nuget cache for the current project package id --> | ||
<Target Name="CleanCachedPackageId" AfterTargets="Build;Pack"> | ||
<PropertyGroup> | ||
<PackageFolder>$(NuGetCache)\$(PackageId.ToLowerInvariant())</PackageFolder> | ||
</PropertyGroup> | ||
|
||
<Message Text="Cleaning $(PackageFolder)" Condition="Exists($(PackageFolder))" /> | ||
<Exec Command='rd "$(PackageFolder)" /q /s' Condition="Exists($(PackageFolder)) and '$(OS)' == 'Windows_NT'" /> | ||
<Exec Command='rm -rf "$(PackageFolder)"' Condition="Exists($(PackageFolder)) and '$(OS)' != 'Windows_NT'" /> | ||
</Target> | ||
|
||
<Target Name="CleanHttpNuGetCache" | ||
Condition="'$(CleanHttpNuGetCacheOnPack)' == 'true' and Exists('$(HttpNuGetCache)')" | ||
AfterTargets="Build;Pack"> | ||
<Message Text="Cleaning $(HttpNuGetCache)" /> | ||
<Exec Command='rd "$(HttpNuGetCache)" /q /s' Condition="'$(OS)' == 'Windows_NT'" /> | ||
<Exec Command='rm -rf "$(HttpNuGetCache)"' Condition="'$(OS)' != 'Windows_NT'" /> | ||
</Target> | ||
|
||
</Project> |
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