-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Use GitInfo to generate $(Version) (#865)
[build] Use GitInfo to generate $(Version) (#865) Context: http://github.com/xamarin/xamarin-android/commit/2d81740cc1c708cd0474c9eac8936cd7abfc72e3 Context: dotnet/android#5749 In order to better support building solutions which reference both .NET 6 and legacy projects within Visual Studio, we have begun strong-naming all the MSBuild-related assemblies; see also ff27142. This allows loading two different version of the "same" assembly, e.g. `Java.Interop.Tools.Diagnostics.dll`, from two different filesystem locations in the same AppDomain/AssemblyLoadContext. However, strong-naming is only part of the solution. The other part is that, for sanity and reliability, the "two different versions of the 'same' assembly" should *also* have different assembly *versions*. If they have the same assembly version, are they truly different? Update the build system by adding a `Directory.Build.targets` and `GitInfo.txt` file so that the the [`GitInfo`][0] [NuGet Package][1] will be used to "fully" set the `$(Version)` MSBuild property, consisting of the major and minor version numbers contained within `GitInfo.txt`, along with a "computed" `$(GitSemVerPatch)` value based on the "patch version" in `GitInfo.txt`, if present, added to the number of commits which have occurred since `GitInfo.txt` changed. Additionally, set the `$(InformationalVersion)` MSBuild property so that it mirrors the behavior in [`Mono.Android.dll`][2]: [assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.1; git-rev-head:2eb9ff2; git-branch:main") Setting the `$(Version)` and `$(InformationalVersion)` MSBuild properties also requires setting `$(GenerateAssemblyInfo)`=True. Update `src/Java.Interop/Properties/AssemblyInfo.cs` to remove the attributes that `$(GenerateAssemblyInfo)` will generate. Other: * Centralize the `$(Company)` and `$(Copyright)` values. * Various whitespace changes due to `.editorconfig`. [0]: https://github.com/devlooped/GitInfo [1]: https://www.nuget.org/packages/GitInfo/2.1.2 [2]: dotnet/android@b620689
- Loading branch information
1 parent
2eb9ff2
commit d16b1e5
Showing
11 changed files
with
34 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters