Skip to content

Commit 061bcc2

Browse files
author
Bret Johnson
authored
[build] Import "parent directory.override.targets" (#135)
Context: ff73f92 Context: https://github.com/xamarin/XamarinVS/pull/12550 The XamarinVS team would like to *not* use `GitInfo` to set the `$(Version)` MSBuild property (commit ff73f92), and would like to instead version *all* of their dependencies with the same version. Support this behavior by by updating `Directory.Build.targets` to import "parent directory.override.targets", a'la [xamarin/java.interop@8898bc][0] and [xamarin/java.interop@9a878f][1]. For example, if `xamarin-android-tools` is checked out into: external/xamarin-android-tools then we'll import `external/xamarin-android-tools.override.targets` from `Directory.Build.targets`. The `<Import/>` of the parent-directory `.targets` file *must* be *last* within `Directory.Build.targets`, so that it can override any targets in our default `Directory.Build.targets`, e.g. the `SetVersion` target. [0]: dotnet/java-interop@8898bc1 [1]: dotnet/java-interop@9a878f2
1 parent a5194e9 commit 061bcc2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Directory.Build.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@
1313
<InformationalVersion>$(Version); git-rev-head:$(GitCommit); git-branch:$(GitBranch)</InformationalVersion>
1414
</PropertyGroup>
1515
</Target>
16+
17+
<Import
18+
Project="$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.targets"
19+
Condition=" Exists('$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.targets') "
20+
/>
1621
</Project>

0 commit comments

Comments
 (0)