Skip to content

Commit

Permalink
rework
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Feb 13, 2024
1 parent 45d9db5 commit 07d7e5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ It is shared between "legacy" binding projects and .NET 5 projects.
Nullable="$(Nullable)"
UseJavaLegacyResolver="$(_AndroidUseJavaLegacyResolver)"
NamespaceTransforms="@(AndroidNamespaceReplacement)"
GeneratedFileListFile="$(GeneratedOutputPath)src\$(AssemblyName).FileList.txt"
GeneratedFileListFile="$(GeneratedOutputPath)src\$(AssemblyName).projitems"
>
<Output TaskParameter="GeneratedFiles" ItemName="_GeneratedBindingFiles" />
</BindingsGenerator>
Expand Down
11 changes: 7 additions & 4 deletions src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Android.Build.Tasks;
Expand Down Expand Up @@ -141,10 +142,12 @@ public override bool RunTask ()
var result = base.RunTask ();
List<ITaskItem> files = new List<ITaskItem> ();
if (result && GeneratedFileListFile != null && File.Exists (GeneratedFileListFile)) {
var lines = File.ReadAllLines (GeneratedFileListFile);
foreach (var line in lines) {
if (File.Exists (line)) {
files.Add (new TaskItem (line));
var doc = XDocument.Load (GeneratedFileListFile);
var compileItems = doc.XPathSelectElements ("//Project/ItemGroup/Compile");
foreach (var item in compileItems) {
var file = item.Attribute ("Include");
if (file != null && File.Exists (file.Value)) {
files.Add (new TaskItem (file.Value));
}
}
}
Expand Down

0 comments on commit 07d7e5a

Please sign in to comment.