Commit 9a878f2
authored
Commit 8898bc1 put too much faith into `$(MSBuildProjectDirectory)).
The problem is that `$(MSBuildProjectDirectory)` *isn't necessarily*
the path to `Directory.Build.props`; it's the directory for the
`.csproj` being built!
The *intent* for 8898bc1 is that e.g. `xamarin/xamarin-android`
should be able to create a `Java.Interop.override.props` file
alongside the `Java.Interop` git submodule, and the Java.Interop
build would use the overrides within `Java.Interop.override.props`.
That didn't happen; due to using `$(MSBuildProjectDirectory)`, the
build may instead attempting to import e.g.
`Java.Interop/src/Java.Interop.override.props`!
Project "$(MSBuildProjectDirectory).override.props" was not imported by "…/external/Java.Interop/Directory.Build.props" at (6,3), due to false condition;
(Exists('$(MSBuildProjectDirectory).override.props')) was evaluated as
(Exists('…/xamarin-android/external/Java.Interop/src/Java.Interop.override.props')).
Oops.
Fix the `<Import/>` expressions so that we instead try to import:
$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))).override.props
We need `$(MSBuildThisFileDirectory)`, as that's the easiest way to
get the checkout directory -- the directory containing
`Directory.Build.props` -- but `$(MSBuildThisFileDirectory)` always
ends in a directory separator character. Remove the directory
separator character by using `Path.GetDirectoryName()`.
This allows e.g. the `Java.Interop.csproj` build to appropriately
import `Java.Interop.override.props`.
1 parent 0c5d454 commit 9a878f2
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments