diff options
author | Elinor Fung <47805090+elinor-fung@users.noreply.github.com> | 2019-05-21 12:05:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 12:05:49 -0700 |
commit | 0d6facf7afac5868db3dce55a1fb940a02365687 (patch) | |
tree | 82abee2cd5540684fe9e26796f66d8924b574f4a /src/.nuget | |
parent | 11c8d92992f56fb481f9479219671652af7b04a1 (diff) | |
download | coreclr-0d6facf7afac5868db3dce55a1fb940a02365687.tar.gz coreclr-0d6facf7afac5868db3dce55a1fb940a02365687.tar.bz2 coreclr-0d6facf7afac5868db3dce55a1fb940a02365687.zip |
Switch NuGet package build to use Arcade instead of BuildTools (#24619)
Diffstat (limited to 'src/.nuget')
-rw-r--r-- | src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props | 12 | ||||
-rw-r--r-- | src/.nuget/dir.props | 5 | ||||
-rw-r--r-- | src/.nuget/dir.targets | 29 | ||||
-rw-r--r-- | src/.nuget/init/init.csproj | 24 | ||||
-rw-r--r-- | src/.nuget/optdata/ibcmerge.csproj | 3 | ||||
-rw-r--r-- | src/.nuget/optdata/optdata.csproj | 2 | ||||
-rw-r--r-- | src/.nuget/packages.builds | 36 | ||||
-rw-r--r-- | src/.nuget/packaging.props | 62 |
8 files changed, 112 insertions, 61 deletions
diff --git a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props index 648d7aac2b..22cdfd859b 100644 --- a/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props +++ b/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/runtime.Windows_NT.Microsoft.NETCore.Runtime.CoreCLR.props @@ -1,13 +1,21 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + + <!-- [ARCADE REMOVE] Native binaries use BuildTools versioning, not Arcade + Include the generated build version properties for BuildNumberMajor/BuildNumberMinor--> + <PropertyGroup> + <RootIntermediateOutputPath>$(CoreclrDir)\bin\obj\</RootIntermediateOutputPath> + </PropertyGroup> + <Import Project="$(CoreclrDir)\Tools\BuildVersion.targets" /> + <PropertyGroup> <PackageTargetRuntime>$(MinOSForArch)-$(PackagePlatform)</PackageTargetRuntime> <LongNamePlatform>$(Platform)</LongNamePlatform> <LongNamePlatform Condition="'$(Platform)'=='x64'">amd64</LongNamePlatform> <CrossTargetPlatform>$(CrossTargetComponentFolder)</CrossTargetPlatform> <CrossTargetPlatform Condition="'$(CrossTargetPlatform)'=='x64'">amd64</CrossTargetPlatform> - <LongNameSuffix>_$(LongNamePlatform)_$(LongNamePlatform)_$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</LongNameSuffix> - <CrossTargetLongNameSuffix>_$(CrossTargetPlatform)_$(LongNamePlatform)_$(MajorVersion).$(MinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</CrossTargetLongNameSuffix> + <LongNameSuffix>_$(LongNamePlatform)_$(LongNamePlatform)_$(NativeMajorVersion).$(NativeMinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</LongNameSuffix> + <CrossTargetLongNameSuffix>_$(CrossTargetPlatform)_$(LongNamePlatform)_$(NativeMajorVersion).$(NativeMinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</CrossTargetLongNameSuffix> </PropertyGroup> <ItemGroup> diff --git a/src/.nuget/dir.props b/src/.nuget/dir.props index 29ea200dd0..80081ad025 100644 --- a/src/.nuget/dir.props +++ b/src/.nuget/dir.props @@ -1,9 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildThisFileDirectory)..\..\dir.props" /> + <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" /> + <Import Project="packaging.props" /> <PropertyGroup> - <!-- defined in buildtools packaging.targets, but we need this before targets are imported --> + <!-- defined in Packaging.targets, but we need this before targets are imported --> <PackagePlatform>AnyCPU</PackagePlatform> <!-- build the transport package which includes product and symbols in addition to standard packages --> diff --git a/src/.nuget/dir.targets b/src/.nuget/dir.targets index 4d4883bf78..b51b76a28a 100644 --- a/src/.nuget/dir.targets +++ b/src/.nuget/dir.targets @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" /> + + <PropertyGroup> + <!-- Reset PackageOutputPath. The ProjectDefaults targets from Arcade set it to be in the artifacts directory, + but our publishing step currently looks under PackagesBinDir --> + <PackageOutputPath>$(PackagesBinDir)/pkg/</PackageOutputPath> + </PropertyGroup> + + <Import Project="$(NuGetPackageRoot)\microsoft.dotnet.build.tasks.packaging\$(MicrosoftDotNetBuildTasksPackagingPackageVersion)\build\Microsoft.DotNet.Build.Tasks.Packaging.targets" /> - <Target Name="VerifyVCRedist" BeforeTargets="GetSymbolPackageFiles" Condition="'$(_runtimeOSFamily)' == 'win'"> - <Error Condition="'$(UniversalCRTSDKDir)' == ''" Text="Unable to find VC Redist binaries - check that UniversalCRTSDKDir environment variable is set" /> - </Target> <!-- Finds symbol files and injects them into the package build. --> @@ -64,7 +70,7 @@ <!-- Search for all xplat symbol file extensions on every xplat native binary. Some binaries have no ".so" or ".dylib" extension, so we can't tell which convention its symbol files would - use. On xplat, the symbol extension is simply appended. + use. On xplat, the symbol extension is simply appended. --> <NonWindowsNativeFile Include="@(NativeWithSymbolFile)" Exclude="@(WindowsNativeFile)" /> @@ -93,19 +99,4 @@ </ItemGroup> </Target> - <!-- OverrideLicenseUrl is temporary till we update the buildtools to v2 --> - <Target Name="OverrideLicenseUrl" BeforeTargets="GenerateNuSpec"> - <PropertyGroup> - <LicenseUrl>https://github.com/dotnet/coreclr/blob/master/LICENSE.TXT</LicenseUrl> - </PropertyGroup> - </Target> - - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)\.., dir.targets))\dir.targets" /> - <ItemGroup> - <!-- Add version file to packages --> - <File Condition="Exists('$(SyncInfoFile)')" - Include="$(SyncInfoFile)"> - <SkipPackageFileCheck>true</SkipPackageFileCheck> - </File> - </ItemGroup> </Project> diff --git a/src/.nuget/init/init.csproj b/src/.nuget/init/init.csproj deleted file mode 100644 index 115090dd76..0000000000 --- a/src/.nuget/init/init.csproj +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <CLRTestKind>BuildOnly</CLRTestKind> - </PropertyGroup> - <ItemGroup> - <PackageReference Include="Microsoft.NETCore.Platforms"> - <Version>$(RuntimeIdGraphDefinitionVersion)</Version> - </PackageReference> - </ItemGroup> - <PropertyGroup> - <TargetFramework>netcoreapp1.0</TargetFramework> - <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier> - <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8</PackageTargetFallback> - <ContainsPackageReferences>true</ContainsPackageReferences> - <PrereleaseResolveNuGetPackages>false</PrereleaseResolveNuGetPackages> - </PropertyGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> - <Target Name="Build" - DependsOnTargets="ResolveReferences" /> -</Project> diff --git a/src/.nuget/optdata/ibcmerge.csproj b/src/.nuget/optdata/ibcmerge.csproj index e00d3d1d54..b995471fdd 100644 --- a/src/.nuget/optdata/ibcmerge.csproj +++ b/src/.nuget/optdata/ibcmerge.csproj @@ -1,7 +1,4 @@ <Project Sdk="Microsoft.NET.Sdk"> - - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> - <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> diff --git a/src/.nuget/optdata/optdata.csproj b/src/.nuget/optdata/optdata.csproj index 8ab2f5bf1d..8694367c6b 100644 --- a/src/.nuget/optdata/optdata.csproj +++ b/src/.nuget/optdata/optdata.csproj @@ -1,7 +1,5 @@ <Project Sdk="Microsoft.NET.Sdk"> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> - <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> diff --git a/src/.nuget/packages.builds b/src/.nuget/packages.builds index 15e7f4022d..b94e14a429 100644 --- a/src/.nuget/packages.builds +++ b/src/.nuget/packages.builds @@ -1,10 +1,6 @@ <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildThisFileDirectory)..\..\dir.props" /> - - <PropertyGroup> - <!-- This property must be set to the same value as $(PackageOutputPath) for the nuspecs and nupkgs to be binplaced to the intended location. --> - <OutputPath>$(PackageOutputPath)</OutputPath> - </PropertyGroup> + <Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" /> + <Import Project="packaging.props" /> <ItemGroup Condition="'$(__SkipCoreLibBuild)'==''"> <Project Include="Microsoft.NETCore.Runtime.CoreCLR\Microsoft.NETCore.Runtime.CoreCLR.builds" /> @@ -29,9 +25,31 @@ <Project Include="Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.builds" /> </ItemGroup> - <Import Project="$(ToolsDir)versioning.targets" /> - <!-- Make sure we create version.txt file since it will be packaged --> - <Target Name="EnsureVersionInfoFileExists" BeforeTargets="Build" DependsOnTargets="CreateVersionInfoFile" /> + <!-- Generate a version.txt file we include in our packages + The InitializeSourceControlInformationFromSourceControlManager is part of Microsoft.Build.Tasks.Git + and is responsible for setting SourceRevisionId --> + <Target Name="GenerateVersionInfoFileForPackages" + BeforeTargets="Build" + DependsOnTargets="InitializeSourceControlInformationFromSourceControlManager"> + + <Error Condition="'$(SourceRevisionId)' == ''" Text="SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs." /> + + <MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(VersionTxtFile)))" /> + <WriteLinesToFile + File="$(VersionTxtFile)" + Lines="$(SourceRevisionId)" + Overwrite="true" /> + </Target> + + <!-- [ARCADE REMOVE] Make sure version props file for native binaries (non-Arcade versioning) exists + This is through building a separate project because the packaging projects use Arcade versioning + and just need the build number for laying out certain native binaries. These projects do not want + the actual BuildTools target to run / set various properties, so they just include the generated + build version props file (which only sets BuildNumberMajor/BuildNumberMinor) as needed. --> + <Target Name="CreateVersionPropsForNativeBinaries" + BeforeTargets="Build"> + <MSBuild Targets="Build" Projects="$(CoreclrDir)\src\createVersionFile.proj"/> + </Target> <Import Project="$(MSBuildThisFileDirectory)..\..\dir.traversal.targets" /> </Project> diff --git a/src/.nuget/packaging.props b/src/.nuget/packaging.props new file mode 100644 index 0000000000..9344e4a402 --- /dev/null +++ b/src/.nuget/packaging.props @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project> + <PropertyGroup> + <!-- Packaging projects are non-SDK-style and directly import Directory.Build.props. They can also import Microsoft.Common.props. + Make sure Microsoft.Common.props does not import Directory.Build.props again --> + <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps> + </PropertyGroup> + + <PropertyGroup> + <PackageDescriptionFile>$(MSBuildThisFileDirectory)/descriptions.json</PackageDescriptionFile> + <PackageLicenseFile>$(CoreclrDir)/LICENSE.TXT</PackageLicenseFile> + <PackageThirdPartyNoticesFile>$(CoreclrDir)/THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile> + + <RuntimeIdGraphDefinitionFile>$(PackagesDir)/microsoft.netcore.platforms/$(MicrosoftNETCorePlatformsVersion)/runtime.json</RuntimeIdGraphDefinitionFile> + <ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799421</ReleaseNotes> + + <ProjectUrl>https://dot.net</ProjectUrl> + + <!-- Defined in Packaging.targets, but we need this before targets are imported --> + <PackagePlatform Condition="'$(PackagePlatform)' == ''">$(Platform)</PackagePlatform> + <PackagePlatform Condition="'$(PackagePlatform)' == 'amd64'">x64</PackagePlatform> + <MinOSForArch>win7</MinOSForArch> + <MinOSForArch Condition="'$(PackagePlatform)' == 'arm'">win8</MinOSForArch> + <MinOSForArch Condition="'$(PackagePlatform)' == 'arm64'">win10</MinOSForArch> + + <!-- Define packaging attributes for cross target components --> + <HasCrossTargetComponents Condition="'$(TargetsWindows)' == 'true' and ('$(PackagePlatform)' =='arm64' or '$(PackagePlatform)' =='arm')">true</HasCrossTargetComponents> + <HasCrossTargetComponents Condition="'$(TargetsLinux)' == 'true' and ('$(PackagePlatform)' =='arm64' or '$(PackagePlatform)' =='arm') and '$(__DoCrossArchBuild)' == '1'">true</HasCrossTargetComponents> + <CrossTargetComponentFolder Condition="'$(PackagePlatform)' == 'arm64'">x64</CrossTargetComponentFolder> + <CrossTargetComponentFolder Condition="'$(PackagePlatform)' == 'arm' and '$(TargetsWindows)' == 'true'">x86</CrossTargetComponentFolder> + <CrossTargetComponentFolder Condition="'$(PackagePlatform)' == 'arm' and '$(TargetsLinux)' == 'true'">x64</CrossTargetComponentFolder> + + <!-- Created package output locations must be kept in sync with eng/build-job.yml --> + <PackageOutputPath>$(PackagesBinDir)/pkg/</PackageOutputPath> + <SymbolPackageOutputPath>$(PackagesBinDir)/symbolpkg/</SymbolPackageOutputPath> + <PackageIndexFile>$(MSBuildThisFileDirectory)/packageIndex.json</PackageIndexFile> + + <!-- coreclr doesn't currently use the index so don't force it to be in sync --> + <SkipIndexCheck>true</SkipIndexCheck> + + <VersionTxtFile Condition="'$(VersionTxtFile)' == ''">$(ArtifactsObjDir)version.txt</VersionTxtFile> + </PropertyGroup> + + <ItemGroup Condition="'$(MSBuildProjectExtension)' == '.pkgproj'"> + <!-- Add required legal files to packages --> + <File Condition="Exists('$(PackageLicenseFile)')" + Include="$(PackageLicenseFile)" > + <SkipPackageFileCheck>true</SkipPackageFileCheck> + </File> + <File Condition="Exists('$(PackageThirdPartyNoticesFile)')" + Include="$(PackageThirdPartyNoticesFile)" > + <SkipPackageFileCheck>true</SkipPackageFileCheck> + </File> + <PackageIndex Include="$(PackageIndexFile)" /> + + <!-- Add version file to packages --> + <File Include="$(VersionTxtFile)" + Condition="Exists('$(VersionTxtFile)')"> + <SkipPackageFileCheck>true</SkipPackageFileCheck> + </File> + </ItemGroup> +</Project> |