You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some "clever" code that attempts to determine if it needs to
add `Java.Interop/JniEnvironment.g.cs` to `@(Compile)`, since it may
already be there because of file globs, if this isn't a clean/initial
build.
However, this code no longer seems to work under MSBuild 16.8:
`$(_AddCompile)` remains `False` and thus the file isn't getting
added to the compile on the first build.
Instead, use `%(KeepDuplicates)='false'` to do the de-duping for us.
The wrinkle is that this file is added as
`Java.Interop/JniEnvironment.g.cs` or
`Java.Interop\JniEnvironment.g.cs`, depending on host OS, so we need
to use `Path.Combine()` to ensure our added file matches the copy
from the glob, so the de-dupe will work.
Without any de-duping, the build produces a warning:
CS2002: Source file 'JniEnvironment.g.cs' specified multiple times.
0 commit comments