Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ show-versions:
@echo "Building:"
@echo " The .NET NuGet(s):"
@$(foreach platform,$(DOTNET_PLATFORMS),echo " Microsoft.$(platform) $($(shell echo $(platform) | tr 'a-z' 'A-Z')_NUGET_VERSION_FULL)";)
@$(MAKE) -C tools/sharpie show-version

all-local:: global.json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<Type>Resx</Type>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>MSBStrings.Designer.cs</LastGenOutput>
<StronglyTypedFileName>MSBStrings.Designer.cs</StronglyTypedFileName>
<StronglyTypedFileName>$(IntermediateOutputPath)MSBStrings.Designer.cs</StronglyTypedFileName>
<StronglyTypedLanguage>CSharp</StronglyTypedLanguage>
<StronglyTypedNamespace>Xamarin.Localization.MSBuild</StronglyTypedNamespace>
<StronglyTypedClassName>MSBStrings</StronglyTypedClassName>
Expand Down
6 changes: 3 additions & 3 deletions src/ObjCRuntime/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2337,9 +2337,9 @@ internal static NativeHandle RetainAndAutoreleaseHandle (INativeObject? obj)
{
if (obj is null)
return NativeHandle.Zero;
#pragma warning disable RBI0014
return RetainAndAutoreleaseHandle (obj.GetHandle ());
#pragma warning restore RBI0014
var rv = RetainAndAutoreleaseHandle (obj.GetHandle ());
GC.KeepAlive (obj);
return rv;
}

/// <summary>Retain and autorelease the given handle, then return the handle.</summary>
Expand Down
1 change: 0 additions & 1 deletion tests/cecil-tests/HandleSafety.KnownFailures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public partial class HandleSafetyTest {
"ObjCRuntime.RegistrarHelper.INativeObject_managed_to_native (System.IntPtr, ObjCRuntime.INativeObject, ObjCRuntime.INativeObject, System.Boolean)",
"ObjCRuntime.Runtime.ConvertSmartEnumToNSString (System.IntPtr)",
"ObjCRuntime.Runtime.GetHandleForINativeObject (System.IntPtr)",
"ObjCRuntime.Runtime.RetainAndAutoreleaseHandle (ObjCRuntime.INativeObject)",
"ObjCRuntime.Runtime.RetainAndAutoreleaseNativeObject (ObjCRuntime.INativeObject)",
"ObjCRuntime.Runtime.RetainAndAutoreleaseNSObject (Foundation.NSObject)",
"ObjCRuntime.Runtime.RetainNativeObject (ObjCRuntime.INativeObject)",
Expand Down
28 changes: 28 additions & 0 deletions tests/sharpie/Tests/AvailabilityAppExtension.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

// RUN iphoneos: -x objective-c -sdk iphoneos

__attribute__((availability(ios_app_extension,unavailable)))
@interface UnavailableiOSAppExtension
@end

__attribute__((availability(macosx_app_extension,unavailable)))
@interface UnavailableMacOSXAppExtension
@end

__attribute__((availability(tvos_app_extension,unavailable)))
@interface UnavailableTvOSAppExtension
@end

__attribute__((availability(watchos_app_extension,unavailable)))
@interface UnavailableWatchOSAppExtension
@end

__attribute__((availability(maccatalyst_app_extension,unavailable)))
@interface UnavailableMacCatalystAppExtension
@end

__attribute__((availability(visionos_app_extension,unavailable)))
@interface UnavailableVisionOSAppExtension
@end
31 changes: 31 additions & 0 deletions tests/sharpie/Tests/AvailabilityAppExtension.iphoneos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using ObjCRuntime;

// @interface UnavailableiOSAppExtension
[Unavailable (PlatformName.iOSAppExtension)]
interface UnavailableiOSAppExtension {
}

// @interface UnavailableMacOSXAppExtension
[Unavailable (PlatformName.MacOSXAppExtension)]
interface UnavailableMacOSXAppExtension {
}

// @interface UnavailableTvOSAppExtension
[Unavailable (PlatformName.TvOSAppExtension)]
interface UnavailableTvOSAppExtension {
}

// @interface UnavailableWatchOSAppExtension
[Unavailable (PlatformName.WatchOSAppExtension)]
interface UnavailableWatchOSAppExtension {
}

// @interface UnavailableMacCatalystAppExtension
[Unavailable (PlatformName.MacCatalystAppExtension)]
interface UnavailableMacCatalystAppExtension {
}

// @interface UnavailableVisionOSAppExtension
[Unavailable (PlatformName.VisionOSAppExtension)]
interface UnavailableVisionOSAppExtension {
}
16 changes: 10 additions & 6 deletions tools/common/create-makefile-fragment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ if test -z "$FRAGMENT_PATH"; then
FRAGMENT_PATH=$PROJECT_FILE.inc
fi

if test -z "$BUILD_EXECUTABLE"; then
if test -z "$DOTNET"; then
echo "The DOTNET environment variable isn't set to the location of the 'dotnet' executable"
exit 1
fi
BUILD_EXECUTABLE="$DOTNET build"
if test -z "$DOTNET"; then
echo "The DOTNET environment variable isn't set to the location of the 'dotnet' executable"
exit 1
fi

# Our local 'dotnet' executable might not be available yet, in which case don't do anything.
if ! test -f "$DOTNET"; then
exit 0
fi

BUILD_EXECUTABLE="$DOTNET build"

if test -z "$BUILD_VERBOSITY"; then
BUILD_VERBOSITY=/verbosity:diag
fi
Expand Down
1 change: 0 additions & 1 deletion tools/dotnet-linker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ DOTNET_DIRECTORIES += \
$(foreach platform,$(DOTNET_PLATFORMS),$(DOTNET_DESTDIR)/$($(platform)_NUGET_SDK_NAME)/tools/dotnet-linker) \

# dotnet-linker.csproj.inc contains the dotnet_linker_dependencies variable used to determine if mtouch needs to be rebuilt or not.
dotnet-linker.csproj.inc: export BUILD_EXECUTABLE=$(DOTNET) build
dotnet-linker.csproj.inc: export BUILD_VERBOSITY=$(DOTNET_BUILD_VERBOSITY)
dotnet-linker.csproj.inc: dotnet-linker.csproj
-include dotnet-linker.csproj.inc
Expand Down
3 changes: 3 additions & 0 deletions tools/sharpie/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ run-tests: $(Sharpie.Bind_dependencies)
$(Q_BUILD) $(DOTNET) test $(TOP)/tests/sharpie/Sharpie.Bind.Tests/Sharpie.Bind.Tests.csproj --logger "console;verbosity=detailed" $(DOTNET_BUILD_VERBOSITY) -bl:$@.binlog

generated-files: $(abspath ../common/SdkVersions.cs) $(abspath ../common/ProductConstants.cs)

show-version:
@echo " Sharpie.Bind.Tool $(SHARPIE_BIND_TOOL_NUGET_VERSION)"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum PlatformName : byte {
MacCatalyst,
DriverKit,
VisionOS,
VisionOSAppExtension,
MacCatalystAppExtension,
}

Expand Down Expand Up @@ -155,6 +156,9 @@ static PlatformName GetPlatform (string? name)
case "visionOS":
case "visionos":
return PlatformName.VisionOS;
case "xros_app_extension":
case "visionos_app_extension":
return PlatformName.VisionOSAppExtension;
case "maccatalyst_app_extension":
return PlatformName.MacCatalystAppExtension;
default:
Expand Down
Loading