Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<Import Project="$(RepositoryEngineeringDir)resources.targets" />
<Import Project="..\..\Directory.Build.targets" />

<!-- To suppress warnings about reseting the assembly version.-->
<PropertyGroup Condition="'$(AutoGenerateAssemblyVersion)' == 'true'">
<AssemblyVersion></AssemblyVersion>
Copy link
Member

@ericstj ericstj Sep 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this is the warning you're avoiding:
https://github.com/dotnet/arcade/blob/20daa7891e53bd30fc12640fad4a0a9de15ec953/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets#L15

I see that you have to do this, because our default AssemblyVersion is set in props, before a project might set AutoGenerateAssemblyVersion.

So this allows a project to override the repo wide AssemblyVersion with an automatically set AssemblyVersion. I guess an alternative would be to have the repo-wide AssemblyVersion be set in targets and consider if some project set AutoGenerateAssemblyVersion.

Copy link
Contributor Author

@Anipik Anipik Sep 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didnt do that because this needs to be ported to 6.0 and don't want to cause any side-effects by moving the assembly version to targets file. There shouldnt be any but didnt want to take unnecessary risk. Also it would be nice to have all versioning properties in a single file :P

</PropertyGroup>

<PropertyGroup>
<NetCoreAppCurrentBuildSettings>$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)</NetCoreAppCurrentBuildSettings>
<NativeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'native', '$(NetCoreAppCurrentBuildSettings)'))</NativeBinDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<CLSCompliant>false</CLSCompliant>
<IsPackable>false</IsPackable>
<AnalyzerLanguage>cs</AnalyzerLanguage>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<UsingToolXliff>true</UsingToolXliff>
<IsNETCoreAppAnalyzer>true</IsNETCoreAppAnalyzer>
<AnalyzerLanguage>cs</AnalyzerLanguage>
<AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down