Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ RANLIB=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranli
# things in other places if they absolutely must.
MONO_PATH=$(TOP)/external/mono
XAMARIN_MACDEV_PATH=$(TOP)/external/Xamarin.MacDev
MONOTOUCH_DIALOG_PATH=$(TOP)/external/MonoTouch.Dialog
API_TOOLS_PATH=$(TOP)/external/api-tools
ADR_PATH:=$(abspath $(TOP)/../macios-adr)

MONO_PREFIX ?= /Library/Frameworks/Mono.framework/Versions/Current
SYSTEM_MONO=$(MONO_PREFIX)/bin/mono
Expand Down Expand Up @@ -608,7 +606,13 @@ $(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(platform)_NUGET_WINDOWS_
# A local feed to place test nugets.
NUGET_TEST_FEED=$(abspath $(TOP)/tests/.nuget/packages)

ENABLE_ADR=1
ifeq ($(shell arch),arm64)
ADR_RUNTIME_IDENTIFIER=osx-arm64
else ifeq ($(shell sysctl -n sysctl.proc_translated 2>/dev/null),1)
ADR_RUNTIME_IDENTIFIER=osx-arm64
else
ADR_RUNTIME_IDENTIFIER=osx-x64
endif

.SUFFIXES:
MAKEFLAGS += --no-builtin-rules
27 changes: 1 addition & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,7 @@ git-clean-all:
@git clean -xffdq
@echo "Cleaning submodules..."
@git submodule foreach -q --recursive 'git clean -xffdq && git reset --hard -q'
@set -e; \
for dir in $(DEPENDENCY_DIRECTORIES); do \
if test -d $$dir; then \
echo "Cleaning $$(basename $$dir)..."; \
cd $$dir; \
git clean -xffdq; \
git reset --hard -q; \
git submodule foreach -q --recursive 'git clean -xffdq'; \
else \
echo "Skipped $$dir (does not exist)"; \
fi; \
done

@set -e; \
if [ -n "$(ENABLE_XAMARIN)" ]; then \
CONFIGURE_FLAGS=""; \
if [ -n "$(ENABLE_XAMARIN)" ]; then \
echo "Xamarin-specific build has been re-enabled"; \
CONFIGURE_FLAGS="$$CONFIGURE_FLAGS --enable-xamarin"; \
fi; \
./configure $$CONFIGURE_FLAGS; \
$(MAKE) reset; \
echo "Done"; \
else \
echo "Done"; \
fi; \
@echo "Done"

SUBDIRS += tests

4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ while test "x$1" != x; do
shift
;;
--enable-xamarin)
echo "ENABLE_XAMARIN=1" >> $CONFIGURED_FILE
echo "The argument '$1' is no longer in use."
shift
;;
--disable-xamarin)
echo "ENABLE_XAMARIN=" >> $CONFIGURED_FILE
echo "The argument '$1' is no longer in use."
shift
;;
--custom-dotnet=*)
Expand Down
6 changes: 0 additions & 6 deletions create-make-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,4 @@ if which ccache > /dev/null 2>&1; then
echo "Found ccache on the system, enabling it"
fi

# Detect ADR
if test -d ../macios-adr; then
printf "ENABLE_XAMARIN=1\n" >> "$OUTPUT_FILE"
echo "Detected the macios-adr repository, automatically enabled the Xamarin build"
fi

mv "$OUTPUT_FILE" "$OUTPUT"
8 changes: 0 additions & 8 deletions mk/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,3 @@ reset: check-versions

reset-versions: reset-versions-impl
$(Q) ! test -f $(THISDIR)/.stamp-reset-maccore || ( echo "$(COLOR_GRAY)Checking again since maccore changed$(COLOR_CLEAR)" && $(MAKE) reset-versions-impl )

README := $(abspath $(TOP)/mk/xamarin.mk)
bump-current-maccore: P=MACCORE
bump-current-adr: P=ADR
bump-current-%:
@sed -i '' -e "s,NEEDED_$(P)_VERSION.*,NEEDED_$(P)_VERSION := $(shell cd $($(P)_PATH) && git log -1 --pretty=format:%H),g" $(README)
@sed -i '' -e "s,NEEDED_$(P)_BRANCH.*,NEEDED_$(P)_BRANCH := $(shell cd $($(P)_PATH) && git rev-parse --abbrev-ref HEAD),g" $(README)
@sed -i '' -e "s,^\\($(P)_MODULE.*:=\\).*\\(git.*$\\),\\1 $(shell cd $($(P)_PATH) && git config remote.$(shell cd $($(P)_PATH) && git config branch.$(shell cd $($(P)_PATH) && git rev-parse --abbrev-ref HEAD).remote).url)," $(README)
94 changes: 2 additions & 92 deletions mk/xamarin.mk
Original file line number Diff line number Diff line change
@@ -1,95 +1,5 @@
ifdef ENABLE_XAMARIN
ifdef ENABLE_ADR
NEEDED_ADR_VERSION := 1908cef0c0b4630e6a7abd4a6fc5cafc95536d65
NEEDED_ADR_BRANCH := main

ADR_DIRECTORY := macios-adr
ADR_MODULE := https://[email protected]/devdiv/DevDiv/_git/macios-adr
ADR_VERSION := $(shell cd $(ADR_PATH) 2> /dev/null && git rev-parse HEAD 2> /dev/null)
ADR_BRANCH := $(shell cd $(ADR_PATH) 2> /dev/null && git symbolic-ref --short HEAD 2> /dev/null)
endif
endif

# Available versions can be seen here:
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.Tools.Mlaunch/versions
MLAUNCH_NUGET_VERSION=1.1.93

define CheckVersionTemplate
check-$(1)::
@rm -f $(THISDIR)/.stamp-reset-$(1)
@if test x$$(IGNORE_$(2)_VERSION) = "x"; then \
if test ! -d $($(2)_PATH); then \
if test x$$(RESET_VERSIONS) != "x"; then \
make reset-$(1) || exit 1; \
else \
echo "Your $(1) checkout is $(COLOR_RED)missing$(COLOR_CLEAR), please run 'make reset-$(1)'"; \
touch .check-versions-failure; \
fi; \
else \
if test "x$($(2)_VERSION)" != "x$(NEEDED_$(2)_VERSION)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
make reset-$(1) || exit 1; \
else \
echo "Your $(1) version is $(COLOR_RED)out of date$(COLOR_CLEAR), please run 'make reset-$(1)' (found $($(2)_VERSION), expected $(NEEDED_$(2)_VERSION)). Alternatively export IGNORE_$(2)_VERSION=1 to skip this check."; \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
touch .check-versions-failure; \
fi; \
elif test "x$($(2)_BRANCH)" != "x$(NEEDED_$(2)_BRANCH)" ; then \
if test x$$(RESET_VERSIONS) != "x"; then \
test -z "$(BUILD_REVISION)" || $(MAKE) test-$(1); \
make reset-$(1) || exit 1; \
else \
echo "Your $(1) branch is $(COLOR_RED)out of date$(COLOR_CLEAR), please run 'make reset-$(1)' (found $($(2)_BRANCH), expected $(NEEDED_$(2)_BRANCH)). Alternatively export IGNORE_$(2)_VERSION=1 to skip this check."; \
touch .check-versions-failure; \
fi; \
else \
echo "$(1) is $(COLOR_GREEN)up-to-date$(COLOR_CLEAR)."; \
fi; \
fi; \
else \
echo "$(1) is $(COLOR_GRAY)ignored$(COLOR_CLEAR)."; \
fi

test-$(1)::
@echo $(1)
@echo " $(2)_DIRECTORY=$($(2)_DIRECTORY)"
@echo " $(2)_MODULE=$($(2)_MODULE)"
@echo " NEEDED_$(2)_VERSION=$(NEEDED_$(2)_VERSION)"
@echo " $(2)_VERSION=$($(2)_VERSION)"
@echo " NEEDED_$(2)_BRANCH=$(NEEDED_$(2)_BRANCH)"
@echo " $(2)_BRANCH=$($(2)_BRANCH)"
@echo " $(2)_PATH=$($(2)_PATH) => $(abspath $($(2)_PATH))"

reset-$(1)::
$(Q) \
DEPENDENCY_PATH=$($(2)_PATH) \
DEPENDENCY_MODULE=$($(2)_MODULE) \
DEPENDENCY_HASH=$(NEEDED_$(2)_VERSION) \
DEPENDENCY_BRANCH=$(NEEDED_$(2)_BRANCH) \
DEPENDENCY_DIRECTORY=$($(2)_DIRECTORY) \
DEPENDENCY_IGNORE_VERSION=$(IGNORE_$(2)_VERSION) \
$(TOP)/mk/xamarin-reset.sh $(1)
@touch $(THISDIR)/.stamp-reset-$(1)

print-$(1)::
@printf "*** %-16s %-45s %s (%s)\n" "$($(2)_DIRECTORY)" "$($(2)_MODULE)" "$(NEEDED_$(2)_VERSION)" "$(NEEDED_$(2)_BRANCH)"

.PHONY: check-$(1) reset-$(1) print-$(1)

reset-versions-impl:: reset-$(1)
check-versions:: check-$(1)
print-versions:: print-$(1)

DEPENDENCY_DIRECTORIES += $$(abspath $($(2)_PATH))

endef

ifdef ENABLE_XAMARIN
$(MACCORE_PATH):

$(ADR_PATH):
$(Q) git clone --recursive $(ADR_MODULE) $(ADR_PATH)
$(Q) $(MAKE) reset-adr

$(eval $(call CheckVersionTemplate,macios-adr,ADR))
endif
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/AppleDocReader/versions
ADR_NUGET_VERSION=1.0.0
18 changes: 3 additions & 15 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PROJECT_DIR=.

include $(TOP)/src/frameworks.sources
include $(TOP)/mk/rules.mk
include $(TOP)/mk/xamarin.mk

MACOS_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/macos
IOS_DOTNET_BUILD_DIR=$(DOTNET_BUILD_DIR)/ios
Expand Down Expand Up @@ -346,24 +347,11 @@ $(DOTNET_DESTDIR)/$($(2)_NUGET_REF_NAME)/ref/$(DOTNET_TFM)/Microsoft.$(1).xml: $
$(Q) $(CP) $$< $$@

$($(2)_DOTNET_BUILD_DIR)/doc/Microsoft.$(1).xml: $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll build/.build-adr-stamp | $($(2)_DOTNET_BUILD_DIR)/doc
ifdef ENABLE_XAMARIN
ifdef ENABLE_ADR
$(Q) $(MAKE) run -C $(ADR_PATH) ASSEMBLY="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll)" INPUT="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml)" OUTPUT="$(abspath $$@)"
else
$$(Q) $$(CP) $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml $$@
endif
else
$$(Q) $$(CP) $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml $$@
endif
$(TOP)/packages/appledocreader.$(ADR_RUNTIME_IDENTIFIER)/$(ADR_NUGET_VERSION)/tools/any/osx-arm64/AppleDocReader inject docs --assembly="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).dll)" --input="$(abspath $($(2)_DOTNET_BUILD_DIR)/ref/Microsoft.$(1).xml)" --output="$(abspath $$@)" --xcode="$(DEVELOPER_DIR)/../.." --runtimeDll="$(DOTNET_BCL_DIR)/System.Runtime.dll" -f
endef

build/.build-adr-stamp:
ifdef ENABLE_XAMARIN
ifdef ENABLE_ADR
$(Q) $(MAKE) build -C $(ADR_PATH)
$(Q) $(MAKE) create -C $(ADR_PATH)
endif
endif
$(MAKE) -C $(TOP)/tools/adr
$(Q) touch $@

# Template variables:
Expand Down
4 changes: 0 additions & 4 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),SUPPORTED_API_VERSIONS_$(platform)='$(SUPPORTED_API_VERSIONS_$(platform))'\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_TARGET_PLATFORM_VERSION_LIBRARY=$($(platform)_TARGET_PLATFORM_VERSION_LIBRARY)\\n)" | sed 's/^ //' >> $@
@printf "ENABLE_XAMARIN=$(ENABLE_XAMARIN)\n" >> $@
@printf "ENABLE_ADR=$(ENABLE_ADR)\n" >> $@
@printf "XCODE_IS_STABLE=$(XCODE_IS_STABLE)\n" >> $@
@printf "XCODE_VERSION=$(XCODE_VERSION)\n" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_MIN_$(platform)_SDK_VERSION=$(DOTNET_MIN_$(platform)_SDK_VERSION)\\n)" | sed 's/^ //' >> $@
Expand Down Expand Up @@ -99,8 +97,6 @@ test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Ver
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(rid)_NUGET_RUNTIME_NAME=$($(rid)_NUGET_RUNTIME_NAME)\\n))" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),SUPPORTED_API_VERSIONS_$(platform)='$(SUPPORTED_API_VERSIONS_$(platform))'\\n)" | sed 's/^ //' >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),$(platform)_TARGET_PLATFORM_VERSION_LIBRARY=$($(platform)_TARGET_PLATFORM_VERSION_LIBRARY)\\n)" | sed 's/^ //' >> $@
@printf "ENABLE_XAMARIN=$(ENABLE_XAMARIN)\n" >> $@
@printf "ENABLE_ADR=$(ENABLE_ADR)\n" >> $@
@printf "XCODE_IS_STABLE=$(XCODE_IS_STABLE)\n" >> $@
@printf "XCODE_VERSION=$(XCODE_VERSION)\n" >> $@
@printf "$(foreach platform,$(DOTNET_PLATFORMS_UPPERCASE),DOTNET_MIN_$(platform)_SDK_VERSION=$(DOTNET_MIN_$(platform)_SDK_VERSION)\\n)" | sed 's/^ //' >> $@
Expand Down
4 changes: 0 additions & 4 deletions tests/cecil-tests/Documentation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ public void VerifyEveryVisibleMemberIsDocumented ()
{
// We join all the APIs from all the platforms, so we can only run this test when all platforms are enabled.
Configuration.IgnoreIfAnyIgnoredPlatforms ();
Configuration.IgnoreIfNotXamarinEnabled (); // our tooling to inject docs for Apple APIs lives in maccore, so if we don't do that, we'll get a lot of false positives.

if (!Configuration.EnableAdr)
Assert.Ignore ("This test requires ADR");

// Collect everything
var xmlMembers = new HashSet<AssemblyApi> ();
Expand Down
4 changes: 0 additions & 4 deletions tests/common/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ static partial class Configuration {
public static bool include_mac;
public static bool include_tvos;
public static bool include_maccatalyst;
public static bool EnableXamarin;
public static bool EnableAdr;
public static bool XcodeIsStable;
public static string DOTNET_DIR;

Expand Down Expand Up @@ -301,8 +299,6 @@ static Configuration ()
DotNetCscCommand = GetVariable ("DOTNET_CSC_COMMAND", null)?.Trim ('\'');
DotNetExecutable = GetVariable ("DOTNET", null);
DotNetTfm = GetVariable ("DOTNET_TFM", null);
EnableXamarin = !string.IsNullOrEmpty (GetVariable ("ENABLE_XAMARIN", ""));
EnableAdr = !string.IsNullOrEmpty (GetVariable ("ENABLE_ADR", ""));
XcodeIsStable = string.Equals (GetVariable ("XCODE_IS_STABLE", ""), "true",
StringComparison.OrdinalIgnoreCase);
DOTNET_DIR = GetVariable ("DOTNET_DIR", "");
Expand Down
8 changes: 0 additions & 8 deletions tests/common/ConfigurationNUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,5 @@ public static void IgnoreIfNotOn (System.Runtime.InteropServices.OSPlatform plat
return;
Assert.Ignore ($"This test is only applicable on {platform}");
}

public static void IgnoreIfNotXamarinEnabled ()
{
if (EnableXamarin)
return;
Assert.Ignore ($"This test is only applicable if Xamarin-specific bits are enabled.");
}

}
}
2 changes: 2 additions & 0 deletions tools/adr/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.stamp

21 changes: 21 additions & 0 deletions tools/adr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TOP=../..

include $(TOP)/Make.config
include $(TOP)/mk/xamarin.mk

ADR_NUGET_VERSION=1.0.0

DOWNLOAD_STAMP_FILE=.download-$(ADR_NUGET_VERSION).stamp

$(DOWNLOAD_STAMP_FILE):
$(Q) $(DOTNET) restore download-adr.csproj /bl:$@.binlog $(MSBUILD_VERBOSITY) /p:AdrNuGetVersion=$(ADR_NUGET_VERSION) /p:AdrRuntimeIdentifier=$(ADR_RUNTIME_IDENTIFIER)
$(Q) touch $@

clean-local::
$(Q) rm -rf .*.stamp obj .*.binlog

TARGETS += $(DOWNLOAD_STAMP_FILE)

all-local:: $(TARGETS)
install-local:: $(TARGETS)
download: $(DOWNLOAD_STAMP_FILE)
6 changes: 6 additions & 0 deletions tools/adr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
adr
---

adr is a closed source tool used to inject links to Apple's documentation into the xml documentation generated from our source code.

Location: https://dev.azure.com/devdiv/DevDiv/_git/macios-adr
13 changes: 13 additions & 0 deletions tools/adr/download-adr.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)</TargetFramework>
</PropertyGroup>

<Import Project="../../eng/Versions.props" />

<ItemGroup>
<PackageDownload Include="AppleDocReader.$(AdrRuntimeIdentifier)" Version="[$(AdrNuGetVersion)]" />
</ItemGroup>

<Target Name="Download" />
</Project>
7 changes: 0 additions & 7 deletions tools/compare-commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,6 @@ if test -z "$USE_EXISTING_BUILD"; then

cd "$OUTPUT_SRC_DIR"

echo " ${BLUE}Getting ADR from existing clone to avoid having to setup auth to get it again...${CLEAR}"
FILE="$ROOT_DIR/adr-path.raw"
make print-variable-value-to-file VARIABLE=ADR_PATH FILE=$FILE -C "$ROOT_DIR/tools/devops"
ADR_PATH=$(cat "$FILE")
rm -f "$FILE"
cp -cr "$ADR_PATH" .

echo " ${BLUE}Cloning macios...${CLEAR}"
git clone https://github.com/dotnet/macios --reference "$ROOT_DIR" 2>&1 | sed 's/^/ /'
cd macios
Expand Down
4 changes: 0 additions & 4 deletions tools/devops/automation/scripts/bash/configure-build.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tools/devops/automation/templates/build/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ steps:
displayName: "Configure install extra args"
timeoutInMinutes: 5

- bash: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/tools/devops/automation/scripts/bash/configure-build.sh
- bash: $(System.DefaultWorkingDirectory)/$(BUILD_REPOSITORY_TITLE)/configure
env:
${{ if eq(parameters.isPR, true) }}:
IsPR: 'True'
Expand Down
1 change: 0 additions & 1 deletion tools/devops/automation/templates/tests/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ steps:
set -e
cd "$BUILD_REPOSITORY_TITLE"
TEST_PLATFORM=$(echo "${{ parameters.testPlatform }}" | tr '[:upper:]' '[:lower:]')
ARGS=(--enable-xamarin)
if test -n "$TEST_PLATFORM"; then
ARGS+=("--disable-all-platforms")
ARGS+=("--enable-$TEST_PLATFORM")
Expand Down
11 changes: 1 addition & 10 deletions tools/mlaunch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,4 @@ mlaunch

mlaunch is a closed source tool used to interact with simulators and devices.

We'll build this tool from souce if the xamarin build is enabled (configured
with --enable-xamarin).

Otherwise we'll get a binary version from the macios-binaries repository. This
version may be somewhat out of date, but should work at least for running
tests.

To update the binary version of mlaunch in macios-binaries execute `make publish`
in this directory (when the xamarin build is enabled, so that mlaunch
is built from source).
Location: https://dev.azure.com/devdiv/DevDiv/_git/macios-mlaunch
Loading