Skip to content

Commit

Permalink
[utilities.cake] Only look for namespaces in "obj" assemblies. (#722)
Browse files Browse the repository at this point in the history
For some reason, `0.2.0-alpha4` of `Xamarin.Legacy.Sdk` causes package dependencies to be placed in the `/bin` directory whereas previously they were not.  Our published namespace script looks for all `.dll`'s in the `/generated` directory, which previously did not include dependencies.  This resulted in adding namespaces that were in dependencies and not just the assemblies packaged in this repository.

To fix this, we can restrict ourselves to looking for assemblies in the `/obj` directory, which does not contain dependency assemblies.
  • Loading branch information
jpobst authored Apr 24, 2023
1 parent c14a7be commit 3732dc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"MSBuild.Sdk.Extras": "3.0.44",
"Microsoft.Build.Traversal": "3.2.0",
"Microsoft.Build.NoTargets": "3.7.0",
"Xamarin.Legacy.Sdk": "0.2.0-alpha2"
"Xamarin.Legacy.Sdk": "0.2.0-alpha4"
}
}
4 changes: 2 additions & 2 deletions utilities.cake
Original file line number Diff line number Diff line change
Expand Up @@ -1645,11 +1645,11 @@ static List<string> FindNamespacesInDirectory (string directory)
{
var list = new SortedSet<string> ();

foreach (var file in System.IO.Directory.EnumerateFiles (directory, "*.dll", SearchOption.AllDirectories))
foreach (var file in System.IO.Directory.EnumerateFiles (directory, "*.dll", SearchOption.AllDirectories).Where (f => f.Replace ('\\', '/').Contains ("/obj/")))
foreach (var ns in FindNamespaces (file))
list.Add (ns);

return list.ToList ();
return list.ToList ();
}

static List<string> FindNamespaces (string assembly)
Expand Down

0 comments on commit 3732dc7

Please sign in to comment.