Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.

Commit a61271e

Browse files
pjcollinsjonpryor
authored andcommitted
Support running checks against a .pkg installation (#23)
Context: dotnet/android#3644 dotnet/android#3644 introduces an Azure Pipelines job to run API compatibility checks against an installed `.pkg` file that was produced by a previous step in the build pipeline. This new check appears to be failing due to the fact that our installer includes `Mono.Android.Export.dll` and `OpenTK-1.0.dll` in the *first* target framework directory that it creates rather than all of them. We'll now check the first target framework directory for these relevant assemblies, and only attempt to use the latest if the first doesn't exist to address this, which would happen on PR builds. An additional check has also been added to ensure that every expected API info file is successfully created, regardless of content.
1 parent 336eeda commit a61271e

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ endif # ndef XA_FRAMEWORK_DIR
1818

1919
STABLE_FRAMEWORKS = $(shell ls -1 "$(XA_FRAMEWORK_DIR)" | sort -n)
2020
LAST_STABLE_FRAMEWORK = $(lastword $(STABLE_FRAMEWORKS))
21+
FIRST_STABLE_FRAMEWORK = $(firstword $(STABLE_FRAMEWORKS))
2122

2223
all: check
2324

@@ -70,8 +71,9 @@ CORE_ASSEMBLIES = \
7071
Java.Interop \
7172
Xamarin.Android.NUnitLite
7273

73-
TFV_ASSEMBLIES = \
74-
Mono.Android \
74+
TFV_ASSEMBLY = Mono.Android
75+
76+
ACCESSORY_TFV_ASSEMBLIES = \
7577
Mono.Android.Export \
7678
OpenTK-1.0
7779

@@ -80,20 +82,29 @@ define BUILD_API_INFO
8082
mkdir -p $(1)
8183
for file in $(CORE_ASSEMBLIES); do \
8284
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) \
83-
$(2)/v1.0/$$file.dll -o=$(1)/$$file.xml & \
85+
"$(2)/v1.0/$$file.dll" -o=$(1)/$$file.xml & \
8486
done ; \
8587
wait
86-
for file in $(TFV_ASSEMBLIES) ; do \
87-
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) \
88-
$(2)/$(LAST_STABLE_FRAMEWORK)/$$file.dll -o=$(1)/$$file.xml & \
88+
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) \
89+
"$(2)/$(LAST_STABLE_FRAMEWORK)/$(TFV_ASSEMBLY).dll" "-o=$(1)/$(TFV_ASSEMBLY).xml" & \
90+
for file in $(ACCESSORY_TFV_ASSEMBLIES) ; do \
91+
accessoryTfvDir="$(2)/$(FIRST_STABLE_FRAMEWORK)"; \
92+
if [ ! -d "$$accessoryTfvDir" ]; then \
93+
accessoryTfvDir="$(2)/$(LAST_STABLE_FRAMEWORK)"; \
94+
fi; \
95+
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) "$$accessoryTfvDir/$$file.dll" "-o=$(1)/$$file.xml" & \
8996
done ; \
9097
wait
9198
endef
9299

93100
check: check-inter-api-level
94101
$(call BUILD_API_INFO,temp,$(XA_FRAMEWORK_DIR))
95102
failed=0 ; \
96-
for file in $(CORE_ASSEMBLIES) $(TFV_ASSEMBLIES) ; do \
103+
for file in $(CORE_ASSEMBLIES) $(TFV_ASSEMBLY) $(ACCESSORY_TFV_ASSEMBLIES); do \
104+
if [ ! -s temp/$$file.xml ]; then \
105+
echo "temp/$$file.xml was not generated."; \
106+
failed=1; \
107+
fi; \
97108
if $(MONO_API_HTML) $(REFERENCE_DIR)/$$file.xml temp/$$file.xml --ignore-changes-parameter-names --ignore-nonbreaking | grep '\<data-is-breaking>' > /dev/null 2>&1 ; then \
98109
echo "ABI BREAK IN: $$file.dll" ; \
99110
$(MONO_API_HTML) $(REFERENCE_DIR)/$$file.xml temp/$$file.xml --ignore-changes-parameter-names --ignore-nonbreaking \

0 commit comments

Comments
 (0)