__Type=$(echo $1| cut -d'=' -f 2)
buildArgs="$buildArgs /p:__BuildType=$__Type"
;;
- -OfficialBuildId=*)
+ -OfficialBuildId=*|-officialbuildid=*)
__Id=$(echo $1| cut -d'=' -f 2)
buildArgs="$buildArgs /p:OfficialBuildId=$__Id"
;;
__versionSourceFile="$intermediatesForBuild/version.c"
if [ $__SkipGenerateVersion == 0 ]; then
pwd
- $__ProjectRoot/dotnet.sh msbuild /nologo /verbosity:minimal /clp:Summary \
- /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true \
- /p:UsePartialNGENOptimization=false /maxcpucount \
- $__ProjectDir/build.proj /t:GenerateVersionHeader \
- /p:GenerateVersionHeader=true /p:NativeVersionSourceFile=$__versionSourceFile \
- /l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log \
- $__CommonMSBuildArgs $__UnprocessedBuildArgs
+ $__ProjectRoot/eng/common/msbuild.sh $__ProjectRoot/eng/empty.proj \
+ /p:NativeVersionFile=$__versionSourceFile \
+ /p:ArcadeBuild=true /t:GenerateNativeVersionFile /restore \
+ $__CommonMSBuildArgs $__UnprocessedBuildArgs
+ if [ $? -ne 0 ]; then
+ echo "Failed to generate native version file."
+ exit $?
+ fi
else
# Generate the dummy version.c, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
@if defined _echo @echo on
-call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
- /l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
- /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
- /p:UsePartialNGENOptimization=false /maxcpucount^
- %__ProjectDir%\build.proj /t:GenerateVersionHeader /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile="%__RootBinDir%\obj\_version.h"^
- %__CommonMSBuildArgs% %__UnprocessedBuildArgs%
+powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%~dp0eng\common\msbuild.ps1"^
+ %__ProjectDir%\eng\empty.proj /p:NativeVersionFile="%__RootBinDir%\obj\_version.h"^
+ /p:ArcadeBuild=true /t:GenerateNativeVersionFile /restore^
+ %__CommonMSBuildArgs% %__UnprocessedBuildArgs%
if not !errorlevel! == 0 (
echo %__MsgPrefix%Error: Failed to generate version headers.
exit /b !errorlevel!
__versionSourceFile="$intermediatesForBuild/version.c"
if [ $__SkipGenerateVersion == 0 ]; then
pwd
- "$__ProjectRoot/dotnet.sh" msbuild /nologo /verbosity:minimal /clp:Summary \
- /l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log \
- /p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true \
- /p:UsePartialNGENOptimization=false /maxcpucount \
- "$__ProjectDir/build.proj" /p:GenerateVersionSourceFile=true /t:GenerateVersionSourceFile /p:NativeVersionSourceFile=$__versionSourceFile \
- $__CommonMSBuildArgs $__UnprocessedBuildArgs
+ "$__ProjectRoot/eng/common/msbuild.sh" $__ProjectRoot/eng/empty.proj \
+ /p:NativeVersionFile=$__versionSourceFile \
+ /p:ArcadeBuild=true /t:GenerateNativeVersionFile /restore \
+ $__CommonMSBuildArgs $__UnprocessedBuildArgs
+ if [ $? -ne 0 ]; then
+ echo "Failed to generate native version file."
+ exit $?
+ fi
else
# Generate the dummy version.c, but only if it didn't exist to make sure we don't trigger unnecessary rebuild
__versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
<PackagesBinDir Condition="'$(__PackagesBinDir)'==''">$(BinDir).nuget\</PackagesBinDir>
</PropertyGroup>
- <!-- Version numbers for native binaries and build version props file
- [ARCADE REMOVE] These properties can be removed once native binaries use Arcade versioning
- They are included in common for packaging, which is onboarded to Arcade, but uses the version
- numbers for native binaries for some outputs. -->
- <PropertyGroup>
- <NativeMajorVersion>4</NativeMajorVersion>
- <NativeMinorVersion>6</NativeMinorVersion>
-
- <!-- Explicitly set BuildVersionFile. This is used by BuildVersion.targets in BuildTools. -->
- <BuildVersionFile Condition="'$(OfficialBuildId)' != ''">$(RootBinDir)obj\BuildVersion-$(OfficialBuildId).props</BuildVersionFile>
- </PropertyGroup>
-
<PropertyGroup>
<!-- Central place to set the versions of all nuget packages produced in the repo -->
<PackageVersion Condition="'$(PackageVersion)' == ''">3.0.0</PackageVersion>
<DebugType Condition="'$(DebugType)' == ''">Portable</DebugType>
</PropertyGroup>
- <!-- Version numbers for native binaries -->
- <PropertyGroup>
- <MajorVersion>$(NativeMajorVersion)</MajorVersion>
- <MinorVersion>$(NativeMinorVersion)</MinorVersion>
- </PropertyGroup>
-
<!--
Switching to the .NET Core version of the BuildTools tasks seems to break numerous scenarios, such as VS intellisense and resource designer
as well as running the build on mono. Until we can get these sorted out we will continue using the .NET 4.5 version of the tasks.
<PropertyGroup>
<ExcludePackagingImport>true</ExcludePackagingImport>
<ExcludePackageLibsImport>true</ExcludePackageLibsImport>
+ <ExcludeVersioningImport>true</ExcludeVersioningImport>
</PropertyGroup>
<Import Project="$(ToolsDir)/Build.Common.targets" Condition="'$(UseLiveBuildTools)' != 'true'" />
<PropertyGroup>
<!-- The .NET Core product branding version -->
<ProductVersion>3.0.0</ProductVersion>
+ <!-- File version numbers -->
+ <MajorVersion>4</MajorVersion>
+ <MinorVersion>7</MinorVersion>
<!-- Always use shipping version instead of dummy versions -->
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
<PreReleaseVersionLabel>preview6</PreReleaseVersionLabel>
# Build packages
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- - script: ./build-packages.sh -BuildArch=$(archType) -BuildType=$(buildConfigUpper) $(crossPackagesArg) -OfficialBuildId=$(Build.BuildNumber) $(portableBuildArg) -ci
+ - script: ./build-packages.sh -BuildArch=$(archType) -BuildType=$(buildConfigUpper) $(crossPackagesArg) $(officialBuildIdArg) $(portableBuildArg) -ci
displayName: Build packages
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- - script: build-packages.cmd -BuildArch=$(archType) -BuildType=$(buildConfigUpper) -OfficialBuildId=$(Build.BuildNumber) -ci
+ - script: build-packages.cmd -BuildArch=$(archType) -BuildType=$(buildConfigUpper) $(officialBuildIdArg) -ci
displayName: Build packages
# Publish official build
<IsLineupPackage Condition="'$(IsLineupPackage)' == ''">true</IsLineupPackage>
</PropertyGroup>
- <PropertyGroup>
- <LongNamePlatform>$(PackagePlatform)</LongNamePlatform>
- <LongNamePlatform Condition="'$(LongNamePlatform)'=='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>
- </PropertyGroup>
-
<Import Condition="'$(_packageTargetOSGroup)' != ''" Project="$(MSBuildThisFileDirectory)runtime.$(_packageTargetOSGroup).$(MSBuildProjectName).props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
<?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" />
-
+<Project>
<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)_$(NativeMajorVersion).$(NativeMinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</LongNameSuffix>
- <CrossTargetLongNameSuffix>_$(CrossTargetPlatform)_$(LongNamePlatform)_$(NativeMajorVersion).$(NativeMinorVersion).$(BuildNumberMajor).$(BuildNumberMinor)</CrossTargetLongNameSuffix>
+ <LongNameSuffix>_$(LongNamePlatform)_$(LongNamePlatform)_$(FileVersion)</LongNameSuffix>
+ <CrossTargetLongNameSuffix>_$(CrossTargetPlatform)_$(LongNamePlatform)_$(FileVersion)</CrossTargetLongNameSuffix>
</PropertyGroup>
<ItemGroup>
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"/>
+ <!-- Update the project references with additional properties calculated during the execution phase.
+ _InitializeAssemblyVersion is provided by Arcade. It sets the AssemblyVersion and FileVersion properties.
+ We depend on this private Arcade target instead of the SDK-defined GetAssemblyVersion since the packaging
+ build does not use the .NET SDK -->
+ <Target Name="UpdateAdditionalProperties"
+ BeforeTargets="Build"
+ DependsOnTargets="_InitializeAssemblyVersion">
+ <ItemGroup>
+ <!-- Pass the FileVersion calculated by _InitializeAssemblyVersion to referenced projects -->
+ <ProjectReference Update="@(ProjectReference)"
+ AdditionalProperties="%(AdditionalProperties);FileVersion=$(FileVersion)" />
+ </ItemGroup>
</Target>
</Project>
+++ /dev/null
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <Import Project="..\dir.props" />
- <Import Project="$(ToolsDir)versioning.targets" Condition="Exists('$(ToolsDir)versioning.targets')"/>
-
- <PropertyGroup>
- <VersionPropsImported>false</VersionPropsImported>
- </PropertyGroup>
-
- <Target Name="Build"
- DependsOnTargets="CreateOrUpdateCurrentVersionFile">
- </Target>
-</Project>
\ No newline at end of file