Add WK_ARRAY and WK_SET annotations
[WebKit-https.git] / Source / WebKit2 / mac / postprocess-framework-headers.sh
index 779e9b2084f9ea3d77cccbb1f92745c4f617a4bc..ddd5bc54033c4b373fecc1bda6e477d5c9440e5e 100755 (executable)
@@ -66,13 +66,17 @@ function rewrite_headers () {
                 sed -i .tmp -E -e 's/WK_(CLASS_|ENUM_)?AVAILABLE(_IOS|_MAC)?\(.+\)//g' -e 's/WK_(CLASS_?)DEPRECATED\(.+\)//g' ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
             fi
 
-            sed -i .tmp -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/^WK_CLASS_DEPRECATED/NS_CLASS_DEPRECATED/ -e s/WK_DEPRECATED/NS_DEPRECATED/ -e s/WK_DESIGNATED_INITIALIZER/NS_DESIGNATED_INITIALIZER/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ -e s/WK_UNAVAILABLE/NS_UNAVAILABLE/ -e s/WK_ASSUME_NONNULL_BEGIN/NS_ASSUME_NONNULL_BEGIN/ -e s/WK_ASSUME_NONNULL_END/NS_ASSUME_NONNULL_END/ -e s/WK_NULLABLE_PROPERTY/nullable,/ -e s/WK_NULLABLE_SPECIFIER/__nullable/g -e s/WK_NULLABLE/nullable/g -e s/WK_NULL_UNSPECIFIED/null_unspecified/ ${OTHER_SED_OPTIONS[*]} ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
+            sed -i .tmp -E -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/^WK_CLASS_DEPRECATED/NS_CLASS_DEPRECATED/ -e s/WK_DEPRECATED/NS_DEPRECATED/ -e s/WK_DESIGNATED_INITIALIZER/NS_DESIGNATED_INITIALIZER/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ -e s/WK_UNAVAILABLE/NS_UNAVAILABLE/ -e s/WK_ASSUME_NONNULL_BEGIN/NS_ASSUME_NONNULL_BEGIN/ -e s/WK_ASSUME_NONNULL_END/NS_ASSUME_NONNULL_END/ -e s/WK_NULLABLE_PROPERTY/nullable,/ -e s/WK_NULLABLE_SPECIFIER/__nullable/g -e s/WK_NULLABLE/nullable/g -e s/WK_NULL_UNSPECIFIED/null_unspecified/ ${OTHER_SED_OPTIONS[*]} ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
             mv ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} $HEADER_PATH
         fi
     done
 }
 
 DEFINITIONS_PATH=usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions
+
+# FIXME: Remove this.
+OTHER_SED_OPTIONS=(-e 's/WK_SET\([^\)]+\)/NSSet/g' -e 's/WK_ARRAY\([^\)]+\)/NSArray/g')
+
 process_definitions "${BUILT_PRODUCTS_DIR}/${DEFINITIONS_PATH}" || process_definitions "${SDKROOT}/${DEFINITIONS_PATH}"
 
 rewrite_headers ${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}