Replace custom targets for generating assembly attributes and source control info by using SDK features (#7504)

This commit is contained in:
Nate McMaster 2019-02-13 10:22:03 -08:00 committed by GitHub
parent 06d7fe73a9
commit 2ac4619635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 155 additions and 105 deletions

View File

@ -263,7 +263,7 @@ jobs:
jobDisplayName: "Build: Linux Musl x64" jobDisplayName: "Build: Linux Musl x64"
agentOs: Linux agentOs: Linux
buildScript: ./dockerbuild.sh alpine buildScript: ./dockerbuild.sh alpine
buildArgs: --ci --pack --all -e KOREBUILD_SKIP_INSTALL_NETFX=0 --arch x64 --os-name linux-musl --no-build-nodejs --no-build-java -p:RepositoryBranch=$(Build.SourceBranchName) buildArgs: --ci --pack --all -e KOREBUILD_SKIP_INSTALL_NETFX=0 --arch x64 --os-name linux-musl --no-build-nodejs --no-build-java
installNodeJs: false installNodeJs: false
afterBuild: afterBuild:
# Remove packages that are not rid-specific. # Remove packages that are not rid-specific.

View File

@ -15,15 +15,6 @@
<PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl> <PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl>
<!-- The SPDX name for the source license. See https://spdx.org/licenses/. --> <!-- The SPDX name for the source license. See https://spdx.org/licenses/. -->
<PackageLicenseType>Apache-2.0</PackageLicenseType> <PackageLicenseType>Apache-2.0</PackageLicenseType>
<!--
Suppress a warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
replace PackageLicenseUrl with PackageLicenseExpression.
-->
<NoWarn>$(NoWarn);NU5125</NoWarn>
<!-- Suppress warnings about using SemVer 2.0. -->
<NoWarn>$(NoWarn);NU5105</NoWarn>
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
<!-- Contact email address for NuGet packages and Linux installers. --> <!-- Contact email address for NuGet packages and Linux installers. -->
<MaintainerEmail>nugetaspnet@microsoft.com</MaintainerEmail> <MaintainerEmail>nugetaspnet@microsoft.com</MaintainerEmail>
@ -42,6 +33,22 @@
<SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription> <SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription>
</PropertyGroup> </PropertyGroup>
<!-- Warnings and errors -->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!--
Suppress NuGet warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
replace PackageLicenseUrl with PackageLicenseExpression.
-->
<NoWarn>$(NoWarn);NU5125</NoWarn>
<!-- Suppress NuGet warnings about using SemVer 2.0. -->
<NoWarn>$(NoWarn);NU5105</NoWarn>
<!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
<!-- xUnit1004 = warns about skipped tests. Make this a non-fatal build warning. -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);xUnit1004</WarningsNotAsErrors>
</PropertyGroup>
<!-- Source code settings --> <!-- Source code settings -->
<PropertyGroup> <PropertyGroup>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot> <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
@ -49,13 +56,23 @@
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\</SharedSourceRoot> <SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\</SharedSourceRoot>
<GoogleTestSubmoduleRoot>$(RepositoryRoot)src\submodules\googletest\</GoogleTestSubmoduleRoot> <GoogleTestSubmoduleRoot>$(RepositoryRoot)src\submodules\googletest\</GoogleTestSubmoduleRoot>
<!-- Embed source files that are not tracked by the source control manager in the PDB. -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- Additional assembly attributes are already configured to include the source revision ID. -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<!-- These project types are disabled because the presence of a PackageReference causes issues for NuGet. -->
<DisableSourceLink Condition="'$(MSBuildProjectExtension)' == '.zipproj' OR '$(MSBuildProjectExtension)' == '.debproj' OR '$(MSBuildProjectExtension)' == '.rpmproj'">true</DisableSourceLink>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(DisableSourceLink)' != 'true'">
<!-- See https://github.com/dotnet/sourcelink -->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" />
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="$(MicrosoftSourceLinkVstsGitPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" />
</ItemGroup>
<!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props --> <!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props -->
<PropertyGroup> <PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)eng\AspNetCore.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName> <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
@ -77,16 +94,14 @@
linux-arm64 linux-arm64
</SupportedRuntimeIdentifiers> </SupportedRuntimeIdentifiers>
<!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. --> <!-- Make error messages clickable in VS Code's console -->
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm> <GenerateFullPaths Condition="'$(VSCODE_PID)' != ''">true</GenerateFullPaths>
<!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. --> <!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<!-- Fixes a common error in targets implementing a NoBuild mode. --> <!-- Fixes a common error in targets implementing a NoBuild mode. -->
<BuildProjectReferences Condition=" '$(NoBuild)' == 'true' ">false</BuildProjectReferences> <BuildProjectReferences Condition=" '$(NoBuild)' == 'true' ">false</BuildProjectReferences>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict</Features>
</PropertyGroup> </PropertyGroup>
<Import Project="eng\Versions.props" /> <Import Project="eng\Versions.props" />
@ -139,12 +154,17 @@
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject> <IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject> <IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
<IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject> <IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
<DisableDeterministicSourceRoot Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">true</DisableDeterministicSourceRoot>
</PropertyGroup> </PropertyGroup>
<Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" /> <Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
<PropertyGroup> <PropertyGroup>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
<!--
Disable deterministic source paths in test assets and samples.
In order for the debugger to find source files when debugging a locally built binary the PDB must contain original, unmapped local paths
-->
<DeterministicSourcePaths Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">false</DeterministicSourcePaths>
<!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. --> <!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. -->
<MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\src\Microsoft.AspNetCore.Mvc.Testing\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets> <MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\src\Microsoft.AspNetCore.Mvc.Testing\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
<!-- IIS native projects can only be built on Windows for x86 and x64. --> <!-- IIS native projects can only be built on Windows for x86 and x64. -->

View File

@ -67,6 +67,7 @@
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload> <BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
</PropertyGroup> </PropertyGroup>
<Import Project="eng\Workarounds.targets" />
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " /> <Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
<Import Project="eng\targets\Cpp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" /> <Import Project="eng\targets\Cpp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
<Import Project="eng\targets\CSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.csproj'" /> <Import Project="eng\targets\CSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />

View File

@ -23,15 +23,15 @@
</Target> </Target>
<Target Name="GenerateBuildAssetManifest" <Target Name="GenerateBuildAssetManifest"
DependsOnTargets="GetFilesToPublish;ResolveRepositoryBranch;ResolveCommitHash"> DependsOnTargets="GetFilesToPublish">
<GenerateBuildManifest <GenerateBuildManifest
Artifacts="@(PackageToPublish)" Artifacts="@(PackageToPublish)"
OutputPath="$(ManifestsPath)aspnetcore-$(TargetRuntimeIdentifier)-$(PackageVersion).xml" OutputPath="$(ManifestsPath)aspnetcore-$(TargetRuntimeIdentifier)-$(PackageVersion).xml"
BuildId="$(PackageVersion)" BuildId="$(PackageVersion)"
RepoUri="$(RepositoryUrl)" RepoUri="$(BUILD_REPOSITORY_URI)"
RepoBranch="$(RepositoryBranch)" RepoBranch="$(BUILD_SOURCEBRANCH)"
RepoCommit="$(RepositoryCommit)" /> RepoCommit="$(BUILD_SOURCEVERSION)" />
</Target> </Target>
</Project> </Project>

View File

@ -21,7 +21,7 @@
<Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" /> <Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" />
<Target Name="_BuildSharedFxProjects" DependsOnTargets="ResolveCommitHash"> <Target Name="_BuildSharedFxProjects">
<PropertyGroup> <PropertyGroup>
<_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput> <_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput>

View File

@ -2,7 +2,6 @@
<Import Project="AzureIntegration.targets" /> <Import Project="AzureIntegration.targets" />
<Import Project="SharedFx.targets" /> <Import Project="SharedFx.targets" />
<Import Project="CodeSign.targets" /> <Import Project="CodeSign.targets" />
<Import Project="..\eng\Workarounds.targets" />
<PropertyGroup> <PropertyGroup>
<!-- Some projects need access to tasks bundled in KoreBuild. --> <!-- Some projects need access to tasks bundled in KoreBuild. -->

View File

@ -98,7 +98,7 @@ fi
commit_hash="$(git rev-parse HEAD || true)" commit_hash="$(git rev-parse HEAD || true)"
if [ ! -z "$commit_hash" ]; then if [ ! -z "$commit_hash" ]; then
build_args[${#build_args[*]}]="-p:RepositoryCommit=$commit_hash" build_args[${#build_args[*]}]="-p:SourceRevisionId=$commit_hash"
fi fi
dockerfile="$DIR/build/docker/$image.Dockerfile" dockerfile="$DIR/build/docker/$image.Dockerfile"
@ -118,6 +118,9 @@ docker run \
-e TEAMCITY_VERSION \ -e TEAMCITY_VERSION \
-e BUILD_NUMBER \ -e BUILD_NUMBER \
-e BUILD_BUILDNUMBER \ -e BUILD_BUILDNUMBER \
-e BUILD_REPOSITORY_URI \
-e BUILD_SOURCEVERSION \
-e BUILD_SOURCEBRANCH \
-e DOTNET_CLI_TELEMETRY_OPTOUT \ -e DOTNET_CLI_TELEMETRY_OPTOUT \
-e Configuration \ -e Configuration \
-v "$DIR:/code/build" \ -v "$DIR:/code/build" \

View File

@ -130,6 +130,8 @@
<InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">3.0.0-build-20190130.1</InternalAspNetCoreSdkPackageVersion> <InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">3.0.0-build-20190130.1</InternalAspNetCoreSdkPackageVersion>
<MicrosoftNETFrameworkReferenceAssembliesPackageVersion>1.0.0-alpha-004</MicrosoftNETFrameworkReferenceAssembliesPackageVersion> <MicrosoftNETFrameworkReferenceAssembliesPackageVersion>1.0.0-alpha-004</MicrosoftNETFrameworkReferenceAssembliesPackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion> <MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
<MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkGitHubPackageVersion>
<MicrosoftSourceLinkVstsGitPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkVstsGitPackageVersion>
<!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 --> <!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
<SystemBuffersPackageVersion>4.5.0</SystemBuffersPackageVersion> <SystemBuffersPackageVersion>4.5.0</SystemBuffersPackageVersion>
<SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion> <SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion>

View File

@ -1,3 +1,9 @@
<!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. --> <!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. -->
<Project> <Project>
<!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. -->
<Target Name="_EnsureSourceLinkHappensBeforeRazorComponentGeneration"
BeforeTargets="PrepareForRazorComponentGenerate"
DependsOnTargets="GenerateSourceLinkFile" />
</Project> </Project>

View File

@ -2,6 +2,22 @@
<PropertyGroup> <PropertyGroup>
<LangVersion>7.3</LangVersion> <LangVersion>7.3</LangVersion>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\AspNetCore.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. -->
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict</Features>
<!-- Disables targets in Internal.AspNetCore.Sdk which are obsolete. -->
<GenerateSourceLinkFile>false</GenerateSourceLinkFile>
<GenerateRepositoryCommitUrlInDescription>false</GenerateRepositoryCommitUrlInDescription>
<GenerateCommitHashAttribute>false</GenerateCommitHashAttribute>
<GenerateInternalAspNetCoreAttributes>false</GenerateInternalAspNetCoreAttributes>
<DisableDeterministicSourceRoot>true</DisableDeterministicSourceRoot>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -5,7 +5,35 @@
<TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework> <TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier> <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
</PropertyGroup> </PropertyGroup>
<Target Name="GetCustomAssemblyAttributes"
BeforeTargets="GetAssemblyAttributes"
DependsOnTargets="InitializeSourceControlInformation">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(SourceRevisionId)' != ''">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="$(RepositoryUrl.StartsWith('https://github.com'))">
<_Parameter1>SourceCommitUrl</_Parameter1>
<_Parameter2>$(RepositoryUrl)/tree/$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(Serviceable)' == 'true'">
<_Parameter1>Serviceable</_Parameter1>
<_Parameter2>True</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>
<Target Name="GetCustomFileVersion" BeforeTargets="GetAssemblyVersion">
<PropertyGroup Condition="'$(FileVerison)' == '' AND '$(FileRevisionVersion)' != ''">
<FileVersion>$(VersionPrefix).$(FileRevisionVersion)</FileVersion>
</PropertyGroup>
</Target>
<Import Project="Packaging.targets" /> <Import Project="Packaging.targets" />
<Import Project="ResolveReferences.targets" /> <Import Project="ResolveReferences.targets" />
</Project> </Project>

View File

@ -19,4 +19,17 @@
</ItemGroup> </ItemGroup>
</Target> </Target>
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);_AppendRepostoryUrlToPackageDescription</GenerateNuspecDependsOn>
</PropertyGroup>
<Target Name="_AppendRepostoryUrlToPackageDescription"
DependsOnTargets="InitializeSourceControlInformation">
<PropertyGroup Condition="'$(RepositoryUrl)' != '' AND '$(SourceRevisionId)' != ''">
<PackageDescription>$(PackageDescription)
This package was built from the source code at $(RepositoryUrl)/tree/$(SourceRevisionId)</PackageDescription>
</PropertyGroup>
</Target>
</Project> </Project>

View File

@ -8,8 +8,8 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- Required to make NuGet happy --> <TargetFrameworkMoniker>Native,Version=v0.0</TargetFrameworkMoniker>
<TargetFramework>net461</TargetFramework>
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath> <MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
<MSBuildProjectExtensionsPath Condition="'$(MSBuildProjectExtensionsPath)' == ''">$(MSBuildProjectDir)\obj\</MSBuildProjectExtensionsPath> <MSBuildProjectExtensionsPath Condition="'$(MSBuildProjectExtensionsPath)' == ''">$(MSBuildProjectDir)\obj\</MSBuildProjectExtensionsPath>
<!-- IsRunningFromVisualStudio may be true even when running msbuild.exe from command line. This generally means that MSBUild is Visual Studio installation and therefore we need to find NuGet.targets in a different location. --> <!-- IsRunningFromVisualStudio may be true even when running msbuild.exe from command line. This generally means that MSBUild is Visual Studio installation and therefore we need to find NuGet.targets in a different location. -->

View File

@ -22,21 +22,4 @@
<Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" /> <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorAssemblyAttribute>
<RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorTargetAssemblyAttribute>
</ItemGroup>
<ItemGroup>
<RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
<RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
</ItemGroup>
</Project> </Project>

View File

@ -22,21 +22,4 @@
<Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" /> <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorAssemblyAttribute>
<RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorTargetAssemblyAttribute>
</ItemGroup>
<ItemGroup>
<RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
<RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
</ItemGroup>
</Project> </Project>

View File

@ -28,7 +28,7 @@
componentsversion=$(ComponentsPackageVersion); componentsversion=$(ComponentsPackageVersion);
razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion); razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion);
blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion); blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion);
repositorycommit=$(RepositoryCommit);</NuspecProperties> repositorycommit=$(SourceRevisionId);</NuspecProperties>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<_TargetFramework Include="$(TargetFramework)" /> <_TargetFramework Include="$(TargetFramework)" />

View File

@ -35,7 +35,7 @@
blazorversion=$(PackageVersion); blazorversion=$(PackageVersion);
aspnetcoreversion=$(ComponentsPackageVersion); aspnetcoreversion=$(ComponentsPackageVersion);
sharedfxversion=$(SharedFxVersion); sharedfxversion=$(SharedFxVersion);
repositorycommit=$(RepositoryCommit);</NuspecProperties> repositorycommit=$(SourceRevisionId);</NuspecProperties>
</PropertyGroup> </PropertyGroup>
<!-- Also temporarily generate the runtimeconfig.json manually until we can use <FrameworkReference> --> <!-- Also temporarily generate the runtimeconfig.json manually until we can use <FrameworkReference> -->
<Sdk_GenerateFileFromTemplate <Sdk_GenerateFileFromTemplate

View File

@ -22,7 +22,7 @@
IncludeCustomRestoreSources=$(IncludeCustomRestoreSourcesValue); IncludeCustomRestoreSources=$(IncludeCustomRestoreSourcesValue);
TemplateBlazorVersion=$(PackageVersion); TemplateBlazorVersion=$(PackageVersion);
TemplateComponentsVersion=$(ComponentsPackageVersion); TemplateComponentsVersion=$(ComponentsPackageVersion);
RepositoryCommit=$(RepositoryCommit); RepositoryCommit=$(SourceRevisionId);
</GeneratedContentProperties> </GeneratedContentProperties>
</PropertyGroup> </PropertyGroup>
</Target> </Target>

View File

@ -17,7 +17,7 @@
<PropertyGroup> <PropertyGroup>
<NuspecProperties> <NuspecProperties>
version=$(PackageVersion); version=$(PackageVersion);
repositorycommit=$(RepositoryCommit); repositorycommit=$(SourceRevisionId);
</NuspecProperties> </NuspecProperties>
</PropertyGroup> </PropertyGroup>
</Target> </Target>

View File

@ -174,9 +174,9 @@ This targets file should only be imported by .shfxproj files.
</Target> </Target>
<!-- Generates the .version file in the shared framework --> <!-- Generates the .version file in the shared framework -->
<Target Name="GenerateSharedFxVersionsFile"> <Target Name="GenerateSharedFxVersionsFile" DependsOnTargets="InitializeSourceControlInformation">
<ItemGroup> <ItemGroup>
<VersionLines Include="$(RepositoryCommit)" /> <VersionLines Include="$(SourceRevisionId)" />
<VersionLines Include="$(PackageVersion)" /> <VersionLines Include="$(PackageVersion)" />
</ItemGroup> </ItemGroup>
@ -369,7 +369,7 @@ This targets file should only be imported by .shfxproj files.
projectUrl=$(PackageProjectUrl); projectUrl=$(PackageProjectUrl);
iconUrl=$(PackageIconUrl); iconUrl=$(PackageIconUrl);
repositoryUrl=$(RepositoryUrl); repositoryUrl=$(RepositoryUrl);
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(SourceRevisionId);
copyright=$(Copyright); copyright=$(Copyright);
targetFramework=$(TargetFramework); targetFramework=$(TargetFramework);
symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath))); symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));

View File

@ -14,10 +14,6 @@
<_Parameter1>TargetRuntimeIdentifier</_Parameter1> <_Parameter1>TargetRuntimeIdentifier</_Parameter1>
<_Parameter2>$(TargetRuntimeIdentifier)</_Parameter2> <_Parameter2>$(TargetRuntimeIdentifier)</_Parameter2>
</AssemblyAttribute> </AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>RepositoryCommit</_Parameter1>
<_Parameter2>$(RepositoryCommit)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData"> <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>MicrosoftNETCoreAppPackageVersion</_Parameter1> <_Parameter1>MicrosoftNETCoreAppPackageVersion</_Parameter1>
<_Parameter2>$(RuntimeFrameworkVersion)</_Parameter2> <_Parameter2>$(RuntimeFrameworkVersion)</_Parameter2>
@ -35,8 +31,12 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="ResolveProjectReferences"> <Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="ResolveProjectReferences;InitializeSourceControlInformation">
<ItemGroup> <ItemGroup>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>RepositoryCommit</_Parameter1>
<_Parameter2>$(SourceRevisionId)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData"> <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>SharedFxDependencies</_Parameter1> <_Parameter1>SharedFxDependencies</_Parameter1>
<_Parameter2>@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference)</_Parameter2> <_Parameter2>@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference)</_Parameter2>

View File

@ -38,24 +38,6 @@
<Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" /> <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorAssemblyAttribute>
<RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
<_Parameter1>BuildNumber</_Parameter1>
<_Parameter2>$(BuildNumber)</_Parameter2>
</RazorTargetAssemblyAttribute>
</ItemGroup>
<ItemGroup>
<RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
<RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<UIFrameworkVersionMoniker Include="V3" /> <UIFrameworkVersionMoniker Include="V3" />
<UIFrameworkVersionMoniker Include="V4" /> <UIFrameworkVersionMoniker Include="V4" />

View File

@ -17,6 +17,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj"> <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType> <OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference> </ProjectReference>

View File

@ -26,6 +26,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj"> <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties> <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<OutputItemType>_ResolvedFxProjects</OutputItemType> <OutputItemType>_ResolvedFxProjects</OutputItemType>
</ProjectReference> </ProjectReference>

View File

@ -3,6 +3,7 @@
<PropertyGroup> <PropertyGroup>
<ANCM-Setup Condition="$(ANCM-Setup) == ''">$(MSBuildThisFileDirectory)..\</ANCM-Setup> <ANCM-Setup Condition="$(ANCM-Setup) == ''">$(MSBuildThisFileDirectory)..\</ANCM-Setup>
<EnableSourceLink>false</EnableSourceLink>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@ -0,0 +1,8 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
<PropertyGroup>
<!-- Some of the tests make assertions which require symbols to map exactly back to the source root. -->
<DeterministicSourcePaths>false</DeterministicSourcePaths>
</PropertyGroup>
</Project>

View File

@ -28,7 +28,7 @@
projectUrl=$(PackageProjectUrl); projectUrl=$(PackageProjectUrl);
iconUrl=$(PackageIconUrl); iconUrl=$(PackageIconUrl);
repositoryUrl=$(RepositoryUrl); repositoryUrl=$(RepositoryUrl);
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(SourceRevisionId);
copyright=$(Copyright); copyright=$(Copyright);
OutputBinary=$(OutputPath)$(AssemblyName).dll; OutputBinary=$(OutputPath)$(AssemblyName).dll;

View File

@ -33,7 +33,7 @@
projectUrl=$(PackageProjectUrl); projectUrl=$(PackageProjectUrl);
iconUrl=$(PackageIconUrl); iconUrl=$(PackageIconUrl);
repositoryUrl=$(RepositoryUrl); repositoryUrl=$(RepositoryUrl);
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(SourceRevisionId);
copyright=$(Copyright); copyright=$(Copyright);
OutputBinary=$(OutputPath)$(AssemblyName).dll; OutputBinary=$(OutputPath)$(AssemblyName).dll;

View File

@ -46,7 +46,7 @@
licenseUrl=$(PackageLicenseUrl); licenseUrl=$(PackageLicenseUrl);
owners=$(Company); owners=$(Company);
projectUrl=$(PackageProjectUrl); projectUrl=$(PackageProjectUrl);
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(SourceRevisionId);
repositoryUrl=$(RepositoryUrl); repositoryUrl=$(RepositoryUrl);
tags=$(PackageTags.Replace(';', ' ')); tags=$(PackageTags.Replace(';', ' '));
version=$(PackageVersion); version=$(PackageVersion);

View File

@ -14,7 +14,7 @@
projectUrl=$(PackageProjectUrl); projectUrl=$(PackageProjectUrl);
repositoryUrl=$(RepositoryUrl); repositoryUrl=$(RepositoryUrl);
repositoryType=$(RepositoryType); repositoryType=$(RepositoryType);
repositoryCommit=$(RepositoryCommit); repositoryCommit=$(SourceRevisionId);
</NuspecProperties> </NuspecProperties>
</PropertyGroup> </PropertyGroup>
</Target> </Target>

View File

@ -8,6 +8,7 @@
<PreReleaseBrandingLabel>Preview $(PreReleasePreviewNumber)</PreReleaseBrandingLabel> <PreReleaseBrandingLabel>Preview $(PreReleasePreviewNumber)</PreReleaseBrandingLabel>
<ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix> <ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix>
<BlazorComponentsVersionPrefix>0.8.$(AspNetCorePatchVersion)</BlazorComponentsVersionPrefix> <BlazorComponentsVersionPrefix>0.8.$(AspNetCorePatchVersion)</BlazorComponentsVersionPrefix>
<VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
<!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. --> <!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. -->
<AspNetCoreModuleVersionMajor>1$(AspNetCoreMajorVersion)</AspNetCoreModuleVersionMajor> <AspNetCoreModuleVersionMajor>1$(AspNetCoreMajorVersion)</AspNetCoreModuleVersionMajor>
@ -15,10 +16,10 @@
<AspNetCoreModuleVersionRevision>$(AspNetCorePatchVersion)</AspNetCoreModuleVersionRevision> <AspNetCoreModuleVersionRevision>$(AspNetCorePatchVersion)</AspNetCoreModuleVersionRevision>
<OfficialBuildId Condition="'$(OfficialBuildId)' == ''">$(BUILD_BUILDNUMBER)</OfficialBuildId> <OfficialBuildId Condition="'$(OfficialBuildId)' == ''">$(BUILD_BUILDNUMBER)</OfficialBuildId>
<OfficialBuildId Condition="'$(OfficialBuildId)' == '' AND '$(TEAMCITY_VERSION)' != ''">$([System.DateTime]::Now.ToString('yyyyMMdd')).$(BUILD_NUMBER)</OfficialBuildId> <OfficialBuildId Condition="'$(OfficialBuildId)' == '' AND '$(IsOfficialBuild)' == 'true'">$([System.DateTime]::Now.ToString('yyyyMMdd')).1</OfficialBuildId>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(OfficialBuildId)' != '' AND '$(BuildNumberSuffix)' == '' "> <PropertyGroup Condition=" '$(OfficialBuildId)' != '' ">
<!-- This *mostly* implements core versioning. Spec: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md --> <!-- This *mostly* implements core versioning. Spec: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md -->
<_BuildNumber>$(OfficialBuildId)</_BuildNumber> <_BuildNumber>$(OfficialBuildId)</_BuildNumber>
@ -32,18 +33,20 @@
<_BuildNumberShortDate>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</_BuildNumberShortDate> <_BuildNumberShortDate>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</_BuildNumberShortDate>
<VersionSuffixBuildOfTheDay>$([System.Convert]::ToInt32($(_BuildNumberR)))</VersionSuffixBuildOfTheDay> <VersionSuffixBuildOfTheDay>$([System.Convert]::ToInt32($(_BuildNumberR)))</VersionSuffixBuildOfTheDay>
<VersionSuffixBuildOfTheDayPadded>$(VersionSuffixBuildOfTheDay.PadLeft(2, '0'))</VersionSuffixBuildOfTheDayPadded>
<!-- This is where we currently differ from the core versioning spec. This can be removed when we get official builds running in Azure Pipelines. -->
<VersionSuffixBuildOfTheDayPadded Condition=" '$(TEAMCITY_VERSION)' == '' ">$(VersionSuffixBuildOfTheDay.PadLeft(2, '0'))</VersionSuffixBuildOfTheDayPadded>
<VersionSuffixBuildOfTheDayPadded Condition=" '$(TEAMCITY_VERSION)' != '' ">$(VersionSuffixBuildOfTheDay.PadLeft(4, '0'))</VersionSuffixBuildOfTheDayPadded>
<!-- TODO: consider using semver 2.0 instead, when/if https://github.com/dotnet/core-setup/issues/4795 is resolved --> <!-- TODO: consider using semver 2.0 instead, when/if https://github.com/dotnet/core-setup/issues/4795 is resolved -->
<BuildNumberSuffix>$(_BuildNumberShortDate)-$(VersionSuffixBuildOfTheDayPadded)</BuildNumberSuffix> <BuildNumberSuffix>$(_BuildNumberShortDate)-$(VersionSuffixBuildOfTheDayPadded)</BuildNumberSuffix>
<FileRevisionVersion>$(_BuildNumberShortDate)</FileRevisionVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(OfficialBuildId)' == '' ">
<BuildNumberSuffix>t000</BuildNumberSuffix>
<FileRevisionVersion>42424</FileRevisionVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<BuildNumberSuffix Condition=" '$(BuildNumberSuffix)' == '' ">t000</BuildNumberSuffix>
<VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
<VersionSuffix>$(PreReleaseLabel)-$(BuildNumberSuffix)</VersionSuffix> <VersionSuffix>$(PreReleaseLabel)-$(BuildNumberSuffix)</VersionSuffix>
<BrandingVersionSuffix>$(PreReleaseBrandingLabel) Build $(BuildNumberSuffix)</BrandingVersionSuffix> <BrandingVersionSuffix>$(PreReleaseBrandingLabel) Build $(BuildNumberSuffix)</BrandingVersionSuffix>