Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3744 from eerhardt/msbuild-Prepare-incremental
Browse files Browse the repository at this point in the history
Implement incremental builds for Prepare targets.
  • Loading branch information
eerhardt committed Jun 30, 2016
2 parents 7b72512 + cddf8fa commit 58fa0bf
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions build/Microsoft.DotNet.Cli.Prepare.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,23 +159,40 @@
DestinationDirectory="%(_DownloadAndExtractItem.ExtractDestintation)" />
</Target>

<Target Name="SetupRestorePackagesInputsOutputs">
<ItemGroup>
<RestorePackagesInput Include="$(RepoRoot)/src/**/project.json" />
<RestorePackagesInput Include="$(RepoRoot)/tools/**/project.json" />
</ItemGroup>
</Target>

<Target Name="RestorePackages"
DependsOnTargets="Init">
DependsOnTargets="SetupRestorePackagesInputsOutputs;Init"
Inputs="@(RestorePackagesInput)"
Outputs="@(RestorePackagesInput->'%(RelativeDir)/project.lock.json')">

<DotNetRestore WorkingDirectory="$(RepoRoot)/src" ToolPath="$(DotNetPath)" />
<DotNetRestore WorkingDirectory="$(RepoRoot)/tools" ToolPath="$(DotNetPath)" />

</Target>

<Target Name="ZipTemplates">
<Target Name="SetupZipTemplatesInputsOutputs">
<PropertyGroup>
<_DotNetNewFolder>$(RepoRoot)/src/dotnet/commands/dotnet-new</_DotNetNewFolder>
</PropertyGroup>

<ItemGroup>
<DotNetNewArchive Include="$([System.IO.Directory]::GetDirectories($(_DotNetNewFolder)))" />

<ZipTemplatesInput Include="$(_DotNetNewFolder)/**" Exclude="$(_DotNetNewFolder)/*.zip" />
<ZipTemplatesOutput Include="@(DotNetNewArchive->'%(RelativeDir)/$([System.IO.Path]::GetFileName('%(DotNetNewArchive.FullPath)')).zip')" />
</ItemGroup>
</Target>

<Target Name="ZipTemplates"
DependsOnTargets="SetupZipTemplatesInputsOutputs"
Inputs="@(ZipTemplatesInput)"
Outputs="@(ZipTemplatesOutput)">

<ArchiveDirectory InputDirectory="%(DotNetNewArchive.FullPath)"
FileName="$([System.IO.Path]::GetFileName(%(DotNetNewArchive.FullPath)))"
OutputDirectory="%(DotNetNewArchive.RelativeDir)"
Expand Down

0 comments on commit 58fa0bf

Please sign in to comment.