Skip to content

Commit

Permalink
Merge branch 'main' into net8.0-xcode15-appkit
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Oct 19, 2023
2 parents bbc0e6c + 703bcfc commit 5aaf996
Show file tree
Hide file tree
Showing 18 changed files with 220 additions and 168 deletions.
9 changes: 9 additions & 0 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ CURRENT_BRANCH_SED_ESCAPED:=$(subst |,\|,$(subst &,\&,$(subst $$,\$$,$(subst /,\
# So here we replace all non-alphanumeric characters in the branch name with a dash.
CURRENT_BRANCH_ALPHANUMERIC:=$(shell export LANG=C; printf "%s" "$(CURRENT_BRANCH)" | tr -c '[a-zA-Z0-9-]' '-')

# Set proper path for git directory
# If the repo is checked out as a worktree, the default .git/ does not exist,
# instead there is a .git file containing the path to the correct .git/
GIT_DIRECTORY:=$(TOP)/.git
ALTERNATIVE_GIT:=$(shell sed -n 's/^ *gitdir: //p' $(GIT_DIRECTORY))
ifneq ($(ALTERNATIVE_GIT),)
GIT_DIRECTORY:=$(ALTERNATIVE_GIT)
endif

# Get the current hash
CURRENT_HASH:=$(shell git log -1 --pretty=%h)
CURRENT_HASH_LONG:=$(shell git log -1 --pretty=%H)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ endif
all-local:: global.json

# This tells NuGet to use the exact same dotnet version we've configured in Make.config
global.json: $(TOP)/dotnet.config Makefile $(TOP)/.git/HEAD $(TOP)/.git/index
global.json: $(TOP)/dotnet.config Makefile $(GIT_DIRECTORY)/HEAD $(GIT_DIRECTORY)/index
$(Q_GEN) \
printf "{\n" > $@; \
printf " \"sdk\": {\n \"version\": \"$(DOTNET_VERSION)\"\n }\n" >> $@; \
Expand Down
6 changes: 3 additions & 3 deletions builds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ifneq ($(TRACKING_DOTNET_RUNTIME_SEPARATELY),)
$(Q) touch $@
endif

package-download/all-package-references.csproj: $(TOP)/.git/HEAD $(TOP)/.git/index ./create-csproj-for-all-packagereferences.sh
package-download/all-package-references.csproj: $(GIT_DIRECTORY)/HEAD $(GIT_DIRECTORY)/index ./create-csproj-for-all-packagereferences.sh
$(Q_GEN) ./create-csproj-for-all-packagereferences.sh --output "$(abspath $@.tmp)" $(if $(V),-v,)
$(Q) mv "$@.tmp" "$@"

Expand Down Expand Up @@ -747,7 +747,7 @@ $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions/Current: | $(MAC_DESTDIR)$(MAC_FRAME
$(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Commands:
$(Q_LN) ln -hfs $(MAC_TARGETDIR)/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/bin $@

$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo: $(TOP)/Make.config.inc $(TOP)/.git/index | $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)
$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo: $(TOP)/Make.config.inc $(GIT_DIRECTORY)/index | $(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)
$(Q_GEN) echo "Version: $(MAC_PACKAGE_VERSION)" > $@
$(Q) echo "Hash: $(shell git log --oneline -1 --pretty=%h)" >> $@
$(Q) echo "Branch: $(CURRENT_BRANCH)" >> $@
Expand Down Expand Up @@ -849,7 +849,7 @@ IOS_COMMON_TARGETS = \
$(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions/Current: | $(IOS_DESTDIR)/Library/Frameworks/Xamarin.iOS.framework/Versions
$(Q_LN) ln -hfs $(IOS_INSTALL_VERSION) $@

$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo: $(TOP)/Make.config.inc $(TOP)/.git/index | $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)
$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo: $(TOP)/Make.config.inc $(GIT_DIRECTORY)/index | $(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)
$(Q_GEN) echo "Version: $(IOS_PACKAGE_VERSION)" > $@
$(Q) echo "Hash: $(shell git log --oneline -1 --pretty=%h)" >> $@
$(Q) echo "Branch: $(CURRENT_BRANCH)" >> $@
Expand Down
6 changes: 3 additions & 3 deletions dotnet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ endef
$(foreach platform,$(DOTNET_WINDOWS_PLATFORMS),$(eval $(call CopyTargetsWindows,$(platform))))

define VersionsTemplate
targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.template.props Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index
targets/Microsoft.$(1).Sdk.Versions.props: targets/Microsoft.Sdk.Versions.template.props Makefile $(TOP)/Make.config.inc $(GIT_DIRECTORY)/HEAD $(GIT_DIRECTORY)/index
$$(Q_GEN) sed \
-e "s/@PLATFORM@/$(1)/g" \
-e "s/@NUGET_VERSION_NO_METADATA@/$$($(2)_NUGET_VERSION_NO_METADATA)/g" \
Expand Down Expand Up @@ -167,12 +167,12 @@ endef
$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SupportedTargetPlatforms,$(platform))))

define WorkloadTargets
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index Makefile generate-workloadmanifest-json.csharp | Workloads/Microsoft.NET.Sdk.$(1)
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.json: Makefile $(TOP)/Make.config.inc $(GIT_DIRECTORY)/HEAD $(GIT_DIRECTORY)/index Makefile generate-workloadmanifest-json.csharp | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) rm -f $$@.tmp
$$(Q_GEN) ./generate-workloadmanifest-json.csharp "$(1)" "$(3)" "$(5)" "$$(DOTNET_$(4)_RUNTIME_IDENTIFIERS)" "$$@.tmp" "$$(DOTNET_WINDOWS_PLATFORMS)"
$$(Q) mv $$@.tmp $$@

Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(TOP)/.git/HEAD $(TOP)/.git/index | Workloads/Microsoft.NET.Sdk.$(1)
Workloads/Microsoft.NET.Sdk.$(1)/WorkloadManifest.targets: Workloads/WorkloadManifest.$(1).template.targets Makefile $(TOP)/Make.config.inc $(GIT_DIRECTORY)/HEAD $(GIT_DIRECTORY)/index | Workloads/Microsoft.NET.Sdk.$(1)
$$(Q) rm -f $$@.tmp
$$(Q_GEN) sed \
-e "s/@NUGET_VERSION_NO_METADATA@/$3/g" \
Expand Down
2 changes: 1 addition & 1 deletion mk/versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ else
endif

print-$(1)::
@printf "*** %-16s %-45s %s (%s)\n" "$(1)" "$(shell git config submodule.external/$(1).url)" "$(NEEDED_$(2)_VERSION)" "$(shell git config -f $(abspath $(TOP)/.gitmodules) submodule.external/$(1).branch)"
@printf "*** %-16s %-45s %s (%s)\n" "$(1)" "$(shell git config submodule.external/$(1).url)" "$(NEEDED_$(2)_VERSION)" "$(shell git config -f $(abspath $(GIT_DIRECTORY)modules) submodule.external/$(1).branch)"

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

Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bindings-generated.m: bindings-generator.exe
app-main.m watchextension-main.m tvextension-main.m: extension-main.m
$(Q_LN) ln -fs $< $@

product.h: product.in.h Makefile $(TOP)/.git/index
product.h: product.in.h Makefile $(GIT_DIRECTORY)/index
$(Q) sed -e 's/@PRODUCT_HASH@/$(CURRENT_HASH_LONG)/' $< > $@.tmp
$(Q) mv $@.tmp $@
#
Expand Down
6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ $(WATCH_BUILD_DIR)/Constants.cs: $(TOP)/src/Constants.watch.cs.in Makefile $(TOP
-e "s/@WATCH_SDK_VERSION@/$(WATCH_SDK_VERSION)/g" \
$< > $@

$(WATCH_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(TOP)/.git/HEAD | $(WATCH_BUILD_DIR)
$(WATCH_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(GIT_DIRECTORY)/HEAD | $(WATCH_BUILD_DIR)
$(call Q_PROF_GEN,watch) sed \
-e 's|@PRODUCT_NAME@|Xamarin.WatchOS|g' \
-e 's|@PACKAGE_HEAD_REV@|$(PACKAGE_HEAD_REV)|g' \
Expand Down Expand Up @@ -933,7 +933,7 @@ $(TVOS_BUILD_DIR)/Constants.cs: $(TOP)/src/Constants.tvos.cs.in Makefile $(TOP)/
-e "s/@TVOS_SDK_VERSION@/$(TVOS_SDK_VERSION)/g" \
$< > $@

$(TVOS_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(TOP)/.git/HEAD | $(TVOS_BUILD_DIR)
$(TVOS_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(GIT_DIRECTORY)/HEAD | $(TVOS_BUILD_DIR)
$(call Q_PROF_GEN,tvos) sed \
-e 's|@PRODUCT_NAME@|Xamarin.TVOS|g' \
-e 's|@PACKAGE_HEAD_REV@|$(PACKAGE_HEAD_REV)|g' \
Expand Down Expand Up @@ -1099,7 +1099,7 @@ $(MACCATALYST_BUILD_DIR)/Constants.cs: $(TOP)/src/Constants.maccatalyst.cs.in Ma
-e "s/@MACCATALYST_SDK_VERSION@/$(MACCATALYST_SDK_VERSION)/g" \
$< > $@

$(MACCATALYST_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(TOP)/.git/HEAD | $(MACCATALYST_BUILD_DIR)
$(MACCATALYST_BUILD_DIR)/AssemblyInfo.cs: $(TOP)/src/AssemblyInfo.cs.in $(TOP)/Make.config $(GIT_DIRECTORY)/HEAD | $(MACCATALYST_BUILD_DIR)
$(call Q_PROF_GEN,maccatalyst) sed \
-e 's|@PRODUCT_NAME@|Xamarin.MacCatalyst|g' \
-e 's|@PACKAGE_HEAD_REV@|$(PACKAGE_HEAD_REV)|g' \
Expand Down
124 changes: 123 additions & 1 deletion src/webkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4380,6 +4380,28 @@ public enum WKDialogResult : long {
Handled,
}

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Native]
public enum WKCookiePolicy : long {
Allow,
Disallow,
}

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Native]
public enum WKInactiveSchedulingPolicy : long {
Suspend,
Throttle,
None,
}

[NoiOS, Mac (14, 0), NoMacCatalyst]
[Native]
public enum WKUserInterfaceDirectionPolicy : long {
Content,
System,
}

[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor ()] // Crashes during deallocation in Xcode 6 beta 2. radar 17377712.
Expand Down Expand Up @@ -4480,6 +4502,16 @@ interface WKHttpCookieStore {

[Export ("removeObserver:")]
void RemoveObserver (IWKHttpCookieStoreObserver observer);

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Export ("setCookiePolicy:completionHandler:")]
[Async]
void SetCookiePolicy (WKCookiePolicy policy, [NullAllowed] Action completionHandler);

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Export ("getCookiePolicy:")]
[Async]
void GetCookiePolicy (Action<WKCookiePolicy> completionHandler);
}

interface IWKHttpCookieStoreObserver { }
Expand Down Expand Up @@ -4691,6 +4723,10 @@ interface WKPreferences : NSSecureCoding {
[Mac (12, 3), iOS (15, 4), MacCatalyst (15, 4)]
[Export ("elementFullscreenEnabled")]
bool ElementFullscreenEnabled { [Bind ("isElementFullscreenEnabled")] get; set; }

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("inactiveSchedulingPolicy", ArgumentSemantic.Assign)]
WKInactiveSchedulingPolicy InactiveSchedulingPolicy { get; set; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -4851,6 +4887,37 @@ interface WKWebsiteDataType {
[Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Field ("WKWebsiteDataTypeFileSystem")]
NSString FileSystem { get; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Field ("WKWebsiteDataTypeSearchFieldRecentSearches")]
NSString SearchFieldRecentSearches { get; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Field ("WKWebsiteDataTypeMediaKeys")]
NSString MediaKeys { get; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Field ("WKWebsiteDataTypeHashSalt")]
NSString HashSalt { get; }
}

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Static]
interface WebViewNotification {
[Field ("WebViewDidBeginEditingNotification")]
NSString DidBeginEditing { get; }

[Field ("WebViewDidChangeNotification")]
NSString DidChange { get; }

[Field ("WebViewDidEndEditingNotification")]
NSString DidEndEditing { get; }

[Field ("WebViewDidChangeTypingStyleNotification")]
NSString DidChangeTypingStyle { get; }

[Field ("WebViewDidChangeSelectionNotification")]
NSString DidChangeSelection { get; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -4888,6 +4955,27 @@ interface WKWebsiteDataStore : NSSecureCoding {
[MacCatalyst (13, 1)]
[Export ("httpCookieStore")]
WKHttpCookieStore HttpCookieStore { get; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[NullAllowed, Export ("identifier")]
NSUuid Identifier { get; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Static]
[Export ("dataStoreForIdentifier:")]
WKWebsiteDataStore Create (NSUuid identifier);

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Static]
[Async]
[Export ("removeDataStoreForIdentifier:completionHandler:")]
void Remove (NSUuid identifier, Action<NSError> completionHandler);

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Static]
[Async]
[Export ("fetchAllDataStoreIdentifiers:")]
void FetchAllDataStoreIdentifiers (Action<NSArray<NSUuid>> completionHandler);
}

[NoiOS, NoWatch, NoTV]
Expand Down Expand Up @@ -5093,7 +5181,9 @@ interface WKUserScript : NSCopying {
interface WKWebView
#if MONOMAC
: NSUserInterfaceValidations
/* TODO , NSTextFinderClient K_API_AVAILABLE(macos(WK_MAC_TBA)) in 11.4 beta 2 */
#if XAMCORE_5_0
, NSTextFinderClient
#endif
#endif
{

Expand Down Expand Up @@ -5442,6 +5532,26 @@ interface WKWebView
[Mac (13, 3), MacCatalyst (16, 4), iOS (16, 4), NoWatch, NoTV]
[Export ("inspectable")]
bool Inspectable { [Bind ("isInspectable")] get; set; }

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Export ("goBack:")]
void GoBack ([NullAllowed] NSObject sender);

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Export ("goForward:")]
void GoForward ([NullAllowed] NSObject sender);

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Export ("reload:")]
void Reload ([NullAllowed] NSObject sender);

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Export ("reloadFromOrigin:")]
void ReloadFromOrigin ([NullAllowed] NSObject sender);

[NoiOS, NoMacCatalyst, Mac (14, 0)]
[Export ("stopLoading:")]
void StopLoading ([NullAllowed] NSObject sender);
}

delegate void WKJavascriptEvaluationResult (NSObject result, NSError error);
Expand Down Expand Up @@ -5549,6 +5659,14 @@ interface WKWebViewConfiguration : NSCopying, NSSecureCoding {
[Mac (12, 0), iOS (15, 0), MacCatalyst (15, 0), NoTV]
[Export ("upgradeKnownHostsToHTTPS")]
bool UpgradeKnownHostsToHttps { get; set; }

[Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("allowsInlinePredictions")]
bool AllowsInlinePredictions { get; set; }

[NoiOS, Mac (14, 0), NoMacCatalyst]
[Export ("userInterfaceDirectionPolicy", ArgumentSemantic.Assign)]
WKUserInterfaceDirectionPolicy UserInterfaceDirectionPolicy { get; set; }
}

[MacCatalyst (13, 1)]
Expand Down Expand Up @@ -5738,6 +5856,10 @@ interface WKPdfConfiguration : NSCopying {

[Export ("rect", ArgumentSemantic.Assign)]
CGRect Rect { get; set; }

[iOS (17, 0), Mac (14, 0), MacCatalyst (17, 0)]
[Export ("allowTransparentBackground")]
bool AllowTransparentBackground { get; set; }
}

interface IWKScriptMessageHandlerWithReply { }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# xcode 15
# requires OS_nw_proxy_config type which has not been bound yet, part of Xcode 15 Network binding
!missing-selector! WKWebsiteDataStore::proxyConfigurations not bound
!missing-selector! WKWebsiteDataStore::setProxyConfigurations: not bound

19 changes: 0 additions & 19 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-WebKit.todo

This file was deleted.

29 changes: 29 additions & 0 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-WebKit.ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
## only a subset of the old, pre WKWebKit, is bound for macOS

# TODO WKWebView should conform to NSTextFinderClient is marked as macos(WK_MAC_TBA) as of 11.4 beta3

# xcode 15

# older/legacy API
!missing-selector! +NSObject::isKeyExcludedFromWebScript: not bound
!missing-selector! +NSObject::isSelectorExcludedFromWebScript: not bound
!missing-selector! +NSObject::webScriptNameForKey: not bound
!missing-selector! +NSObject::webScriptNameForSelector: not bound
!missing-selector! NSObject::finalizeForWebScript not bound
!missing-selector! NSObject::invokeDefaultMethodWithArguments: not bound
!missing-selector! NSObject::invokeUndefinedMethodFromWebScript:withArguments: not bound
!missing-selector! NSObject::objectForWebScript not bound
!missing-selector! NSObject::webFrame not bound
!missing-selector! NSObject::webPlugInContainerLoadRequest:inFrame: not bound
!missing-selector! NSObject::webPlugInContainerSelectionColor not bound
!missing-selector! NSObject::webPlugInContainerShowStatus: not bound
!missing-selector! NSObject::webPlugInDestroy not bound
!missing-selector! NSObject::webPlugInInitialize not bound
!missing-selector! NSObject::webPlugInMainResourceDidFailWithError: not bound
!missing-selector! NSObject::webPlugInMainResourceDidFinishLoading not bound
!missing-selector! NSObject::webPlugInMainResourceDidReceiveData: not bound
!missing-selector! NSObject::webPlugInMainResourceDidReceiveResponse: not bound
!missing-selector! NSObject::webPlugInSetIsSelected: not bound
!missing-selector! NSObject::webPlugInStart not bound
!missing-selector! NSObject::webPlugInStop not bound

# enabled for XAMCORE 5, else breaking change
!missing-protocol-conformance! WKWebView should conform to NSTextFinderClient (defined in 'WKNSTextFinderClient' category)

Loading

6 comments on commit 5aaf996

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.