Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
Use NativeDependencies property instead to align with AndroidAppBuild…
…er changes
  • Loading branch information
ivanpovazan committed Feb 20, 2023
commit c09b462d2c6cff976512d1a0e3b486dd37b23cc4
2 changes: 1 addition & 1 deletion src/mono/sample/iOS-NativeAOT/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<AppleAppBuilderTask
UseNativeAOTRuntime="$(UseNativeAOTRuntime)"
NativeLibraries="@(NativeLibrary)"
NativeDependencies="@(NativeLibrary)"
TargetOS="$(TargetOS)"
Arch="$(TargetArchitecture)"
ProjectName="$(AppName)"
Expand Down
12 changes: 4 additions & 8 deletions src/tasks/AppleAppBuilder/AppleAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ public string TargetOS
public bool UseNativeAOTRuntime { get; set; }

/// <summary>
/// List of static libraries to link with the program.
/// Extra native dependencies to link into the app
/// </summary>
public ITaskItem[] NativeLibraries { get; set; } = Array.Empty<ITaskItem>();
public string[] NativeDependencies { get; set; } = Array.Empty<string>();

public void ValidateRuntimeSelection()
{
Expand Down Expand Up @@ -272,13 +272,9 @@ public override bool Execute()
}
}

foreach (ITaskItem nativeLibrary in NativeLibraries)
foreach (var nativeDependency in NativeDependencies)
{
string nativeLibraryFile = nativeLibrary.GetMetadata("Identity");
if (!string.IsNullOrEmpty(nativeLibraryFile))
{
assemblerFilesToLink.Add(nativeLibraryFile);
}
assemblerFilesToLink.Add(nativeDependency);
}

if (!ForceInterpreter && (isDevice || ForceAOT) && (assemblerFiles.Count == 0 && !UseNativeAOTRuntime))
Expand Down