Skip to content

Commit

Permalink
[release/8.0] Add SBRP attribute (#802)
Browse files Browse the repository at this point in the history
* Add SBRP attribute

* Generate SBRP attribute with PackageSourceGenerator

* Generalize adding attribute to CSharp file

* Update CSharp file attributes

* Add attributes to beginning of file

* Use msbuild to add attribute

* Revert PackageSourceGenerator changes

* Build with CSharp file

* Rename file, add license header, fix spacing, use different compile item

---------

Co-authored-by: Ella Hathaway <ellahath@umich.edu>
  • Loading branch information
github-actions[bot] and ellahathaway committed Oct 16, 2023
1 parent 5dd44eb commit b4fa7f2
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 28 deletions.
4 changes: 4 additions & 0 deletions src/SourceBuildAssemblyMetdata.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

[assembly: System.Reflection.AssemblyMetadata("source", "source-build-reference-packages")]
5 changes: 5 additions & 0 deletions src/referencePackages/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<Project>

<Import Project="..\..\Directory.Build.props" />

<ItemGroup>
<!-- Attributes for all Reference Packages -->
<Compile Include="$(RepoRoot)src\SourceBuildAssemblyMetdata.cs" />
</ItemGroup>

<PropertyGroup>
<!-- Common properties for all Reference Packages -->
Expand Down
10 changes: 8 additions & 2 deletions src/referencePackages/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,18 @@

<Target Name="CopyBuildOutputToTempOutput"
AfterTargets="CopyFilesToOutputDirectory">

<ItemGroup>
<CompileForRelativePath Include="@(Compile)" />
<CompileForRelativePath Remove="$(RepoRoot)src\SourceBuildAssemblyMetdata.cs" />
</ItemGroup>

<Error
Condition="@(Compile->Count()) != 1"
Condition="@(CompileForRelativePath->Count()) != 1"
Text="Number of Compile items != 1. We need just one, to determine the path of the resulting DLL in the package including ref/lib and TFM." />

<ItemGroup>
<FullCompileDir Include="$([System.IO.Directory]::GetParent('%(Compile.Identity)'))" />
<FullCompileDir Include="$([System.IO.Directory]::GetParent('%(CompileForRelativePath.Identity)'))" />
<RelativeCompileDir Include="$([MSBuild]::MakeRelative('$(MSBuildProjectDirectory)\', '%(FullCompileDir.Identity)'))" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("6.0.21.52210")]
[assembly: AssemblyInformationalVersion("6.0.21.52210 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("6.0.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.30319.17929")]
[assembly: AssemblyInformationalVersion("4.0.30319.17929 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.40013.0")]
[assembly: AssemblyInformationalVersion("4.0.40013.0 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.10.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.23123.00")]
[assembly: AssemblyInformationalVersion("4.6.23123.00 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.20.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("1.0.24212.01")]
[assembly: AssemblyInformationalVersion("1.0.24212.01 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.1.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.30319.17929")]
[assembly: AssemblyInformationalVersion("4.0.30319.17929 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.40013.0")]
[assembly: AssemblyInformationalVersion("4.0.40013.0 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.10.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.23123.00")]
[assembly: AssemblyInformationalVersion("4.6.23123.00 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.20.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("1.0.24212.01")]
[assembly: AssemblyInformationalVersion("1.0.24212.01 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.1.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.30319.17929")]
[assembly: AssemblyInformationalVersion("4.0.30319.17929 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.0.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.0.40013.0")]
[assembly: AssemblyInformationalVersion("4.0.40013.0 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.10.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("4.6.23123.00")]
[assembly: AssemblyInformationalVersion("4.6.23123.00 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.0.20.0")]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
[assembly: AssemblyProduct("Microsoft® .NET Framework")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyFileVersion("1.0.24212.01")]
[assembly: AssemblyInformationalVersion("1.0.24212.01 built by: SOURCEBUILD")]
[assembly: CLSCompliant(true)]
[assembly: AssemblyMetadata("", "")]
[assembly: AssemblyVersion("4.1.0.0")]


Expand Down
5 changes: 5 additions & 0 deletions src/targetPacks/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<Project>
<Import Project="..\..\Directory.Build.props" />

<ItemGroup>
<!-- Attributes for all Target Packages -->
<Compile Include="$(RepoRoot)src\SourceBuildAssemblyMetdata.cs" />
</ItemGroup>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand Down

0 comments on commit b4fa7f2

Please sign in to comment.