Skip to content

Commit 388f3be

Browse files
authored
[runtime/msbuild] Clean up some unused code. (#24409)
1 parent f35ffe8 commit 388f3be

File tree

5 files changed

+1
-178
lines changed

5 files changed

+1
-178
lines changed

msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,13 @@ public class CompileAppManifest : XamarinTask, IHasProjectDir, IHasResourcePrefi
3434
// This must be an ITaskItem to copy the file to Windows for remote builds.
3535
public ITaskItem? AppManifest { get; set; }
3636

37-
[Required]
38-
public string AssemblyName { get; set; } = String.Empty;
39-
4037
[Required]
4138
public string BundleExecutable { get; set; } = "";
4239

4340
[Required]
4441
[Output] // This is required to create an empty file on Windows for the Input/Outputs check.
4542
public ITaskItem? CompiledAppManifest { get; set; }
4643

47-
[Required]
48-
public bool Debug { get; set; }
49-
50-
public string DebugIPAddresses { get; set; } = String.Empty;
51-
5244
public string DefaultSdkVersion { get; set; } = String.Empty;
5345

5446
public ITaskItem [] FontFilesToRegister { get; set; } = Array.Empty<ITaskItem> ();
@@ -59,12 +51,6 @@ public class CompileAppManifest : XamarinTask, IHasProjectDir, IHasResourcePrefi
5951
[Required]
6052
public bool IsAppExtension { get; set; }
6153

62-
public bool IsXPCService { get; set; }
63-
64-
public bool IsWatchApp { get; set; }
65-
66-
public bool IsWatchExtension { get; set; }
67-
6854
[Required]
6955
public string MinSupportedOSPlatformVersion { get; set; } = string.Empty;
7056

@@ -183,8 +169,6 @@ public override bool Execute ()
183169
void AddXamarinVersionNumber (PDictionary plist)
184170
{
185171
// Add our own version number
186-
if (IsWatchApp)
187-
return;
188172

189173
// This key is our supported way of determining if an app
190174
// was built with Xamarin, so it needs to be present in all apps.
@@ -479,9 +463,6 @@ void Validation (PDictionary plist)
479463

480464
bool CompileMac (PDictionary plist)
481465
{
482-
if (!IsAppExtension || (IsAppExtension && IsXPCService))
483-
plist.SetIfNotPresent ("MonoBundleExecutable", AssemblyName + ".exe");
484-
485466
return !Log.HasLoggedErrors;
486467
}
487468

@@ -512,11 +493,6 @@ bool CompileMobile (PDictionary plist)
512493

513494
SetDeviceFamily (plist);
514495

515-
if (IsWatchExtension) {
516-
if (Debug)
517-
SetAppTransportSecurity (plist);
518-
}
519-
520496
SetRequiredArchitectures (plist);
521497

522498
return !Log.HasLoggedErrors;
@@ -531,7 +507,7 @@ void SetXcodeValues (PDictionary plist, IAppleSdk currentSDK)
531507
SetValueIfNotNull (plist, "DTCompiler", sdkSettings.DTCompiler);
532508
SetValueIfNotNull (plist, "DTPlatformBuild", dtSettings.DTPlatformBuild);
533509
SetValueIfNotNull (plist, "DTSDKBuild", sdkSettings.DTSDKBuild);
534-
SetValueIfNotNull (plist, "DTPlatformName", PlatformUtils.GetTargetPlatform (SdkPlatform, IsWatchApp));
510+
SetValueIfNotNull (plist, "DTPlatformName", PlatformUtils.GetTargetPlatform (SdkPlatform, false));
535511
SetValueIfNotNull (plist, "DTPlatformVersion", dtSettings.DTPlatformVersion);
536512
SetValueIfNotNull (plist, "DTSDKName", sdkSettings.CanonicalName);
537513
SetValueIfNotNull (plist, "DTXcode", AppleSdkSettings.DTXcode);
@@ -632,31 +608,6 @@ void SetDeviceFamily (PDictionary plist)
632608
plist.SetUIDeviceFamily (uiDeviceFamily);
633609
}
634610

635-
void SetAppTransportSecurity (PDictionary plist)
636-
{
637-
// Debugging over http has a couple of gotchas:
638-
// * We can't use https, because that requires a valid server certificate,
639-
// which we can't ensure.
640-
// It would also require a hostname for the mac, which it might not have either.
641-
// * NSAppTransportSecurity/NSExceptionDomains does not allow exceptions based
642-
// on IP address (only hostname).
643-
// Good news: watchOS 3 will apparently not apply ATS when connecting
644-
// directly to IP addresses, which means we won't have to do this at all
645-
// (sometime in the future).
646-
647-
PDictionary? ats;
648-
649-
if (!plist.TryGetValue (ManifestKeys.NSAppTransportSecurity, out ats))
650-
plist.Add (ManifestKeys.NSAppTransportSecurity, ats = new PDictionary ());
651-
652-
if (ats.GetBoolean (ManifestKeys.NSAllowsArbitraryLoads)) {
653-
Log.LogMessage (MessageImportance.Low, MSBStrings.M0017);
654-
} else {
655-
Log.LogMessage (MessageImportance.Low, MSBStrings.M0018);
656-
ats.SetBooleanOrRemove (ManifestKeys.NSAllowsArbitraryLoads, true);
657-
}
658-
}
659-
660611
public bool ShouldCopyToBuildServer (ITaskItem item)
661612
{
662613
// We don't want to copy partial generated manifest files unless they exist and have a non-zero length

msbuild/Xamarin.Shared/Xamarin.Shared.targets

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -621,17 +621,11 @@ Copyright (C) 2018 Microsoft. All rights reserved.
621621
<_CompileAppManifestInputLine Include="ApplicationTitle=$(ApplicationTitle)" />
622622
<_CompileAppManifestInputLine Include="ApplicationVersion=$(ApplicationVersion)" />
623623
<_CompileAppManifestInputLine Include="AppManifest=$(AppBundleManifest)" />
624-
<_CompileAppManifestInputLine Include="AssemblyName=$(AssemblyName)" />
625624
<_CompileAppManifestInputLine Include="CompiledAppManifest=$(_TemporaryAppManifest)" />
626-
<_CompileAppManifestInputLine Include="Debug=$(_BundlerDebug)" />
627-
<_CompileAppManifestInputLine Include="DebugIPAddresses=$(_DebugIPAddresses)" />
628625
<_CompileAppManifestInputLine Include="DefaultSdkVersion=$(_SdkVersion)" />
629626
<_CompileAppManifestInputLine Include="FontFilesToRegister=$(_CompileAppManifestFontFilesToRegister)" />
630627
<_CompileAppManifestInputLine Include="GenerateApplicationManifest=$(GenerateApplicationManifest)" />
631628
<_CompileAppManifestInputLine Include="IsAppExtension=$(IsAppExtension)" />
632-
<_CompileAppManifestInputLine Include="IsWatchApp=$(IsWatchApp)" />
633-
<_CompileAppManifestInputLine Include="IsWatchExtension=$(IsWatchExtension)" />
634-
<_CompileAppManifestInputLine Include="IsXPCService=$(IsXPCService)" />
635629
<_CompileAppManifestInputLine Include="MinSupportedOSPlatformVersion=$(MinSupportedOSPlatformVersion)" />
636630
<_CompileAppManifestInputLine Include="PartialAppManifests=$(_CompileAppManifestPartialAppManifest)" />
637631
<_CompileAppManifestInputLine Include="ProjectDir=$(MSBuildProjectDirectory)" />
@@ -677,18 +671,12 @@ Copyright (C) 2018 Microsoft. All rights reserved.
677671
ApplicationTitle="$(ApplicationTitle)"
678672
ApplicationVersion="$(ApplicationVersion)"
679673
AppManifest="$(AppBundleManifest)"
680-
AssemblyName="$(AssemblyName)"
681674
BundleExecutable="$(_NativeExecutableName)"
682675
CompiledAppManifest="$(_TemporaryAppManifest)"
683-
Debug="$(_BundlerDebug)"
684-
DebugIPAddresses="$(_DebugIPAddresses)"
685676
DefaultSdkVersion="$(_SdkVersion)"
686677
FontFilesToRegister="@(_FontFilesToRegister)"
687678
GenerateApplicationManifest="$(GenerateApplicationManifest)"
688679
IsAppExtension="$(IsAppExtension)"
689-
IsWatchApp="$(IsWatchApp)"
690-
IsWatchExtension="$(IsWatchExtension)"
691-
IsXPCService="$(IsXPCService)"
692680
MinSupportedOSPlatformVersion="$(MinSupportedOSPlatformVersion)"
693681
PartialAppManifests="@(PartialAppManifest)"
694682
ProjectDir="$(MSBuildProjectDirectory)"

runtime/xamarin/launch.h

Lines changed: 0 additions & 114 deletions
This file was deleted.

tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileAppManifestTaskTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ CompileAppManifest CreateTask (string? tmpdir = null, ApplePlatform platform = A
1818
tmpdir = Cache.CreateTemporaryDirectory ();
1919

2020
var task = CreateTask<CompileAppManifest> ();
21-
task.AssemblyName = "AssemblyName";
2221
task.AppBundleName = "AppBundleName";
2322
task.CompiledAppManifest = new TaskItem (Path.Combine (tmpdir, "TemporaryAppManifest.plist"));
2423
task.DefaultSdkVersion = Sdks.GetAppleSdk (platform).GetInstalledSdkVersions (false).First ().ToString ()!;

tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GeneratePlistTaskTests/GeneratePlistTaskTests_Core.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ protected virtual void ConfigureTask ()
4141
Task.ApplicationId = identifier;
4242
Task.AppBundleName = appBundleName;
4343
Task.CompiledAppManifest = new TaskItem (Path.Combine (Cache.CreateTemporaryDirectory (), "AppBundlePath", "Info.plist"));
44-
Task.AssemblyName = assemblyName;
4544
Task.AppManifest = new TaskItem (CreateTempFile ("foo.plist"));
4645
Task.BundleExecutable = assemblyName;
4746
Task.MinSupportedOSPlatformVersion = "10.0";

0 commit comments

Comments
 (0)