-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix assembly count when satellite assemblies are present #8790
Changes from all commits
64c3ed0
6d25bc5
35c4644
399b941
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -585,6 +585,38 @@ public static string GetNativeLibsRootDirectoryPath (string androidBinUtilsDirec | |
return Path.GetFullPath (Path.Combine (androidBinUtilsDirectory, relPath, "lib")); | ||
} | ||
|
||
public static string? GetAssemblyCulture (ITaskItem assembly) | ||
{ | ||
// The best option | ||
string? culture = assembly.GetMetadata ("Culture"); | ||
if (!String.IsNullOrEmpty (culture)) { | ||
return TrimSlashes (culture); | ||
} | ||
|
||
// ...slightly worse | ||
culture = assembly.GetMetadata ("RelativePath"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I checked the history and there was some discussion around RelativePath here: #7823 (review) Not sure how that would've been set for satellite assemblies though, I can't find where it'd be set. I'm only seeing Culture (for satellite assemblies in the current project) or DestinationSubDirectory (for satellites from referenced projects) being set. Instead of checking every assembly can you only look at the satellite assemblies? you're already passing those to the GeneratePackageManagerJava task There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we possibly should do that, but not until after #8478 is merged (it changes a lot in this area, and all the optimizations and tweaks to the code should be done only after the merge) |
||
if (!String.IsNullOrEmpty (culture)) { | ||
return TrimSlashes (Path.GetDirectoryName (culture)); | ||
} | ||
|
||
// ...not ideal | ||
culture = assembly.GetMetadata ("DestinationSubDirectory"); | ||
if (!String.IsNullOrEmpty (culture)) { | ||
return TrimSlashes (culture); | ||
} | ||
|
||
return null; | ||
|
||
string? TrimSlashes (string? s) | ||
{ | ||
if (String.IsNullOrEmpty (s)) { | ||
return null; | ||
} | ||
|
||
return s.TrimEnd ('/').TrimEnd ('\\'); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Process a collection of assembly `ITaskItem` objects, splitting it on the assembly architecture (<see cref="GetTargetArch"/>) while, at the same time, ignoring | ||
/// all assemblies which are **not** in the <paramref name="supportedAbis"/> collection. If necessary, the selection can be further controlled by passing a qualifier | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it'd be pretty weird if Culture contained any slashes, might be ok to return it unmodifiednevermind I just saw a binlog that had a Culture with a slash :DThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned the hard way... :)