-
Notifications
You must be signed in to change notification settings - Fork 553
[Xamarin.Android.Build.Tasks] Preserve @(AndroidEnvironment) #729
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
Conversation
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58673 The `@(AndroidEnvironment)` Build action is *supposed to be* usable on Library projects. When used within a Library project, the `@(AndroidEnvironment)` files are embedded into the assembly, and during the App project build they are extracted and merged into the `environment` file within the `.apk`. Unfortunately, this behavior was potentially broken in commit 8688832, as if the Library assembly also contains the `__AndroidLibraryProjects__.zip` embedded resource (e.g. the Library project has a `@(AndroidResource)` Build action), the extraction of the `__AndroidLibraryProjects__.zip` resource will inadvertently remove the previously extracted `@(AndroidEnvironment)` files. Oops. Alter the paths provided to `Files.ExtractAll()` -- which was directly responsible for deleting the environment files -- so that it won't delete the environment files. Update the `tests/locales` on-device unit tests to make use of a Library-provided `@(AndroidEnvironment)`, and add a unit test which reads the environment variable and asserts that the environment variable has the expected value.
updated |= Files.ExtractAll (zip, outDirForDll, modifyCallback: (entryFullName) => { | ||
return entryFullName.Replace ("library_project_imports", ImportsDirectory); | ||
updated |= Files.ExtractAll (zip, importsDir, modifyCallback: (entryFullName) => { | ||
return entryFullName.Replace ("library_project_imports/", ""); |
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.
Do we prefer ""
over string.Empty
?
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.
Ignore that last comment
something weird on the build machine...all the calls to a
|
does not seem to be related to the PR.. |
Gonna kick off the build again.. The old build (for reference) is at [1]. [1] https://jenkins.mono-project.com/job/xamarin-android-pr-builder/1320/ |
build |
1 similar comment
build |
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58673 The `@(AndroidEnvironment)` Build action is *supposed to be* usable on Library projects. When used within a Library project, the `@(AndroidEnvironment)` files are embedded into the assembly, and during the App project build they are extracted and merged into the `environment` file within the `.apk`. Unfortunately, this behavior was potentially broken in commit 8688832, as if the Library assembly also contains the `__AndroidLibraryProjects__.zip` embedded resource (e.g. the Library project has a `@(AndroidResource)` Build action), the extraction of the `__AndroidLibraryProjects__.zip` resource will inadvertently remove the previously extracted `@(AndroidEnvironment)` files. Oops. Alter the paths provided to `Files.ExtractAll()` -- which was directly responsible for deleting the environment files -- so that it won't delete the environment files. Update the `tests/locales` on-device unit tests to make use of a Library-provided `@(AndroidEnvironment)`, and add a unit test which reads the environment variable and asserts that the environment variable has the expected value.
Fixes: dotnet/java-interop#461 Fixes: dotnet/java-interop#682 Fixes: dotnet/java-interop#717 Fixes: dotnet/java-interop#719 Fixes: dotnet/java-interop#728 Changes: dotnet/java-interop@ac914ce...b991bb8 * dotnet/java-interop@b991bb86: [generator] Revert change to use auto-properties in EventArgs classes (#736) * dotnet/java-interop@ee50d89b: Bump to xamarin/xamarin-android-tools/master@f2af06f2 (#733) * dotnet/java-interop@a0b895c1: [build] Suppress NuGet warnings (#730) * dotnet/java-interop@8b1b0507: [generator] Fix parsing of complex generic types (#729) * dotnet/java-interop@ee7afeed: [generator] Prevent generating duplicate EventArgs classes (#726) * dotnet/java-interop@1f21f38c: [generator] Use GC.KeepAlive for reference type method parameters. (#725) * dotnet/java-interop@5136ef98: [Xamarin.Android.Tools.Bytecode] Hide Kotlin nested types inside (#723) * dotnet/java-interop@53d60513: [jnimarshalmethod-gen] Fix registration on Windows (#721) * dotnet/java-interop@5a834d42: [jnimarshalmethod-gen] Avoid creating AppDomains (#720) * dotnet/java-interop@a76edb8c: [Xamarin.Android.Tools.ApiXmlAdjuster] Find app.android.IntentService (#718) * dotnet/java-interop@6cde0877: [Java.Interop] Emit a reference assembly for Java.Interop.dll (#716) * dotnet/java-interop@b858dc59: [generator] Provide line/col numbers for api.xml warnings (#715) * dotnet/java-interop@9be92a04: [ci] Don't kick off CI for documentation only changes. (#712) * dotnet/java-interop@03c22722: [jnimarshalmethod-gen] Fix type resolution crash (#706)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=58673
The
@(AndroidEnvironment)
Build action is supposed to be usable onLibrary projects. When used within a Library project, the
@(AndroidEnvironment)
files are embedded into the assembly, andduring the App project build they are extracted and merged into the
environment
file within the.apk
.Unfortunately, this behavior was potentially broken in commit
8688832, as if the Library assembly also contains the
__AndroidLibraryProjects__.zip
embedded resource (e.g. the Libraryproject has a
@(AndroidResource)
Build action), the extraction ofthe
__AndroidLibraryProjects__.zip
resource will inadvertentlyremove the previously extracted
@(AndroidEnvironment)
files.Oops.
Alter the paths provided to
Files.ExtractAll()
-- which wasdirectly responsible for deleting the environment files -- so that it
won't delete the environment files.
Update the
tests/locales
on-device unit tests to make use of aLibrary-provided
@(AndroidEnvironment)
, and add a unit test whichreads the environment variable and asserts that the environment
variable has the expected value.