Move tool deps file creation into redist.csproj

This commit is contained in:
Piotr Puszkiewicz 2017-02-22 22:44:52 -08:00
parent dc1b97c4a1
commit 1199df1c05
7 changed files with 43 additions and 30 deletions

View file

@ -28,11 +28,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
build\BranchInfo.props = build\BranchInfo.props
build\BuildDefaults.props = build\BuildDefaults.props
build\BuildOutputs.props = build\BuildOutputs.props
build\BundledSdks.proj = build\BundledSdks.proj
build\BundledRuntimes.props = build\BundledRuntimes.props
build\BundledSdks.proj = build\BundledSdks.proj
build\BundledSdks.props = build\BundledSdks.props
build\BundledTemplates.proj = build\BundledTemplates.proj
build\BundledTemplates.props = build\BundledTemplates.props
build\BundledTools.props = build\BundledTools.props
build\Compile.targets = build\Compile.targets
build\CoreSetupInfo.props = build\CoreSetupInfo.props
build\CrossgenInfo.props = build\CrossgenInfo.props

11
build/BundledTools.props Normal file
View file

@ -0,0 +1,11 @@
<Project>
<ItemGroup>
<BundledTools Include="MSBuild;
NuGet.CommandLine.XPlat;
dotnet" />
<BundledToolProjects Include="tool_msbuild;
tool_nuget;
redist;" />
</ItemGroup>
</Project>

View file

@ -4,7 +4,6 @@
<ItemGroup>
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
<BundledTools Include="MSBuild;NuGet.CommandLine.XPlat;dotnet" />
<MSBuildImportsContent Include="$(MSBuildImportsDir)/**/*" />
</ItemGroup>
@ -19,14 +18,6 @@
<ItemGroup>
<SharedFramework Remove="*" />
<SharedFramework Include="$(SharedFrameworkPublishDirectory)/**/*" />
<RuntimeTargetsAssetsToRemoveFromDeps Remove="*" />
<RuntimeTargetsAssetsToRemoveFromDeps Include="MSBuild" />
<RuntimeAssetsToRemoveFromDeps Remove="*" />
<RuntimeAssetsToRemoveFromDeps Include="redist" />
<RuntimeAssetsToRemoveFromDeps Include="tool_msbuild" />
<RuntimeAssetsToRemoveFromDeps Include="tool_nuget" />
</ItemGroup>
<RemoveDir Directories="$(StageDirectory)" />
@ -46,25 +37,6 @@
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
SectionName="runtime"
AssetPath="%(RuntimeAssetsToRemoveFromDeps.Identity).dll" />
<Copy SourceFiles="$(SdkOutputDirectory)/redist.deps.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" />
<Copy SourceFiles="$(SdkOutputDirectory)/redist.runtimeconfig.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).runtimeconfig.json" />
<ChangeEntryPointLibraryName
DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json"
NewName="%(BundledTools.Identity).deps.json" />
<!-- cleanup project output we don't need -->
<Delete Files="$(SdkOutputDirectory)/redist%(PublishOutputExtensions.Identity)" />
<Delete Files="$(SdkOutputDirectory)/tool_msbuild%(PublishOutputExtensions.Identity)" />
<Delete Files="$(SdkOutputDirectory)/tool_nuget%(PublishOutputExtensions.Identity)" />
<!-- Copy Host to SDK Directory -->
<Copy SourceFiles="$(SharedFrameworkNameVersionPath)/$(DotnetHostBaseName)"
DestinationFiles="$(SdkOutputDirectory)/corehost$(ExeExtension)" />

View file

@ -11,6 +11,7 @@
<Import Project="build/BranchInfo.props" />
<Import Project="build/CoreSetupInfo.props" />
<Import Project="build/BundledTools.props" />
<Import Project="build/DependencyVersions.props" />
<Import Project="build/Version.props" />
<Import Project="build/Branding.props" />

View file

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.4</PackageTargetFallback>
<PublishDir>$(Stage2SdkDirectory)</PublishDir>
<VersionSuffix>$(CommitCount)</VersionSuffix>
@ -18,6 +20,7 @@
<PackageReference Include="Microsoft.TestPlatform.CLI" Version="$(CLI_TestPlatform_Version)" />
<PackageReference Include="Microsoft.TestPlatform.Build" Version="$(CLI_TestPlatform_Version)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dotnet\dotnet.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Archive\Microsoft.DotNet.Archive.csproj" />
@ -30,4 +33,25 @@
<ProjectReference Include="..\tool_msbuild\tool_msbuild.csproj" />
<ProjectReference Include="..\tool_nuget\tool_nuget.csproj" />
</ItemGroup>
</Project>
<Target Name="GenerateCliRuntimeConfigurationFiles"
AfterTargets="Publish">
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
SectionName="runtime"
AssetPath="%(BundledToolProjects.Identity).dll" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).deps.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" />
<Copy SourceFiles="$(PublishDir)/$(TargetName).runtimeconfig.json"
DestinationFiles="$(SdkOutputDirectory)/%(BundledTools.Identity).runtimeconfig.json" />
<Delete Files="$(PublishDir)/$(TargetName).deps.json;
$(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/%(BundledToolProjects.Identity).dll" />
<ChangeEntryPointLibraryName
DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json"
NewName="%(BundledTools.Identity).deps.json" />
</Target>
</Project>

View file

@ -4,6 +4,8 @@
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />

View file

@ -4,6 +4,8 @@
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="$(CLI_SharedFrameworkVersion)" />