Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable

using Microsoft.Android.Build.Tasks;
using Microsoft.Build.Framework;
using Xamarin.Android.Tools;
Expand Down Expand Up @@ -29,6 +31,10 @@ public override bool RunTask ()

// There can be only one, since we run in the inner build
ITaskItem? outputFile = GenerateNativeAotLibraryLoadAssemblerSources.FindOutputFile (OutputSources, abi: abi, rid: RID);
if (outputFile == null) {
Log.LogError ($"Could not find output file for ABI '{abi}' and RID '{RID}'");
return false;
}
Log.LogDebugMessage ($"Environment variables file to generate: {outputFile.ItemSpec}");

string environmentLlFilePath = outputFile.ItemSpec;
Expand All @@ -37,9 +43,9 @@ public override bool RunTask ()
using var environmentWriter = MemoryStreamPool.Shared.CreateStreamWriter ();
bool fileFullyWritten = false;
try {
generator.Generate (environmentModule, targetArch, environmentWriter, environmentLlFilePath!);
generator.Generate (environmentModule, targetArch, environmentWriter, environmentLlFilePath);
environmentWriter.Flush ();
Files.CopyIfStreamChanged (environmentWriter.BaseStream, environmentLlFilePath!);
Files.CopyIfStreamChanged (environmentWriter.BaseStream, environmentLlFilePath);
fileFullyWritten = true;
} finally {
// Log partial contents for debugging if generation failed
Expand Down
Loading