-
Notifications
You must be signed in to change notification settings - Fork 564
Fix AndroidPackagingOptionsExclude so it can be overridden in the csproj #8459
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
Changes from 1 commit
f249070
575cd41
bee8e2d
ca58877
055f155
221dbea
a93b220
faf297e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,8 +222,36 @@ This is so MSBuild does not try to interpret them as actual file wildcards. | |
| NOTE: `*`, `?` and `.` will be replaced in the `BuildApk` task with the | ||
| appropriate RegEx expressions. | ||
|
|
||
| If the default file glob is too restrictive you can remove it by adding the | ||
| following to your csproj | ||
|
|
||
| ``` | ||
| <ItemGroup> | ||
| <AndroidPackagingOptionsExclude Remove="$([MSBuild]::Escape('*.kotlin_*')" /> | ||
| </ItemGroup> | ||
| ``` | ||
|
|
||
| Added in Xamarin.Android 13.1 and .NET 7. | ||
|
|
||
| ## AndroidPackagingOptionsInclude | ||
|
|
||
| A set of file glob compatible items which will allow for items to be | ||
| included from the final package. The default values are as follows | ||
|
|
||
| ``` | ||
| <ItemGroup> | ||
| <AndroidPackagingOptionsInclude Include="$([MSBuild]::Escape('*reflect.kotlin_builtins')" /> | ||
| </ItemGroup> | ||
| ``` | ||
| Items can use file blob characters for wildcards such as `*` and `?`. | ||
| However these Items MUST use URL encoding or '$([MSBuild]::Escape(''))'. | ||
| This is so MSBuild does not try to interpret them as actual file wildcards. | ||
|
|
||
| NOTE: `*`, `?` and `.` will be replaced in the `BuildApk` task with the | ||
| appropriate RegEx expressions. | ||
dellis1972 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Added in .NET 9. | ||
|
Member
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. If this fixes an issue, is there any chance we'd take this to .NET 8 servicing?
Contributor
Author
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. It doesn't fix an issue, it is a new feature. So my guess is that won't qualify for backporting.
Member
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. Ok, I thought it might fix: #8456 If we have a way to include/exclude more or less files.
Contributor
Author
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. It does fix #8456 in that it moves the the ItemGroup to AutoImport.props, but the new ItemGroup is not required to fix that issue. |
||
|
|
||
| ## AndroidResource | ||
|
|
||
| All files with an *AndroidResource* build action are compiled into | ||
|
|
||
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.
This paragraph confuses me: it appears to be saying that wildcards such as
*and?"MUST use URL encoding", but the examples here don't use URL encoding, so…???Or are you trying to say that if you want to specify a regex instead of a glob, you need to URL encode?
This doesn't make sense either, because we always treat the value as a fileglob: https://github.com/xamarin/xamarin-android/blob/57337eda1f0d6b8533b3e3a98eb015b037f8ac5c/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs#L347-L363
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.
The URL encoding or MSBuild::Escape is needed because if you just did
The MSBuild Parsers would try to find files on disk called '.kotlin_' put those in the ItemGroup. So the values passed into
BuildApkwould be empty. Its the line below that paragraph that gives the explanation as to why it needs to be URL encoded.