Skip to content

Commit 648aff9

Browse files
authored
[libzip, mono-runtimes, monodroid] Build with msbuild (#1539)
Like e3abe4b, but different: we had another `xbuild`-ism that `msbuild` doesn't like: the "intermixing" of "strings" and item metdata within *top-level* item groups. For example: <_MonoCrossRuntimeIntermediateOutput Include="$(IntermediateOutputPath)\%(_MonoCrossRuntime.Identity)\mono\mini\mono-sgen%(_MonoCrossRuntime.ExeSuffix)" /> The above uses item metadata, e.g. `%(_MonoCrossRuntime.Identity)`, *outside* of a `@(_MonoCrossRuntime->'...')` context, at top-level scope. The result is a [build break][0] [0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-msbuild/857/ src/mono-runtimes/mono-runtimes.targets(818,5): error MSB3375: The file "obj/Debug//%(_MonoCrossRuntime.Identity)/mono/mini/mono-sgen%(_MonoCrossRuntime.ExeSuffix)" does not exist. Note that the item metadata wasn't actually replaced, and instead was used literally. The fix is to replace the above "intermixing" with `@(Foo->...)`: <_MonoCrossRuntimeIntermediateOutput Include="@(_MonoCrossRuntime->'$(IntermediateOutputPath)\%(Identity)\mono\mini\mono-sgen%(ExeSuffix)')" /> This appeases MSBuild, allowing things to build. Review matches for: $ git grep '<.*Include="\$.*%' and fix any top-level `<ItemGroup/>` matches.
1 parent 7418105 commit 648aff9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/libzip/libzip.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</Content>
3939
</ItemGroup>
4040
<ItemGroup>
41-
<_LibZipTargetMakefile Include="$(IntermediateOutputPath)\%(_LibZipTarget.Identity)\Makefile" />
41+
<_LibZipTargetMakefile Include="@(_LibZipTarget->'$(IntermediateOutputPath)\%(Identity)\Makefile')" />
4242
</ItemGroup>
4343
<Target Name="_Make"
4444
Condition=" '@(_LibZipTarget)' != '' "

src/mono-runtimes/mono-runtimes.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,9 @@
796796
</Target>
797797

798798
<ItemGroup>
799-
<_MonoCrossRuntimeStamp Include="$(IntermediateOutputPath)\%(_MonoCrossRuntime.Identity)\.stamp" />
800-
<_MonoCrossRuntimeIntermediateOutput Include="$(IntermediateOutputPath)\%(_MonoCrossRuntime.Identity)\mono\mini\mono-sgen%(_MonoCrossRuntime.ExeSuffix)" />
801-
<_MonoCrossRuntimeOutput Include="$(_MSBuildDir)\%(_MonoCrossRuntime.InstallPath)%(_MonoCrossRuntime.CrossMonoName)%(_MonoCrossRuntime.ExeSuffix)" />
799+
<_MonoCrossRuntimeStamp Include="@(_MonoCrossRuntime->'$(IntermediateOutputPath)\%(Identity)\.stamp')" />
800+
<_MonoCrossRuntimeIntermediateOutput Include="@(_MonoCrossRuntime->'$(IntermediateOutputPath)\%(Identity)\mono\mini\mono-sgen%(ExeSuffix)')" />
801+
<_MonoCrossRuntimeOutput Include="@(_MonoCrossRuntime->'$(_MSBuildDir)\%(InstallPath)%(CrossMonoName)%(ExeSuffix)')" />
802802
</ItemGroup>
803803

804804
<!-- The condition below is to work around a bug in xbuild which attempts to batch

src/monodroid/monodroid.targets

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@
105105
</Target>
106106
<Target Name="_GetBuildHostRuntimes">
107107
<ItemGroup>
108-
<_OutputDebugPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\%(_HostRuntime.OutputBasename).debug.d.%(_HostRuntime.NativeLibraryExtension)" />
109-
<_OutputDebugStripPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\%(_HostRuntime.OutputBasename).debug.%(_HostRuntime.NativeLibraryExtension)" />
110-
<_OutputReleasePath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\%(_HostRuntime.OutputBasename).release.d.%(_HostRuntime.NativeLibraryExtension)" />
111-
<_OutputReleaseStripPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\%(_HostRuntime.OutputBasename).release.%(_HostRuntime.NativeLibraryExtension)" />
108+
<_OutputDebugPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\libmono-android.debug.d.%(_HostRuntime.NativeLibraryExtension)" />
109+
<_OutputDebugStripPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\libmono-android.debug.%(_HostRuntime.NativeLibraryExtension)" />
110+
<_OutputReleasePath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\libmono-android.release.d.%(_HostRuntime.NativeLibraryExtension)" />
111+
<_OutputReleaseStripPath Include="$(OutputPath)%(_HostRuntime.OutputDirectory)\libmono-android.release.%(_HostRuntime.NativeLibraryExtension)" />
112112
</ItemGroup>
113113
</Target>
114114
<Target Name="_BuildHostRuntimes"

0 commit comments

Comments
 (0)