Merge pull request #5878 from piotrpMSFT/piotrpMSFT/infra/MinimizeCompileCLI
Enable redist.csproj to self-publish
This commit is contained in:
commit
b8566ffb45
5 changed files with 80 additions and 71 deletions
|
@ -1,17 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="compile/LzmaArchive.targets" />
|
||||
|
||||
<ItemGroup>
|
||||
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Compile" DependsOnTargets="Prepare;
|
||||
CompileCLI;
|
||||
PublishSdks;
|
||||
PublishTemplates;
|
||||
BuildProjectsForNuGetPackages;
|
||||
GetNuGetPackagesArchive;" />
|
||||
BuildProjectsForNuGetPackages;" />
|
||||
|
||||
<Target Name="CompileCLI">
|
||||
<RemoveDir Directories="$(OutputDirectory)" />
|
||||
|
@ -21,61 +13,5 @@
|
|||
<DotNetPublish ToolPath="$(Stage0Directory)"
|
||||
Configuration="$(Configuration)"
|
||||
ProjectPath="$(RootProject)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Files="@(FilesToClean)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToCopy Include="$(OutputDirectory)/**/*" />
|
||||
<PdbsToClean Include="$(OutputDirectory)/sdk/**/*.pdb" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(FilesToCopy)"
|
||||
DestinationFiles="@(FilesToCopy->'$(SymbolsDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
|
||||
<Delete Files="@(PdbsToClean)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishSdks"
|
||||
DependsOnTargets="Prepare">
|
||||
<ItemGroup>
|
||||
<SdksToBundle Include="build/BundledSdks.proj">
|
||||
<Properties>
|
||||
CLIBuildDll=$(CLIBuildDll);
|
||||
NuGetPackagesDir=$(NuGetPackagesDir);
|
||||
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
|
||||
SdkPackageName=%(BundledSdk.Identity);
|
||||
SdkPackageVersion=%(BundledSdk.Version);
|
||||
Stage0Directory=$(Stage0Directory)
|
||||
</Properties>
|
||||
</SdksToBundle>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(SdksToBundle)">
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishTemplates"
|
||||
DependsOnTargets="Prepare">
|
||||
<ItemGroup>
|
||||
<TemplatesToBundle Include="build/BundledTemplates.proj">
|
||||
<Properties>
|
||||
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
|
||||
TemplatePackageName=%(BundledTemplate.Identity);
|
||||
TemplatePackageVersion=%(BundledTemplate.Version);
|
||||
Stage0Directory=$(Stage0Directory)
|
||||
</Properties>
|
||||
</TemplatesToBundle>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(TemplatesToBundle)">
|
||||
</MSBuild>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="Microsoft.DotNet.Cli.tasks" />
|
||||
<Import Project="prepare/CheckPrereqs.targets" />
|
||||
<Import Project="BundledSdks.props" />
|
||||
<Import Project="BundledTemplates.props" />
|
||||
|
||||
<Target Name="Prepare"
|
||||
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages" />
|
||||
|
|
|
@ -111,8 +111,7 @@
|
|||
<Exec Command="$(DotnetInOutputDirectory) $(ArchiverDll) -a $(IntermediateArchive) $(NuGetPackagesArchiveFolder)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="SetupNuGetPackagesArchiveInputsOutputs"
|
||||
DependsOnTargets="Prepare">
|
||||
<Target Name="SetupNuGetPackagesArchiveInputsOutputs">
|
||||
<GenerateNuGetPackagesArchiveVersion ToolPath="$(OutputDirectory)">
|
||||
<Output TaskParameter="Version" PropertyName="NuGetPackagesArchiveVersion"/>
|
||||
</GenerateNuGetPackagesArchiveVersion>
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
<Import Project="build/BranchInfo.props" />
|
||||
|
||||
<Import Project="build/BundledTools.props" />
|
||||
<Import Project="build/BundledSdks.props" />
|
||||
<Import Project="build/BundledTemplates.props" />
|
||||
<Import Project="build/DependencyVersions.props" />
|
||||
<Import Project="build/Version.props" />
|
||||
<Import Project="build/Branding.props" />
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<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" />
|
||||
|
||||
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
@ -110,6 +111,51 @@
|
|||
AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishSdks"
|
||||
AfterTargets="Publish">
|
||||
<ItemGroup>
|
||||
<SdksToBundle Include="$(RepoRoot)/build/BundledSdks.proj">
|
||||
<Properties>
|
||||
CLIBuildDll=$(CLIBuildDll);
|
||||
NuGetPackagesDir=$(NuGetPackagesDir);
|
||||
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
|
||||
SdkPackageName=%(BundledSdk.Identity);
|
||||
SdkPackageVersion=%(BundledSdk.Version);
|
||||
Stage0Directory=$(Stage0Directory)
|
||||
</Properties>
|
||||
</SdksToBundle>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(SdksToBundle)">
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishTemplates"
|
||||
AfterTargets="Publish">
|
||||
<ItemGroup>
|
||||
<TemplatesToBundle Include="$(RepoRoot)/build/BundledTemplates.proj">
|
||||
<Properties>
|
||||
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
|
||||
TemplatePackageName=%(BundledTemplate.Identity);
|
||||
TemplatePackageVersion=%(BundledTemplate.Version);
|
||||
Stage0Directory=$(Stage0Directory)
|
||||
</Properties>
|
||||
</TemplatesToBundle>
|
||||
</ItemGroup>
|
||||
|
||||
<MSBuild
|
||||
BuildInParallel="False"
|
||||
Projects="@(TemplatesToBundle)">
|
||||
</MSBuild>
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishLzmaArchive"
|
||||
DependsOnTargets="GetNuGetPackagesArchive"
|
||||
AfterTargets="Publish">
|
||||
</Target>
|
||||
|
||||
<Target Name="CrossgenPublishDir"
|
||||
Condition=" '$(DISABLE_CROSSGEN)' == '' "
|
||||
AfterTargets="PublishMSBuildExtensions">
|
||||
|
@ -161,12 +207,40 @@
|
|||
DestinationFiles="@(NETCore10Assemblies)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RemoveVbc"
|
||||
AfterTargets="CrossgenPublishDir">
|
||||
<ItemGroup>
|
||||
<_VbcPath Include="$(PublishDir)/**/vbc.exe" />
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Files="@(_VbcPath)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="ChmodPublishDir"
|
||||
AfterTargets="CrossgenPublishDir"
|
||||
AfterTargets="RemoveVbc"
|
||||
Condition=" '$(OSName)' != 'win' ">
|
||||
|
||||
<Exec Command="find $(SdkOutputDirectory) -type d -exec chmod 755 {} \;" />
|
||||
<Exec Command="find $(SdkOutputDirectory) -type f -exec chmod 644 {} \;" />
|
||||
<Chmod Mode="755" Glob="$(SdkOutputDirectory)/Roslyn/RunCsc.sh" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CreateSymbolsDirectory"
|
||||
AfterTargets="RemoveVbc">
|
||||
<ItemGroup>
|
||||
<_AllSdkFiles Include="$(PublishDir)/**/*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(_AllSdkFiles)"
|
||||
DestinationFiles="@(_AllSdkFiles->'$(SymbolsDirectory)/sdk/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RemovePdbsFromPublishDir"
|
||||
AfterTargets="CreateSymbolsDirectory">
|
||||
<ItemGroup>
|
||||
<PdbsToClean Include="$(PublishDir)/**/*.pdb" />
|
||||
</ItemGroup>
|
||||
|
||||
<Delete Files="@(PdbsToClean)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue