[Xamarin.Andorid.Build.Tasks] Check if LogicalName is valid before check Resource File.#3327
Conversation
…eck Resource File. Some of our customers are generating `Resource` files which have invalid file names (as far as aapt/aapt2 is concerned). They use the `LogicalName` meta data to provide the "Real" name that the build process should use. However when using `aapt2` our `CheckForInvalidResourceFileNames` task was NOT using the `LogicalName` metadata. It was just using the filename. This breaks their projects with an APT0000: Invalid file name: It must contain only [^a-zA-Z0-9_.-]+ or APT0000: Invalid file name: It must contain only [^a-zA-Z0-9_.]+ We should really support this scenario since we allow the use of `LogicalName` for resource files anyway. This commit fixes that issue and adds a unit test.
|
I think there are test failures related to the changes here: https://jenkins.mono-project.com/job/xamarin-android-pr-pipeline-release/1552/testReport/ There is a |
|
Ok so this is a bit of a problem. |
|
@jonathanpeppers this should be good to go now. I added a test. The CI system is being a bit weird though, some of the bots have been waiting for ages. |
jonathanpeppers
left a comment
There was a problem hiding this comment.
The github status checks for Azure DevOps have a bug right now, only the overall status of the Xamarin.Android build is reported correctly right now.
Only a Lint-related test failed on Windows, this one looks good to me now.
…eck Resource File. (#3327) Some of our customers are generating `Resource` files which have invalid file names (as far as aapt/aapt2 is concerned). They use the `LogicalName` meta data to provide the "Real" name that the build process should use. However when using `aapt2` our `CheckForInvalidResourceFileNames` task was NOT using the `LogicalName` metadata. It was just using the filename. This breaks their projects with an APT0000: Invalid file name: It must contain only [^a-zA-Z0-9_.-]+ or APT0000: Invalid file name: It must contain only [^a-zA-Z0-9_.]+ We should really support this scenario since we allow the use of `LogicalName` for resource files anyway. This commit fixes that issue and adds a unit test. The `<CheckForInvalidResourceFileNames/>` MSBuild task can also ignore invalid path separators as they are fixed up
|
A new preview version has now been published that includes a fix for this item. Fix included in Xamarin.Android 10.0.0.40. Fix included on Windows in Visual Studio 2019 version 16.3 Preview 3. To try the preview version that includes the fix, check for the latest updates in Visual Studio Preview. Fix included on macOS in Visual Studio 2019 for Mac version 8.3 Preview 3. To try the preview version that includes the fix, check for the latest updates on the Preview updater channel. |
|
Release status update A new Release version has now been published that includes the fix for this item. Fix included in Xamarin.Android 10.0.0.43 Fix included on Windows in Visual Studio 2019 version 16.3. To get the new version that includes the fix, check for the latest updates or install the latest version from https://visualstudio.microsoft.com/downloads/. Fix included on macOS in Visual Studio 2019 for Mac version 8.3. To get the new version that includes the fix, check for the latest updates on the Stable updater channel. |
Some of our customers are generating
Resourcefileswhich have invalid file names (as far as aapt/aapt2 is
concerned). They use the
LogicalNamemeta data toprovide the "Real" name that the build process should
use.
However when using
aapt2ourCheckForInvalidResourceFileNamestask was NOT using the
LogicalNamemetadata. It wasjust using the filename. This breaks their projects with
an
or
We should really support this scenario since we allow the
use of
LogicalNamefor resource files anyway.This commit fixes that issue and adds a unit test.