Skip to content

Commit

Permalink
Use NativeDependencies property instead to align with AndroidAppBuild…
Browse files Browse the repository at this point in the history
…er changes
  • Loading branch information
ivanpovazan committed Feb 20, 2023
1 parent 65b08e3 commit c09b462
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
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

0 comments on commit c09b462

Please sign in to comment.