This repository has been archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
153 lines (133 loc) · 5.83 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
SHELL = /usr/bin/env bash
export OS := $(shell uname)
MONO_API_HTML = mono-api-html
MONO_API_INFO = mono-api-info
HTML_OUTPUT_DIR =
REFERENCE_DIR = reference
ifeq ($(OS),Darwin)
XA_FRAMEWORK_DIR = /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild-frameworks/MonoAndroid
endif # $(OS)=Darwin
ifndef XA_FRAMEWORK_DIR
$(error XA_FRAMEWORK_DIR must be provided.)
endif # ndef XA_FRAMEWORK_DIR
STABLE_FRAMEWORKS = $(shell ls -1 "$(XA_FRAMEWORK_DIR)" | sort -n)
LAST_STABLE_FRAMEWORK = $(lastword $(STABLE_FRAMEWORKS))
all: check
clean:
MONO_API_INFO_LIB_DIRS = \
-L $(XA_FRAMEWORK_DIR)/$(LAST_STABLE_FRAMEWORK) \
-L $(XA_FRAMEWORK_DIR)/v1.0 \
-L $(XA_FRAMEWORK_DIR)/v1.0/Facades
BCL_ASSEMBLIES = \
Microsoft.CSharp \
Mono.Data.Sqlite \
Mono.Data.Tds \
Mono.Posix \
Mono.Security \
mscorlib \
System \
System.ComponentModel.Composition \
System.ComponentModel.DataAnnotations \
System.Core \
System.Data \
System.Data.Services.Client \
System.EnterpriseServices \
System.IdentityModel \
System.IO.Compression \
System.IO.Compression.FileSystem \
System.Json \
System.Net \
System.Net.Http \
System.Net.Http.WinHttpHandler \
System.Numerics \
System.Numerics.Vectors \
System.Reflection.Context \
System.Runtime.Serialization \
System.Security \
System.ServiceModel \
System.ServiceModel.Web \
System.Transactions \
System.Web.Services \
System.Windows \
System.Xml \
System.Xml.Linq \
System.Xml.Serialization
CORE_ASSEMBLIES = \
$(BCL_ASSEMBLIES) \
Java.Interop \
Xamarin.Android.NUnitLite
TFV_ASSEMBLIES = \
Mono.Android \
Mono.Android.Export \
OpenTK-1.0
# $(call BUILD_API_INFO,outdir,frameworkDir)
define BUILD_API_INFO
mkdir -p $(1)
for file in $(CORE_ASSEMBLIES); do \
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) \
$(2)/v1.0/$$file.dll -o=$(1)/$$file.xml & \
done ; \
wait
for file in $(TFV_ASSEMBLIES) ; do \
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) \
$(2)/$(LAST_STABLE_FRAMEWORK)/$$file.dll -o=$(1)/$$file.xml & \
done ; \
wait
endef
check: check-inter-api-level
$(call BUILD_API_INFO,temp,$(XA_FRAMEWORK_DIR))
failed=0 ; \
for file in $(CORE_ASSEMBLIES) $(TFV_ASSEMBLIES) ; do \
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 \
echo "ABI BREAK IN: $$file.dll" ; \
$(MONO_API_HTML) $(REFERENCE_DIR)/$$file.xml temp/$$file.xml --ignore-changes-parameter-names --ignore-nonbreaking \
$(if $(HTML_OUTPUT_DIR),$(HTML_OUTPUT_DIR)/$$file.html); \
if [ -n "$(HTML_OUTPUT_DIR)" ] ; then cat "$(HTML_OUTPUT_DIR)/$$file.html" ; fi ; \
failed=1; \
fi ; \
done ; \
if [ $$failed -ne 0 ]; then \
exit $$failed ; \
fi
-create-inter-api-infos:
for f in $(STABLE_FRAMEWORKS) ; do \
if [ ! -f "$(XA_FRAMEWORK_DIR)/$$f/Mono.Android.dll" ]; then \
continue ; \
fi; \
if [ "$(XA_FRAMEWORK_DIR)/$$f/Mono.Android.dll" -ot "inter-apis/$$f/Mono.Android.xml" ] ; then \
continue; \
fi; \
mkdir -p "inter-apis/$$f" || true; \
$(MONO_API_INFO) $(MONO_API_INFO_LIB_DIRS) "$(XA_FRAMEWORK_DIR)/$$f/Mono.Android.dll" -o="inter-apis/$$f/Mono.Android.xml" ; \
done
check-inter-api-level: -create-inter-api-infos
failed=0; \
_frameworks=($(STABLE_FRAMEWORKS)) ; \
for (( i = 1; i < $${#_frameworks[@]}; i++ )) ; do \
if [ ! -d "$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}" ] ; then \
echo "# Framework directory '$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}' doesn't exist. Skipping..."; \
continue ; \
fi; \
prev_framework=$$(expr $$i - 1); \
prev="inter-apis/$${_frameworks[$$prev_framework]}/Mono.Android.xml"; \
cur="inter-apis/$${_frameworks[$$i]}/Mono.Android.xml"; \
extras_in="inter-api-extra-$${_frameworks[$$prev_framework]}-$${_frameworks[$$i]}.txt" ; \
echo "# reading extras from: $$extras_in"; \
extra=`if [ -f $$extras_in ]; then echo @$$extras_in ; fi`; \
out=`mktemp interdiff-XXXXXX.html` ; \
command="$(MONO_API_HTML) \"$$prev\" \"$$cur\" --ignore-changes-parameter-names --ignore-changes-virtual --ignore-changes-property-setters --ignore-nonbreaking $$extra"; \
echo $$command; \
eval $$command > "$$out" 2>&1; \
if grep '\<data-is-breaking\>' $$out > /dev/null 2>&1 ; then \
echo "<h1>### API BREAK BETWEEN $${_frameworks[$$prev_framework]} and $${_frameworks[$$i]}</h1>" ; \
cat $$out; \
if [ -n "$(HTML_OUTPUT_DIR)" ]; then \
cat $$out > "$(HTML_OUTPUT_DIR)/Mono.Android-inter-$${_frameworks[$$prev_framework]}-$${_frameworks[$$i]}.html" ; \
fi; \
failed=1; \
fi ; \
rm $$out; \
done; \
exit $$failed
update:
$(call BUILD_API_INFO,$(REFERENCE_DIR),$(XA_FRAMEWORK_DIR))