[msbuild/dotnet] Use properties on the _AssembliesToAOT item group to specify output paths.

This deduplicates a little bit code to compute the output path.
This commit is contained in:
Rolf Bjarne Kvinge 2021-07-15 11:57:21 +02:00
Родитель ce15ba272e
Коммит 476d35909a
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -705,7 +705,7 @@
Condition="'$(_SdkIsSimulator)' != 'true' And '$(_PlatformName)' != 'macOS'"
DependsOnTargets="_ComputeVariables"
Inputs="@(_AssembliesToAOT)"
Outputs="@(_AssembliesToAOT -> '$(_AOTOutputDirectory)%(Arch)\%(Filename)%(Extension).o')">
Outputs="@(_AssembliesToAOT -> '%(ObjectFile)');@(_AssembliesToAOT -> '%(LLVMFile)');">
<Error Text="The AOT compiler '$(_AOTCompiler)' does not exist." Condition="!Exists ($(_AOTCompiler))" />
@ -733,12 +733,11 @@
SdkRoot="$(_SdkRoot)"
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
>
<Output TaskParameter="ObjectFiles" ItemName="_AOTObjectFiles" />
</CompileNativeCode>
<ItemGroup Condition="'$(IsMacEnabled)' == 'true'">
<!-- Add the AOT-compiled output to the main executable -->
<_XamarinMainLibraries Include="@(_AOTObjectFiles)" />
<_XamarinMainLibraries Include="@(_AssembliesToAOT -> '%(ObjectFile)')" />
<!-- copy the aotdata files to the .app -->
<ResolvedFileToPublish Include="%(_AssembliesToAOT.AOTData)" >

Просмотреть файл

@ -39,6 +39,7 @@ namespace Xamarin.Linker {
var llvmFile = string.Empty;
if ((abi & Abi.LLVM) == Abi.LLVM)
throw ErrorHelper.CreateError (99, $"Support for LLVM hasn't been implemented yet.");
var objectFile = Path.Combine (outputDirectory, arch, Path.GetFileName (input) + ".o");
app.GetAotArguments (asm.FullPath, abi, outputDirectory, aotAssembly, llvmFile, aotData, out var processArguments, out var aotArguments, Path.GetDirectoryName (Configuration.AOTCompiler));
item.Metadata.Add ("Arguments", StringUtils.FormatArguments (aotArguments));
item.Metadata.Add ("ProcessArguments", StringUtils.FormatArguments (processArguments));
@ -46,6 +47,7 @@ namespace Xamarin.Linker {
item.Metadata.Add ("Arch", arch);
item.Metadata.Add ("AOTData", aotData);
item.Metadata.Add ("AOTAssembly", aotAssembly);
item.Metadata.Add ("ObjectFile", objectFile);
}
assembliesToAOT.Add (item);