Merge pull request #5816 from piotrpMSFT/piotrpMSFT/infra/MSBuildExtensions
Move publishing static MSBuildExtensions to redist.csproj
This commit is contained in:
commit
a88fb4f615
7 changed files with 41 additions and 16 deletions
|
@ -43,6 +43,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
|
|||
build\InitRepo.targets = build\InitRepo.targets
|
||||
build\InputDirectories.props = build\InputDirectories.props
|
||||
build\InstallerInfo.props = build\InstallerInfo.props
|
||||
build\MSBuildExtensions.props = build\MSBuildExtensions.props
|
||||
build\ProjectsToPublish.props = build\ProjectsToPublish.props
|
||||
build\OutputDirectories.props = build\OutputDirectories.props
|
||||
build\Package.targets = build\Package.targets
|
||||
|
|
|
@ -6,14 +6,11 @@
|
|||
<RuntimeNETCoreAppPackageName>runtime.$(CoreCLRRid).microsoft.netcore.app</RuntimeNETCoreAppPackageName>
|
||||
<CrossgenPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/tools/crossgen$(ExeExtension)</CrossgenPath>
|
||||
<LibCLRJitPath>$(NuGetPackagesDir)/$(RuntimeNETCoreAppPackageName)/$(CLI_SharedFrameworkVersion)/runtimes/$(CoreCLRRid)/native/$(DynamicLibPrefix)clrjit$(DynamicLibExtension)</LibCLRJitPath>
|
||||
<MSBuildImportsDir>$(RepoRoot)/resources/MSBuildImports</MSBuildImportsDir>
|
||||
<MSBuildTargetsDirectory>$(SdkOutputDirectory)/runtimes/any/native</MSBuildTargetsDirectory>
|
||||
<SharedFrameworkNameVersionPath>$(OutputDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
|
||||
<MSBuildImportsContent Include="$(MSBuildImportsDir)/**/*" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Compile" DependsOnTargets="Prepare;
|
||||
|
@ -123,17 +120,6 @@
|
|||
<Move SourceFiles="@(NETCore10Assemblies->'$(SdkOutputDirectory)/%(Filename)%(Extension).bak')"
|
||||
DestinationFiles="@(NETCore10Assemblies)" />
|
||||
|
||||
<ItemGroup>
|
||||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.targets" />
|
||||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.Targets" />
|
||||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.props" />
|
||||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.overridetasks" />
|
||||
<MSBuildTargetsToCopy Include="$(MSBuildTargetsDirectory)/**/*.tasks" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(MSBuildTargetsToCopy)"
|
||||
DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToClean Include="$(OutputDirectory)/sdk/**/vbc.exe" />
|
||||
</ItemGroup>
|
||||
|
|
9
build/MSBuildExtensions.props
Normal file
9
build/MSBuildExtensions.props
Normal file
|
@ -0,0 +1,9 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<MSBuildImportsDir>$(RepoRoot)/resources/MSBuildImports</MSBuildImportsDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MSBuildExtensionsContent Include="$(MSBuildImportsDir)/**/*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
<Import Project="build/FileExtensions.props" />
|
||||
<Import Project="build/InputDirectories.props" />
|
||||
<Import Project="build/MSBuildExtensions.props" />
|
||||
<Import Project="build/ProjectsToPublish.props" />
|
||||
<Import Project="build/OutputDirectories.props" />
|
||||
<Import Project="build/BuildDefaults.props" />
|
||||
|
|
|
@ -115,6 +115,6 @@ if ($NoBuild)
|
|||
else
|
||||
{
|
||||
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
dotnet msbuild build.proj /m /v:diag /p:Architecture=$Architecture $ExtraParameters
|
||||
dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@ echo "${args[@]}"
|
|||
|
||||
if [ $BUILD -eq 1 ]; then
|
||||
dotnet msbuild build.proj /p:Architecture=$ARCHITECTURE /p:GeneratingPropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
|
||||
dotnet msbuild build.proj /m /v:diag /p:Architecture=$ARCHITECTURE "${args[@]}"
|
||||
dotnet msbuild build.proj /m /v:diag /fl /flp:v=diag /p:Architecture=$ARCHITECTURE "${args[@]}"
|
||||
else
|
||||
echo "Not building due to --nobuild"
|
||||
echo "Command that would be run is: 'dotnet msbuild build.proj /m /p:Architecture=$ARCHITECTURE ${args[@]}'"
|
||||
|
|
|
@ -73,4 +73,32 @@
|
|||
DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json"
|
||||
NewName="%(BundledTools.Identity).deps.json" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishMSBuildExtensions"
|
||||
AfterTargets="Publish"
|
||||
BeforeTargets="GenerateCliRuntimeConfigurationFiles">
|
||||
|
||||
<Copy SourceFiles="@(MSBuildExtensionsContent)"
|
||||
DestinationFolder="$(PublishDir)/%(RecursiveDir)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<MSBuildTargetsDirectory>$(PublishDir)/runtimes/any/native</MSBuildTargetsDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<NuPkgContentForMSBuildExtensions Include="$(MSBuildTargetsDirectory)/**/*.targets;
|
||||
$(MSBuildTargetsDirectory)/**/*.props;
|
||||
$(MSBuildTargetsDirectory)/**/*.overridetasks;
|
||||
$(MSBuildTargetsDirectory)/**/*.tasks" />
|
||||
|
||||
<NuPkgContentForMSBuildExtensionsRelativePaths Include="@(NuPkgContentForMSBuildExtensions->'runtimes/any/native/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</ItemGroup>
|
||||
|
||||
<Move SourceFiles="@(NuPkgContentForMSBuildExtensions)"
|
||||
DestinationFiles="@(NuPkgContentForMSBuildExtensions->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
|
||||
<RemoveAssetFromDepsPackages DepsFile="$(PublishDir)/$(TargetName).deps.json"
|
||||
SectionName="runtimeTargets"
|
||||
AssetPath="%(NuPkgContentForMSBuildExtensionsRelativePaths.Identity)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue