Skip to content

Commit

Permalink
[tests] Fix building the custom-type-assembly assembly from inside a …
Browse files Browse the repository at this point in the history
…project file. (xamarin#21347)

Building the custom-type-assembly assembly doesn't work quite right if the
RuntimeIdentifier(s) variables are set in the environment from the project
file, so don't forward those to the sub-make we execute to build the assembly.

This fixes an issue where building monotouch-test would fail locally, because
building the custom-type-assembly assembly would fail.

Also remove legacy Xamarin logic.
  • Loading branch information
rolfbjarne authored Oct 2, 2024
1 parent abcec04 commit 3317327
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
6 changes: 3 additions & 3 deletions tests/monotouch-test/dotnet/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@
</Target>

<Target Name="BuildTestLibraries" Inputs="@(GeneratedTestInput)" Outputs="@(GeneratedTestOutput)" BeforeTargets="BeforeBuild"
Condition="!Exists('$(TestLibrariesDirectory)/.libs/macos/custom-type-assembly.dll') Or !Exists('$(TestLibrariesDirectory)/.libs/dotnet/macos/custom-type-assembly.dll')" >
<Exec Command="make -j8 -C $(TestLibrariesDirectory)" Condition="'$(BUILD_REVISION)' == ''" />
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly" Condition="'$(BUILD_REVISION)' == ''" />
Condition="!Exists('$(TestLibrariesDirectory)/.libs/dotnet/macos/custom-type-assembly.dll')" >
<Exec Command="make -j8 -C $(TestLibrariesDirectory) V=1 RUNTIMEIDENTIFIER= RUNTIMEIDENTIFIERS=" Condition="'$(BUILD_REVISION)' == ''" />
<Exec Command="make -j8 -C $(TestLibrariesDirectory)/custom-type-assembly build-assembly V=1 RUNTIMEIDENTIFIER= RUNTIMEIDENTIFIERS=" Condition="'$(BUILD_REVISION)' == ''" />
</Target>

<Target Name="ComputeDefineConstants" BeforeTargets="BeforeBuild">
Expand Down
17 changes: 2 additions & 15 deletions tests/test-libraries/custom-type-assembly/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,19 @@ TOP=../../..

include $(TOP)/Make.config

.libs/macos/custom-type-assembly.dll: custom-type-assembly.cs Makefile | .libs/macos
$(Q_CSC) $(MAC_mobile_CSC) $< -out:$@ -r:$(MAC_DESTDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll -target:library /nologo

.libs/dotnet/macos/custom-type-assembly.dll: bin/Debug/$(DOTNET_TFM)-macos/custom-type-assembly.dll | .libs/dotnet/macos
$(Q) $(CP) $< $@

.libs/macos .libs/dotnet/macos:
.libs/dotnet/macos:
$(Q) mkdir -p $@

bin/Debug/$(DOTNET_TFM)-macos/custom-type-assembly.dll: custom-type-assembly.csproj custom-type-assembly.cs
$(Q) unset MSBUILD_EXE_PATH && $(DOTNET) build $< "/bl:$@.binlog" $(MSBUILD_VERBOSITY)
$(Q) unset MSBUILD_EXE_PATH && $(DOTNET) build $< "/bl:$@.binlog" $(DOTNET_BUILD_VERBOSITY)

ifdef INCLUDE_MAC

ifdef INCLUDE_XAMARIN_LEGACY
TARGETS += \
.libs/macos/custom-type-assembly.dll \

endif

ifdef ENABLE_DOTNET
TARGETS += \
.libs/dotnet/macos/custom-type-assembly.dll \

endif

endif # INCLUDE_MAC

build-assembly: $(TARGETS)

0 comments on commit 3317327

Please sign in to comment.