Skip to content

Commit

Permalink
Merge branch 'main' into dev/mandel/remove-codeql-prs
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto authored Jan 23, 2025
2 parents ec1a863 + a759bb7 commit d775b99
Show file tree
Hide file tree
Showing 128 changed files with 7,384 additions and 2,544 deletions.
5 changes: 3 additions & 2 deletions dotnet/Workloads/SignList.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@
<Skip Include="Build\System.Text.Json.dll" />
<Skip Include="Build\System.Threading.Tasks.Dataflow.dll" />
<Skip Include="Build\System.Threading.Tasks.Extensions.dll" />
<!-- They are now signed by their origin build https://github.com/xamarin/XamarinVS/pull/14522 -->
<Skip Include="imobiledevice-*\*.dll" />
<Skip Include="imobiledevice-*\*.exe" />
</ItemGroup>

<ItemGroup>
<ThirdParty Include="BouncyCastle.Crypto.dll" />
<ThirdParty Include="imobiledevice-*\*.dll" />
<ThirdParty Include="imobiledevice-*\*.exe" />
<!-- Build.zip -->
<ThirdParty Include="Mono.Cecil*.dll" />

Expand Down
2 changes: 1 addition & 1 deletion msbuild/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<MessagingVersion Condition="'$(MessagingVersion)' == ''">[3.0.13]</MessagingVersion>
<HotRestartVersion>[1.1.7]</HotRestartVersion>
<HotRestartVersion>[17.14.51-gd03e25086a]</HotRestartVersion>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)../Directory.Build.props" />
</Project>
5 changes: 5 additions & 0 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1714,4 +1714,9 @@
{0}: the path to a file
</comment>
</data>

<data name="W7144" xml:space="preserve">
<value>Did not extract {0} because it would write outside the target directory.</value>
</data>

</root>
12 changes: 12 additions & 0 deletions msbuild/Xamarin.MacDev.Tasks/Decompress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ static bool TryDecompressUsingSystemIOCompression (TaskLoggingHelper log, string
resource = resource.TrimEnd ('/', '\\');
resource = resource.Replace ('\\', zipDirectorySeparator);
var resourceAsDir = resource + zipDirectorySeparator;
decompressionDir = Path.GetFullPath (decompressionDir);

using var archive = ZipFile.OpenRead (zip);
foreach (var entry in archive.Entries) {
Expand Down Expand Up @@ -204,6 +205,17 @@ static bool TryDecompressUsingSystemIOCompression (TaskLoggingHelper log, string

var isDir = entryPath [entryPath.Length - 1] == zipDirectorySeparator;
var targetPath = Path.Combine (decompressionDir, entryPath.Replace (zipDirectorySeparator, Path.DirectorySeparatorChar));

// canonicalize the path
targetPath = Path.GetFullPath (targetPath);

// validate that the unzipped file is inside the target directory
var decompressionDirectoryPath = decompressionDir.Trim (Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
if (!targetPath.StartsWith (decompressionDirectoryPath)) {
log.LogWarning (7144, null, MSBStrings.W7144 /* Did not extract {0} because it would write outside the target directory. */, entryPath);
continue;
}

if (isDir) {
Directory.CreateDirectory (targetPath);
} else {
Expand Down
7 changes: 7 additions & 0 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/PackLibraryResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ public override bool Execute ()
{
var results = new List<ITaskItem> ();

var hashOriginalResources = new HashSet<string> (BundleOriginalResourcesWithLogicalNames.Select (v => v.ItemSpec));

foreach (var item in BundleResourcesWithLogicalNames) {
if (hashOriginalResources.Contains (item.ItemSpec)) {
Log.LogMessage (MessageImportance.Low, $"Skipping BundleResourcesWithLogicalNames={item.ItemSpec}, because it's also specified in BundleOriginalResourcesWithLogicalNames");
continue;
}

var logicalName = item.GetMetadata ("LogicalName");

if (string.IsNullOrEmpty (logicalName)) {
Expand Down
4 changes: 4 additions & 0 deletions scripts/rsp-to-csproj/rsp-to-csproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ void ProcessFile (string file)
break;
case "noconfig": // this is already passed to csc by default
break;
case "reportanalyzer":
if (!properties.Contains (("ReportAnalyzer", "true")))
properties.Add (new ("ReportAnalyzer", "true"));
break;
default:
ReportError ($"Didn't understand argument '{a}'");
break;
Expand Down
16 changes: 0 additions & 16 deletions src/AppKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,22 +1439,6 @@ public enum NSPasteboardReadingOptions : ulong {
AsKeyedArchive = 4,
}

#if !NET && MONOMAC // Use the one in Foundation instead, only keep this in macOS until .NET.
[Native]
public enum NSUnderlineStyle : long {
None = 0x00,
Single = 0x01,
Thick = 0x02,
Double = 0x09,
PatternSolid = 0x0000,
PatternDot = 0x0100,
PatternDash = 0x0200,
PatternDashDot = 0x0300,
PatternDashDotDot = 0x0400,
ByWord = 0x8000,
}
#endif

// Convenience enum, untyped in ObjC
[NoMacCatalyst]
public enum NSUnderlinePattern : int {
Expand Down
26 changes: 1 addition & 25 deletions src/Foundation/Compat.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Compat.cs: Stuff we won't provide in Xamarin.iOS.dll or newer XAMCORE_* profiles
// Compat.cs: Stuff we won't provide in newer XAMCORE_* profiles
//
// Authors:
// Sebastien Pouliot <[email protected]>
Expand All @@ -12,30 +12,6 @@
using ObjCRuntime;

namespace Foundation {

#if !NET
#if MONOMAC
public partial class NSError {

// removed in Xcode 11 GM
[Obsolete ("This API has been removed.")]
public static NSError GetFileProviderErrorForOutOfDateItem (FileProvider.INSFileProviderItem updatedVersion)
{
return null;
}
}
#endif

public partial class NSUserActivity {

[Obsolete ("Use the constructor that allows you to set an activity type.")]
public NSUserActivity ()
: this (String.Empty)
{
}
}
#endif // !NET

#if !XAMCORE_5_0
#if __IOS__ && !__MACCATALYST__
public partial class NSUrlConnection {
Expand Down
10 changes: 0 additions & 10 deletions src/Foundation/DictionaryContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,14 @@
using UIKit;
#endif

#if !NET
using NativeHandle = System.IntPtr;
#endif

#nullable enable

namespace Foundation {

#if NET
[SupportedOSPlatform ("ios")]
[SupportedOSPlatform ("maccatalyst")]
[SupportedOSPlatform ("macos")]
[SupportedOSPlatform ("tvos")]
#endif
public abstract class DictionaryContainer {
#if !COREBUILD
protected DictionaryContainer ()
Expand Down Expand Up @@ -247,11 +241,7 @@ protected DictionaryContainer (NSDictionary? dictionary)
return value as NSDictionary<TKey, TValue>;
}

#if NET
protected T? GetStrongDictionary<[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] T> (NSString key)
#else
protected T? GetStrongDictionary<T> (NSString key)
#endif
where T : DictionaryContainer
{
return GetStrongDictionary (key, dict =>
Expand Down
30 changes: 0 additions & 30 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,9 @@ public enum NSUrlCredentialPersistence : ulong {

#if MONOMAC

#if !NET
[Native]
public enum NSBundleExecutableArchitecture : long {
#else
/// <summary>The bundle's architecture.</summary>
[NoiOS][NoTV][NoMacCatalyst]
public enum NSBundleExecutableArchitecture {
#endif
I386 = 0x00000007,
PPC = 0x00000012,
X86_64 = 0x01000007,
Expand Down Expand Up @@ -252,10 +247,6 @@ public enum NSCalendarUnit : ulong {
public enum NSDataReadingOptions : ulong {
Mapped = 1 << 0,
Uncached = 1 << 1,
#if !NET
[Obsolete ("This option is unavailable.")]
Coordinated = 1 << 2,
#endif
MappedAlways = 1 << 3,
}

Expand Down Expand Up @@ -592,10 +583,6 @@ public enum NSVolumeEnumerationOptions : ulong {
[Flags]
[Native]
public enum NSDirectoryEnumerationOptions : ulong {
#if !NET
[Obsolete ("Use 'None' instead.")]
SkipsNone = 0,
#endif
None = 0,
SkipsSubdirectoryDescendants = 1 << 0,
SkipsPackageDescendants = 1 << 1,
Expand Down Expand Up @@ -808,10 +795,6 @@ public enum NSJsonReadingOptions : ulong {
Json5Allowed = 8,
[iOS (15, 0), TV (15, 0), MacCatalyst (15, 0)]
TopLevelDictionaryAssumed = 16,
#if !NET
[Obsolete ("Use 'FragmentsAllowed. instead.")]
AllowFragments = FragmentsAllowed,
#endif
}

[Flags]
Expand Down Expand Up @@ -889,7 +872,6 @@ public enum NSAttributedStringEnumeration : ulong {
LongestEffectiveRangeNotRequired = 1 << 20,
}

#if NET || !MONOMAC
// macOS has defined this in AppKit as well, but starting with .NET we're going
// to use this one only.
[Native]
Expand All @@ -905,7 +887,6 @@ public enum NSUnderlineStyle : long {
PatternDashDotDot = 0x0400,
ByWord = 0x8000,
}
#endif

// There's an AppKit.NSWritingDirection, which is deprecated.
// There's also an UIKit.UITextWritingDirection, which is deprecated too.
Expand Down Expand Up @@ -977,17 +958,6 @@ public enum NSLigatureType : long {
All,
}

#if !NET
[Flags]
[Native]
public enum NSDateComponentsWrappingBehavior : ulong {
None = 0,
WrapCalendarComponents = 1 << 0,

// Did not add the new enums here, we moved them elsewhere, and provided overloads.
}
#endif

[Flags]
[Native]
public enum NSCalendarOptions : ulong {
Expand Down
2 changes: 0 additions & 2 deletions src/Foundation/LinkerSafeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@

namespace Foundation {

#if NET
[Obsolete ("Replace with '[assembly: System.Reflection.AssemblyMetadata (\"IsTrimmable\", \"True\")]'.")]
[EditorBrowsable (EditorBrowsableState.Never)]
#endif
[AttributeUsage (AttributeTargets.Assembly)]
public sealed class LinkerSafeAttribute : Attribute {

Expand Down
3 changes: 0 additions & 3 deletions src/Foundation/ModelAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@ public sealed class ModelAttribute : Attribute {
public ModelAttribute () { }

public string? Name { get; set; }
#if !NET
public bool AutoGeneratedName { get; set; }
#endif
}
}
72 changes: 0 additions & 72 deletions src/Foundation/MonoTouchException.cs

This file was deleted.

Loading

0 comments on commit d775b99

Please sign in to comment.