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

Commit 6dfba92

Browse files
committed
Use test -d with directories, not test -f.
Context: https://github.com/xamarin/monodroid/pull/712#issuecomment-349762244 In attempting to bump the xamarin-android commit reference within monodroid, monodroid's inter-API-level checks failed: <h1>### API BREAK BETWEEN v4.3 and v4.4</h1> ... <h3>Type Changed: Android.Views.Animations.Transformation</h3> <p>Removed properties:</p> <pre> <span class='removed removed-property breaking' data-is-breaking>public static int TypeAlpha { get; set; }</span> <span class='removed removed-property breaking' data-is-breaking>public static int TypeBoth { get; set; }</span> <span class='removed removed-property breaking' data-is-breaking>public static int TypeIdentity { get; set; }</span> <span class='removed removed-property breaking' data-is-breaking>public static int TypeMatrix { get; set; }</span> </pre> The question, then: Why didn't *xamarin-android* fail for the same reason? Manually inspecting the resulting assemblies shows that the same problem exists in the OSS Jenkins build artifacts for `Mono.Android.dll` between v4.3 and v4.4, so why wasn't this caught by the appropriate xamarin-android PR? The reason? `make check-inter-api-level` was mis-using **test**(1): if [ ! -f "$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}" ] `$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}` will be a *directory*, not a file, and `test -f /` (or any other directory) will always fail. Consequently, we *never* generated the `inter-apis/*/Mono.Android.xml` files, preventing us from performing the inter-API-level checks. Doh! Fix our **test**(1) invocation so that it works, using `test -d`.
1 parent 5e6f879 commit 6dfba92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ check-inter-api-level: -create-inter-api-infos
118118
failed=0; \
119119
_frameworks=($(STABLE_FRAMEWORKS)) ; \
120120
for (( i = 1; i < $${#_frameworks[@]}; i++ )) ; do \
121-
if [ ! -f "$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}" ] ; then \
121+
if [ ! -d "$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}" ] ; then \
122+
echo "# Framework directory '$(XA_FRAMEWORK_DIR)/$${_frameworks[$$i]}' doesn't exist. Skipping..."; \
122123
continue ; \
123124
fi; \
124125
prev_framework=$$(expr $$i - 1); \

0 commit comments

Comments
 (0)