Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
[utilities.cake] Only look for namespaces in "obj" assemblies. (#766)
Browse files Browse the repository at this point in the history
Context: dotnet/android-libraries#722

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 May 3, 2023
1 parent 8d8e6d1 commit d5818c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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"
}
}
2 changes: 1 addition & 1 deletion utilities.cake
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ 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);

Expand Down

0 comments on commit d5818c3

Please sign in to comment.