diff --git a/.gdn/policheck/source.gdnsuppress b/.gdn/policheck/source.gdnsuppress index 44b951ee542..d25c7ea0d1e 100644 --- a/.gdn/policheck/source.gdnsuppress +++ b/.gdn/policheck/source.gdnsuppress @@ -144,6 +144,38 @@ ], "justification": "Reference to ffs(3) find first set bit function.", "createdDate": "2025-02-05 11:48:04Z" + }, + "cccebaacfe4f8c7eae2d4d00c4d534d1f85ae79b11d53bf858c6243061ef7d69": { + "signature": "cccebaacfe4f8c7eae2d4d00c4d534d1f85ae79b11d53bf858c6243061ef7d69", + "memberOf": [ + "default" + ], + "justification": "Verbatim GPLv3 license text in THIRD-PARTY-NOTICES.TXT (gnu/binutils).", + "createdDate": "2026-05-05 00:00:00Z" + }, + "5c055f17206f60132ca8011955bd4ddcfe42a332341015b221e45d5a15d4e0af": { + "signature": "5c055f17206f60132ca8011955bd4ddcfe42a332341015b221e45d5a15d4e0af", + "memberOf": [ + "default" + ], + "justification": "Verbatim GPLv3 license text in THIRD-PARTY-NOTICES.TXT (gnu/binutils).", + "createdDate": "2026-05-05 00:00:00Z" + }, + "ed6b5cb1fe11577308dd5b137e106a12fed8e039c410a57d8580fb72b07a28a2": { + "signature": "ed6b5cb1fe11577308dd5b137e106a12fed8e039c410a57d8580fb72b07a28a2", + "memberOf": [ + "default" + ], + "justification": "Verbatim GPLv3 license text in THIRD-PARTY-NOTICES.TXT (gnu/binutils).", + "createdDate": "2026-05-05 00:00:00Z" + }, + "e281b9747a4a2f75cb24b67a65521526fc407ecd1cc2f2963a586ce507de3096": { + "signature": "e281b9747a4a2f75cb24b67a65521526fc407ecd1cc2f2963a586ce507de3096", + "memberOf": [ + "default" + ], + "justification": "Verbatim GPLv3 license text in THIRD-PARTY-NOTICES.TXT (gnu/binutils).", + "createdDate": "2026-05-05 00:00:00Z" } } } diff --git a/.github/skills/update-tpn/SKILL.md b/.github/skills/update-tpn/SKILL.md new file mode 100644 index 00000000000..dda2b75dca8 --- /dev/null +++ b/.github/skills/update-tpn/SKILL.md @@ -0,0 +1,141 @@ +--- +name: update-tpn +description: >- + Audit and update the THIRD-PARTY-NOTICES.TXT file. Use when the user asks to + "update TPNs", "audit third-party notices", "check third-party licenses", + or after adding/removing a dependency. Scans submodules, vendored code, NuGet + packages, and native libraries to ensure the TPN file is complete and accurate. +--- + +# Update Third-Party Notices + +Audit and regenerate the `THIRD-PARTY-NOTICES.TXT` file at the repo root. + +This file is checked in and shipped as-is in the product NuGet packages. +There is no code generation step — this skill replaces the old xaprepare TPN infrastructure. + +## File Format + +The file uses the **MicrosoftOSS** header format: + +``` +xamarin-android + +THIRD - PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This project incorporates components from the projects listed below. +The original copyright notices and the licenses under which Microsoft +received such components are set forth below. +Microsoft reserves all rights not expressly granted herein, whether by +implication, estoppel or otherwise. + +1. name (url) +2. name (url) +... + +%% name NOTICES AND INFORMATION BEGIN HERE +========================================== + + +========================================== +END OF name NOTICES AND INFORMATION +``` + +Entries are sorted case-insensitively by name. Each entry has a numbered TOC line and a license section. + +## Audit Workflow + +### Step 1 — Inventory all dependencies + +Scan these sources to build a complete list of third-party dependencies: + +#### Git Submodules +Read `.gitmodules` for all submodules. Current submodules and their license files: + +| Submodule | URL | License File | +|-----------|-----|-------------| +| Java.Interop | https://github.com/dotnet/java-interop | `external/Java.Interop/LICENSE` | +| lz4 | https://github.com/dotnet/lz4 (fork of https://github.com/lz4/lz4) | `external/lz4/lib/LICENSE` | +| xxHash | https://github.com/Cyan4973/xxHash | `external/xxHash/LICENSE` | +| constexpr-xxh3 | https://github.com/chys87/constexpr-xxh3 | `external/constexpr-xxh3/LICENSE` | +| robin-map | https://github.com/xamarin/robin-map (fork of https://github.com/Tessil/robin-map) | `external/robin-map/LICENSE` | +| libunwind | https://github.com/libunwind/libunwind | `external/libunwind/LICENSE` | +| xamarin-android-tools | https://github.com/dotnet/android-tools | (not a third-party dep) | +| android-api-docs | https://github.com/dotnet/android-api-docs | (not a third-party dep) | +| debugger-libs | https://github.com/mono/debugger-libs | (not a third-party dep — internal) | + +#### Vendored Source (`src-ThirdParty/`) +List contents of `src-ThirdParty/` directory. Current vendored code and license sources: + +| Directory | Name | License Source | +|-----------|------|---------------| +| `android-platform-tools-base/` | android/platform/tools/base | https://android.googlesource.com/platform/tools/base/+/refs/heads/main/sdk-common/NOTICE (Apache 2.0) | +| `bazel/` | bazelbuild/bazel | https://github.com/bazelbuild/bazel/ (Apache 2.0) | +| `bionic/` | google/bionic | https://android.googlesource.com/platform/bionic/ (Apache 2.0) | +| `crc32.net/` | force-net/crc32.net | https://github.com/force-net/Crc32.NET (MIT) | +| `NUnitLite/` | nunit/nunitlite | https://github.com/nunit/nunitlite/ (MIT) | +| `StrongNameSigner/` | brutaldev/StrongNameSigner | https://github.com/brutaldev/StrongNameSigner/ (Apache 2.0) | + +Note: `Mono.Security.Cryptography/`, `System.Diagnostics.CodeAnalysis/`, `System.Runtime.CompilerServices/`, and `dotnet/` are Microsoft-owned and do not need TPN entries. + +#### NuGet Packages +Search `.csproj` files for `` elements. Current third-party NuGet packages needing TPNs: + +| Package | Name in TPN | License URL | +|---------|------------|-------------| +| ELFSharp | KonradKuczynski/ELFSharp | https://elfsharp.it/ (MIT + LLVM) | +| K4os.Compression.LZ4 | MiloszKrajewski/K4os.Compression.LZ4 | https://github.com/MiloszKrajewski/K4os.Compression.LZ4/ (MIT) | +| Xamarin.LibZipSharp | xamarin/LibZipSharp | https://github.com/xamarin/LibZipSharp/ (MIT) | +| Irony | IronyProject/Irony | https://github.com/IronyProject/Irony (MIT) | +| Newtonsoft.Json | JamesNK/Newtonsoft.Json | https://github.com/JamesNK/Newtonsoft.Json (MIT) | +| NuGet.ProjectModel | NuGet/NuGet.Client | https://github.com/NuGet/NuGet.Client (Apache 2.0) | +| Mono.Cecil | mono/cecil | https://github.com/mono/cecil/ (MIT) | +| Microsoft.Xml.SgmlReader | lovettchris/SgmlReader | https://github.com/lovettchris/SgmlReader/ (Apache 2.0) | + +Note: Microsoft-owned NuGet packages (Microsoft.*, System.*) do not need TPN entries. + +#### Vendored Linker Code +The `src/Xamarin.Android.Build.Tasks/Linker/External/` directory contains vendored code from the Mono linker: + +| Source | Name in TPN | License URL | +|--------|------------|-------------| +| Linker/External/ | mono/linker | https://github.com/mono/linker/ (MIT) | + +#### Native Libraries (from CMakeLists.txt) +Check `src/native/` CMakeLists.txt files for references to external native code. The submodules above (lz4, xxHash, libunwind, robin-map) are compiled into native libraries. + +#### Android SDK Tools +These are downloaded and shipped with the SDK: + +| Tool | Name in TPN | License URL | +|------|------------|-------------| +| aapt2 | google/aapt2 | https://mvnrepository.com/artifact/com.android.tools.build/aapt2 (Apache 2.0) | +| bundletool | google/bundletool | https://github.com/google/bundletool (Apache 2.0) | +| r8 | google/r8 | https://r8.googlesource.com/r8/ (BSD-3-Clause) | +| binutils | gnu/binutils | https://sourceware.org/git/?p=binutils-gdb.git;a=tree;hb=HEAD (GPLv3) | + +#### libzip (via LibZipSharp NuGet) +LibZipSharp bundles libzip internally: + +| Source | Name in TPN | License Location | +|--------|------------|-----------------| +| libzip (in LibZipSharp NuGet) | nih-at/libzip | LibZipSharp NuGet `Licences/libzip/LICENSE` or https://github.com/nih-at/libzip/ (BSD-3-Clause) | + +### Step 2 — Cross-reference + +Compare the inventory against the current entries in `THIRD-PARTY-NOTICES.TXT`: +- **Missing entries**: Dependencies found in Step 1 but not in the TPN file +- **Stale entries**: TPN entries for dependencies no longer used +- **Incorrect info**: Wrong URLs, outdated license text + +### Step 3 — Update the file + +For each change: +1. Add/remove the TOC line (maintain sorted order and renumber) +2. Add/remove the license section (maintain sorted order) +3. For new entries, fetch the license text from the source URL or LICENSE file + +### Step 4 — Verify + +Run `grep -cP "^\d+\." THIRD-PARTY-NOTICES.TXT` (or `Select-String "^\d+\." THIRD-PARTY-NOTICES.TXT` on Windows) to confirm the entry count and ordering. diff --git a/Configuration.props b/Configuration.props index 92a84c6c2c9..51df0fa4e78 100644 --- a/Configuration.props +++ b/Configuration.props @@ -28,16 +28,16 @@ 24 - 36.1 - $(AndroidLatestStableApiLevel) - v16.1 - - 37 - 37.0 - v17.0 + $(AndroidLatestStableApiLevel) + $(AndroidLatestStablePlatformId) + $(AndroidLatestStableFrameworkVersion) $(AndroidLatestStableApiLevel) @@ -45,7 +45,7 @@ $(AndroidLatestStablePlatformId) $(AndroidLatestStableFrameworkVersion) True - $(AndroidLatestStableApiLevel) + $(AndroidLatestStablePlatformId) portable True latest diff --git a/Documentation/docs-mobile/TOC.yml b/Documentation/docs-mobile/TOC.yml index bdb778ad713..35afae71909 100644 --- a/Documentation/docs-mobile/TOC.yml +++ b/Documentation/docs-mobile/TOC.yml @@ -250,8 +250,6 @@ href: messages/xa1011.md - name: XA1023 href: messages/xa1023.md - - name: XA1024 - href: messages/xa1024.md - name: XA1025 href: messages/xa1025.md - name: XA1027 diff --git a/Documentation/docs-mobile/messages/index.md b/Documentation/docs-mobile/messages/index.md index 8a610972e3e..14d5a6c0442 100644 --- a/Documentation/docs-mobile/messages/index.md +++ b/Documentation/docs-mobile/messages/index.md @@ -134,7 +134,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac. + XA1021: Specified source Java library not found: {file} + XA1022: Specified reference Java library not found: {file} + [XA1023](xa1023.md): Using the DX DEX Compiler is deprecated. -+ [XA1024](xa1024.md): Ignoring configuration file 'Foo.dll.config'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher. ++ XA1024: Removed in .NET 11. + [XA1025](xa1025.md): The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. + [XA1027](xa1027.md): The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. + [XA1028](xa1028.md): The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. diff --git a/Documentation/docs-mobile/messages/xa1024.md b/Documentation/docs-mobile/messages/xa1024.md index 9888144b8b9..c74913e4bcc 100644 --- a/Documentation/docs-mobile/messages/xa1024.md +++ b/Documentation/docs-mobile/messages/xa1024.md @@ -1,39 +1,17 @@ --- title: .NET for Android warning XA1024 -description: XA1024 warning code -ms.date: 04/11/2024 +description: XA1024 warning code (removed) +ms.date: 05/01/2026 f1_keywords: - "XA1024" --- # .NET for Android warning XA1024 -## Example messages +This warning has been removed in .NET 11. -``` -warning XA1024: Ignoring configuration file 'Foo.dll.config'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher. -``` - -## Issue - -No support for [configuration files][config] such as `Foo.dll.config` -or `Foo.exe.config` is available in .NET for Android projects. -[``][dllmap] configuration elements are not -supported in .NET 6 at all, and other element types for compatibility -packages like [System.Configuration.ConfigurationManager][nuget] have -never been supported in .NET for Android projects. - -[config]: /dotnet/framework/configure-apps/ -[nuget]: https://www.nuget.org/packages/System.Configuration.ConfigurationManager/ - -## Solution - -Use a supported alternative for [``][dllmap], such as the -[NativeLibrary][native] API. - -Use an alternative for application settings such as -[Preferences][preferences] in Xamarin.Essentials. - -[dllmap]: https://github.com/dotnet/coreclr/blob/master/Documentation/design-docs/dllmap.md -[native]: /dotnet/api/system.runtime.interopservices.nativelibrary -[preferences]: /xamarin/essentials/preferences +The warning was previously issued for `.config` files included in the +build output, but it produced false positives for unrelated files such +as `nuget.config`. Since `.config` files are already excluded from the +publish output and the .NET 6 transition period is long past, the +warning is no longer necessary. diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT index d2c034495f9..d2635a4ac93 100644 --- a/THIRD-PARTY-NOTICES.TXT +++ b/THIRD-PARTY-NOTICES.TXT @@ -1,23 +1,40 @@ -xamarin-android uses third-party libraries or other resources that may be -distributed under licenses different than the xamarin-android software. - -Attributions and license notices for test cases originally authored by -third parties can be found in the respective test directories. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -1. android/platform/tools/base (https://android.googlesource.com/platform/tools/base/+/refs/heads/main/sdk-common/NOTICE) -2. bazelbuild/bazel (https://github.com/bazelbuild/bazel/) -3. chys87/constexpr-xxh3 (https://github.com/chys87/constexpr-xxh3/) -4. Cyan4973/xxHash (https://github.com/Cyan4973/xxHash/) -5. force-net/crc32.net (https://github.com/force-net/Crc32.NET) -6. nunit/nunitlite (https://github.com/nunit/nunitlite/) -7. tessil/robin-map (https://github.com/Tessil/robin-map) +xamarin-android + +THIRD - PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +This project incorporates components from the projects listed below. +The original copyright notices and the licenses under which Microsoft +received such components are set forth below. +Microsoft reserves all rights not expressly granted herein, whether by +implication, estoppel or otherwise. + +1. android/platform/tools/base (https://android.googlesource.com/platform/tools/base/+/refs/heads/main/sdk-common/NOTICE) +2. bazelbuild/bazel (https://github.com/bazelbuild/bazel/) +3. brutaldev/StrongNameSigner (https://github.com/brutaldev/StrongNameSigner/) +4. chys87/constexpr-xxh3 (https://github.com/chys87/constexpr-xxh3/) +5. Cyan4973/xxHash (https://github.com/Cyan4973/xxHash/) +6. dotnet/java-interop (https://github.com/dotnet/java-interop/) +7. force-net/crc32.net (https://github.com/force-net/Crc32.NET) +8. gnu/binutils (https://sourceware.org/git/?p=binutils-gdb.git;a=tree;hb=HEAD) +9. google/aapt2 (https://mvnrepository.com/artifact/com.android.tools.build/aapt2) +10. google/bionic (https://android.googlesource.com/platform/bionic/) +11. google/bundletool (https://github.com/google/bundletool) +12. google/r8 (https://r8.googlesource.com/r8/) +13. IronyProject/Irony (https://github.com/IronyProject/Irony) +14. JamesNK/Newtonsoft.Json (https://github.com/JamesNK/Newtonsoft.Json) +15. KonradKuczynski/ELFSharp (https://elfsharp.it/) +16. libunwind/libunwind (https://github.com/libunwind/libunwind) +17. lovettchris/SgmlReader (https://github.com/lovettchris/SgmlReader/) +18. lz4/lz4 (https://github.com/lz4/lz4/) +19. MiloszKrajewski/K4os.Compression.LZ4 (https://github.com/MiloszKrajewski/K4os.Compression.LZ4/) +20. mono/cecil (https://github.com/mono/cecil/) +21. mono/linker (https://github.com/mono/linker/) +22. nih-at/libzip (https://github.com/nih-at/libzip/) +23. NuGet/NuGet.Client (https://github.com/NuGet/NuGet.Client) +24. nunit/nunitlite (https://github.com/nunit/nunitlite/) +25. tessil/robin-map (https://github.com/Tessil/robin-map) +26. xamarin/LibZipSharp (https://github.com/xamarin/LibZipSharp/) %% android/platform/tools/base NOTICES AND INFORMATION BEGIN HERE ================================================================= @@ -227,6 +244,7 @@ The attached notices are provided for information only. ================================================================= END OF android/platform/tools/base NOTICES AND INFORMATION + %% bazelbuild/bazel NOTICES AND INFORMATION BEGIN HERE ====================================================== @@ -435,6 +453,28 @@ END OF android/platform/tools/base NOTICES AND INFORMATION ====================================================== END OF bazelbuild/bazel NOTICES AND INFORMATION + +%% brutaldev/StrongNameSigner NOTICES AND INFORMATION BEGIN HERE +================================================================ +Copyright (c) Werner van Deventer (werner@brutaldev.com). All rights reserved. + +Licensed under the Apache License, Version 2.0 (the 'License'); you +may not use this file except in compliance with the License. You may +obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an 'AS IS' BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions +and limitations under the License. + + +================================================================ +END OF brutaldev/StrongNameSigner NOTICES AND INFORMATION + + %% chys87/constexpr-xxh3 NOTICES AND INFORMATION BEGIN HERE =========================================================== BSD 2-Clause License @@ -468,6 +508,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =========================================================== END OF chys87/constexpr-xxh3 NOTICES AND INFORMATION + %% Cyan4973/xxHash NOTICES AND INFORMATION BEGIN HERE ===================================================== xxHash Library @@ -501,11 +542,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ===================================================== END OF Cyan4973/xxHash NOTICES AND INFORMATION -%% force-net/crc32.net NOTICES AND INFORMATION BEGIN HERE + +%% dotnet/java-interop NOTICES AND INFORMATION BEGIN HERE ========================================================= +Xamarin SDK + The MIT License (MIT) -Copyright (c) 2016 force +Copyright (c) .NET Foundation Contributors + +All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -527,11 +573,14 @@ SOFTWARE. ========================================================= -END OF force-net/crc32.net NOTICES AND INFORMATION +END OF dotnet/java-interop NOTICES AND INFORMATION -%% nunit/nunitlite NOTICES AND INFORMATION BEGIN HERE -===================================================== -Copyright (c) 2004-2013 Charlie Poole + +%% force-net/crc32.net NOTICES AND INFORMATION BEGIN HERE +========================================================= +The MIT License (MIT) + +Copyright (c) 2016 force Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -540,47 +589,1757 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +========================================================= +END OF force-net/crc32.net NOTICES AND INFORMATION -===================================================== -END OF nunit/nunitlite NOTICES AND INFORMATION -%% tessil/robin-map NOTICES AND INFORMATION BEGIN HERE -====================================================== -MIT License +%% gnu/binutils NOTICES AND INFORMATION BEGIN HERE +================================================== + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + +================================================== +END OF gnu/binutils NOTICES AND INFORMATION + + +%% google/aapt2 NOTICES AND INFORMATION BEGIN HERE +================================================== -Copyright (c) 2017 Thibaut Goetghebuer-Planchon + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 1. Definitions. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +================================================== +END OF google/aapt2 NOTICES AND INFORMATION + + +%% google/bionic NOTICES AND INFORMATION BEGIN HERE +=================================================== +Copyright (C) 2006 The Android Open Source Project + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + +=================================================== +END OF google/bionic NOTICES AND INFORMATION + + +%% google/bundletool NOTICES AND INFORMATION BEGIN HERE +======================================================= + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +======================================================= +END OF google/bundletool NOTICES AND INFORMATION + + +%% google/r8 NOTICES AND INFORMATION BEGIN HERE +=============================================== +https://opensource.org/licenses/BSD-3-Clause + + SPDX short identifier: BSD-3-Clause + + Note: This license has also been called the "New BSD License" or + "Modified BSD License". See also the 2-clause BSD License. + + Copyright (c) 2016, the R8 project authors. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +=============================================== +END OF google/r8 NOTICES AND INFORMATION + + +%% IronyProject/Irony NOTICES AND INFORMATION BEGIN HERE +======================================================== +Copyright (c) 20012 Roman Ivantsov + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE + AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +======================================================== +END OF IronyProject/Irony NOTICES AND INFORMATION + + +%% JamesNK/Newtonsoft.Json NOTICES AND INFORMATION BEGIN HERE +============================================================= +The MIT License (MIT) + + Copyright (c) 2007 James Newton-King + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + associated documentation files (the "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial + portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT + LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +============================================================= +END OF JamesNK/Newtonsoft.Json NOTICES AND INFORMATION + + +%% KonradKuczynski/ELFSharp NOTICES AND INFORMATION BEGIN HERE +============================================================== +Copyright (c) 2011 Konrad Kruczyński and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +This software uses ELF machine constants from the LLVM projects, whose license +is provided below: + +============================================================================== +LLVM Release License +============================================================================== +University of Illinois/NCSA +Open Source License + +Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + + +============================================================== +END OF KonradKuczynski/ELFSharp NOTICES AND INFORMATION + + +%% libunwind/libunwind NOTICES AND INFORMATION BEGIN HERE +========================================================= +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +========================================================= +END OF libunwind/libunwind NOTICES AND INFORMATION + + +%% lovettchris/SgmlReader NOTICES AND INFORMATION BEGIN HERE +============================================================ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +============================================================ +END OF lovettchris/SgmlReader NOTICES AND INFORMATION + + +%% lz4/lz4 NOTICES AND INFORMATION BEGIN HERE +============================================= +LZ4 Library +Copyright (c) 2011-2020, Yann Collet +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +============================================= +END OF lz4/lz4 NOTICES AND INFORMATION + + +%% MiloszKrajewski/K4os.Compression.LZ4 NOTICES AND INFORMATION BEGIN HERE +========================================================================== +MIT License + +Copyright (c) 2017 Milosz Krajewski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +========================================================================== +END OF MiloszKrajewski/K4os.Compression.LZ4 NOTICES AND INFORMATION + + +%% mono/cecil NOTICES AND INFORMATION BEGIN HERE +================================================ +Copyright (c) 2008 - 2015 Jb Evain +Copyright (c) 2008 - 2011 Novell, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +================================================ +END OF mono/cecil NOTICES AND INFORMATION + + +%% mono/linker NOTICES AND INFORMATION BEGIN HERE +================================================= +The MIT License (MIT) +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +================================================= +END OF mono/linker NOTICES AND INFORMATION + + +%% nih-at/libzip NOTICES AND INFORMATION BEGIN HERE +=================================================== +Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + +The authors can be contacted at + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +=================================================== +END OF nih-at/libzip NOTICES AND INFORMATION + + +%% NuGet/NuGet.Client NOTICES AND INFORMATION BEGIN HERE +======================================================== +Copyright (c) .NET Foundation and Contributors. + + All rights reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + these files except in compliance with the License. You may obtain a copy of the + License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed + under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + CONDITIONS OF ANY KIND, either express or implied. See the License for the + specific language governing permissions and limitations under the License. + + +======================================================== +END OF NuGet/NuGet.Client NOTICES AND INFORMATION + + +%% nunit/nunitlite NOTICES AND INFORMATION BEGIN HERE +===================================================== +Copyright (c) 2004-2013 Charlie Poole + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + + +===================================================== +END OF nunit/nunitlite NOTICES AND INFORMATION + + +%% tessil/robin-map NOTICES AND INFORMATION BEGIN HERE +====================================================== +MIT License + +Copyright (c) 2017 Thibaut Goetghebuer-Planchon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +====================================================== +END OF tessil/robin-map NOTICES AND INFORMATION + + +%% xamarin/LibZipSharp NOTICES AND INFORMATION BEGIN HERE +========================================================= +The MIT License (MIT) + +Copyright (c) 2016 Marek Habersack + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +========================================================= +END OF xamarin/LibZipSharp NOTICES AND INFORMATION -====================================================== -END OF tessil/robin-map NOTICES AND INFORMATION diff --git a/build-tools/automation/yaml-templates/variables.yaml b/build-tools/automation/yaml-templates/variables.yaml index b170d2b8324..2975b8e1a13 100644 --- a/build-tools/automation/yaml-templates/variables.yaml +++ b/build-tools/automation/yaml-templates/variables.yaml @@ -76,3 +76,5 @@ variables: value: true - name: DOTNET_CLI_TELEMETRY_OPTOUT value: true +- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE + value: true diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index c24a926da19..67acf8b5aa9 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -167,7 +167,7 @@ - + diff --git a/build-tools/create-packs/License.targets b/build-tools/create-packs/License.targets index f870180e288..fad592d8bf8 100644 --- a/build-tools/create-packs/License.targets +++ b/build-tools/create-packs/License.targets @@ -25,7 +25,7 @@ <_PackageFiles Include="$(IntermediateOutputPath)$(PackageLicenseFile)" PackagePath="\" Condition=" '$(PlatformPackageType)' == '' "/> - <_PackageFiles Include="$(XAInstallPrefix)THIRD-PARTY-NOTICES.TXT" PackagePath="\" /> + <_PackageFiles Include="$(XamarinAndroidSourcePath)THIRD-PARTY-NOTICES.TXT" PackagePath="\" /> <_PackageFiles Include="$(MSBuildThisFileDirectory)Icon.png" PackagePath="\" /> diff --git a/build-tools/installers/create-installers.targets b/build-tools/installers/create-installers.targets index c2cf2524afc..ce7f3580148 100644 --- a/build-tools/installers/create-installers.targets +++ b/build-tools/installers/create-installers.targets @@ -241,7 +241,7 @@ - + diff --git a/build-tools/license-data/Apache-2.0.txt b/build-tools/license-data/Apache-2.0.txt deleted file mode 100644 index 7a4a3ea2424..00000000000 --- a/build-tools/license-data/Apache-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/build-tools/license-data/GPLv2.txt b/build-tools/license-data/GPLv2.txt deleted file mode 100644 index d12dcd1d9b6..00000000000 --- a/build-tools/license-data/GPLv2.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. \ No newline at end of file diff --git a/build-tools/license-data/GPLv3.txt b/build-tools/license-data/GPLv3.txt deleted file mode 100644 index 94a04532226..00000000000 --- a/build-tools/license-data/GPLv3.txt +++ /dev/null @@ -1,621 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS diff --git a/build-tools/license-data/Mono-MIT.txt b/build-tools/license-data/Mono-MIT.txt deleted file mode 100644 index b0a178006b8..00000000000 --- a/build-tools/license-data/Mono-MIT.txt +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Mono Project - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/CreateThirdPartyNotices.cs b/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/CreateThirdPartyNotices.cs deleted file mode 100644 index c0c3f0d895a..00000000000 --- a/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/CreateThirdPartyNotices.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Xamarin.Android.BuildTools.PrepTasks -{ - public class CreateThirdPartyNotices : Task - { - [Required] - public ITaskItem[] Notices { get; set; } - - [Required] - public ITaskItem FileName { get; set; } - - public string LicenseType { get; set; } - - public override bool Execute () - { - Log.LogMessage (MessageImportance.Low, $"Task {nameof (CreateThirdPartyNotices)}"); - Log.LogMessage (MessageImportance.Low, $" {nameof (FileName)}: {FileName}"); - - var notices = Notices - .Distinct (NoticesComparer) - .OrderBy (e => e.ItemSpec, StringComparer.OrdinalIgnoreCase) - .ToList (); - - var contents = new StringWriter (); - WriteHeader (contents); - - int countWidth = notices.Count.ToString ().Length + 1; - var countFormat = "{0,-" + countWidth + "}"; - for (int i = 0; i < notices.Count; ++i) { - var count = string.Format (countFormat, (i + 1) + "."); - var notice = notices [i]; - var version = notice.GetMetadata ("Version"); - if (!string.IsNullOrEmpty (version)) { - version = $" version {version}"; - } - contents.WriteLine ($"{count} {notice.ItemSpec}{version} ({notice.GetMetadata ("SourceUrl")})"); - } - contents.WriteLine (); - - foreach (var notice in notices) { - contents.WriteLine (); - contents.WriteLine ($"%% {notice.ItemSpec} NOTICES AND INFORMATION BEGIN HERE"); - contents.WriteLine ("========================================="); - - var licenseText = notice.GetMetadata ("LicenseText"); - WriteLicense (contents, licenseText); - - var licenseFile = notice.GetMetadata ("LicenseFile"); - WriteLicenseFromFile (contents, licenseFile); - - contents.WriteLine ("========================================="); - contents.WriteLine ($"END OF {notice.ItemSpec} NOTICES AND INFORMATION"); - } - - Directory.CreateDirectory (Path.GetDirectoryName (FileName.ItemSpec)); - - var current = File.Exists (FileName.ItemSpec) ? File.ReadAllText (FileName.ItemSpec) : null; - if (current != contents.ToString ()) { - File.WriteAllText (FileName.ItemSpec, contents.ToString ()); - } - - return !Log.HasLoggedErrors; - } - - void WriteHeader (TextWriter contents) - { - switch (LicenseType?.ToLowerInvariant ()) { - case "foundation": - WriteFoundationHeader (contents); - break; - case "microsoft-commercial": - WriteMicrosoftCommercialHeader (contents); - break; - case "microsoft-oss": - default: - WriteMicrosoftOSSHeader (contents); - break; - } - } - - void WriteFoundationHeader (TextWriter contents) - { - contents.WriteLine ("xamarin-android uses third-party libraries or other resources that may be"); - contents.WriteLine ("distributed under licenses different than the xamarin-android software."); - contents.WriteLine (); - contents.WriteLine ("Attributions and license notices for test cases originally authored by"); - contents.WriteLine ("third parties can be found in the respective test directories."); - contents.WriteLine (); - contents.WriteLine ("In the event that we accidentally failed to list a required notice, please"); - contents.WriteLine ("bring it to our attention. Post an issue or email us:"); - contents.WriteLine (); - contents.WriteLine (" dotnet@microsoft.com"); - contents.WriteLine (); - contents.WriteLine ("The attached notices are provided for information only."); - contents.WriteLine (); - } - - void WriteMicrosoftCommercialHeader (TextWriter contents) - { - contents.WriteLine ("xamarin-android"); - contents.WriteLine (); - contents.WriteLine ("THIRD - PARTY SOFTWARE NOTICES AND INFORMATION"); - contents.WriteLine ("Do Not Translate or Localize"); - contents.WriteLine (); - contents.WriteLine ("Xamarin-Android incorporates components from the projects listed below."); - contents.WriteLine ("Microsoft licenses these components to you under Microsoft’s licensing"); - contents.WriteLine ("terms, except that components licensed under open source licenses"); - contents.WriteLine ("requiring that such components remain under their original license are"); - contents.WriteLine ("being made available to you under their original licensing terms."); - contents.WriteLine ("The original copyright notices and the licenses under which Microsoft"); - contents.WriteLine ("received such components are set forth below for informational purposes."); - contents.WriteLine ("Microsoft reserves all rights not expressly granted herein, whether by"); - contents.WriteLine ("implication, estoppel or otherwise."); - contents.WriteLine (); - } - - void WriteMicrosoftOSSHeader (TextWriter contents) - { - contents.WriteLine ("xamarin-android"); - contents.WriteLine (); - contents.WriteLine ("THIRD - PARTY SOFTWARE NOTICES AND INFORMATION"); - contents.WriteLine ("Do Not Translate or Localize"); - contents.WriteLine (); - contents.WriteLine ("This project incorporates components from the projects listed below."); - contents.WriteLine ("The original copyright notices and the licenses under which Microsoft"); - contents.WriteLine ("received such components are set forth below."); - contents.WriteLine ("Microsoft reserves all rights not expressly granted herein, whether by"); - contents.WriteLine ("implication, estoppel or otherwise."); - contents.WriteLine (); - } - - void WriteLicense (TextWriter contents, string licenseText) - { - if (string.IsNullOrEmpty (licenseText)) { - return; - } - using (var license = new StringReader (licenseText)) { - string line; - while ((line = license.ReadLine ()) != null) { - contents.WriteLine (line.Trim ()); - } - } - } - - void WriteLicenseFromFile (TextWriter contents, string licenseFile) - { - if (string.IsNullOrEmpty (licenseFile)) { - return; - } - foreach (var line in File.ReadLines (licenseFile)) { - contents.WriteLine (line); - } - } - - static readonly TaskItemComparer NoticesComparer = new TaskItemComparer (); - - class TaskItemComparer : IEqualityComparer { - - public bool Equals (ITaskItem a, ITaskItem b) - { - return string.Equals (a.ItemSpec, b.ItemSpec, StringComparison.OrdinalIgnoreCase); - } - - public int GetHashCode (ITaskItem value) - { - return value.ItemSpec.GetHashCode (); - } - } - } -} - diff --git a/build-tools/xaprepare/xaprepare/Application/TPNAttribute.cs b/build-tools/xaprepare/xaprepare/Application/TPNAttribute.cs deleted file mode 100644 index 8d67c94849d..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/TPNAttribute.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - /// - /// Attribute to decorate (T)hird (P)arty (N)otice classes - /// - [AttributeUsage (AttributeTargets.Class)] - class TPNAttribute : Attribute - {} -} diff --git a/build-tools/xaprepare/xaprepare/Application/ThirdPartyLicenseType.cs b/build-tools/xaprepare/xaprepare/Application/ThirdPartyLicenseType.cs deleted file mode 100644 index dbd75013e0f..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/ThirdPartyLicenseType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Xamarin.Android.Prepare -{ - enum ThirdPartyLicenseType - { - Foundation, - MicrosoftOSS, - Commercial, - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/ThirdPartyNotice.cs b/build-tools/xaprepare/xaprepare/Application/ThirdPartyNotice.cs deleted file mode 100644 index ceb40ae0467..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/ThirdPartyNotice.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - abstract class ThirdPartyNotice : AppObject - { - public abstract string LicenseText { get; } - public abstract string LicenseFile { get; } - public abstract string Name { get; } - public abstract Uri SourceUrl { get; } - - public virtual bool Include (bool includeExternalDeps, bool includeBuildDeps) => true; - - public void EnsureValid () - { - bool haveText = !String.IsNullOrEmpty (LicenseText); - bool haveFile = !String.IsNullOrEmpty (LicenseFile); - - if (haveText && haveFile) - throw new InvalidOperationException ($"Only one of LicenseText or LicenseFile properties can be set ({this})"); - - if (!haveText && !haveFile) - throw new InvalidOperationException ($"One of LicenseText or LicenseFile properties must be set ({this})"); - - if (String.IsNullOrEmpty (Name)) - throw new InvalidOperationException ($"The Name property must be set ({this})"); - - if (SourceUrl == null) - throw new InvalidOperationException ($"The SourceUrl property must be set ({this})"); - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Application/ThirdPartyNoticeGroup.cs b/build-tools/xaprepare/xaprepare/Application/ThirdPartyNoticeGroup.cs deleted file mode 100644 index ac3ebffe043..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/ThirdPartyNoticeGroup.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Prepare -{ - abstract class ThirdPartyNoticeGroup : ThirdPartyNotice - { - static readonly Uri url = new Uri ("http://not.an/item"); - - public override string LicenseText => "not a license item"; - public override string LicenseFile => String.Empty; - public override string Name => "license item group"; - public override Uri SourceUrl => url; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => ShouldInclude (includeExternalDeps, includeBuildDeps); - - public abstract List Notices { get; } - protected abstract bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps); - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs index ab2ab8e8fdb..75fd5eb30a3 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs @@ -50,7 +50,7 @@ class BuildAndroidPlatforms new AndroidPlatform (apiName: "VanillaIceCream", apiLevel: 35, platformID: "35", include: "v15.0", framework: "v15.0"), new AndroidPlatform (apiName: "Baklava", apiLevel: 36, platformID: "36", include: "v16.0", framework: "v16.0"), new AndroidPlatform (apiName: "CANARY", apiLevel: new Version (36, 1), platformID: "36.1", include: "v16.1", framework: "v16.1", stable: true), - new AndroidPlatform (apiName: "CinnamonBun", apiLevel: new Version (37, 0), platformID: "37.0", include: "v17.0", framework: "v17.0", stable: false), + new AndroidPlatform (apiName: "CinnamonBun", apiLevel: new Version (37, 0), platformID: "37.0", include: "v17.0", framework: "v17.0", stable: true), }; } diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/CommonLicenses.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/CommonLicenses.cs deleted file mode 100644 index cb3b7d86219..00000000000 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/CommonLicenses.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - static class CommonLicenses - { - static readonly string LicenseDataDir = Path.Combine ("build-tools", "license-data"); - - public static readonly string Apache20Path = Path.Combine (LicenseDataDir, "Apache-2.0.txt"); - public static readonly string GPLv2Path = Path.Combine (LicenseDataDir, "GPLv2.txt"); - public static readonly string GPLv3Path = Path.Combine (LicenseDataDir, "GPLv3.txt"); - public static readonly string MonoMITPath = Path.Combine (LicenseDataDir, "Mono-MIT.txt"); - } -} diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs index 16aa5bb9958..1c67c51d241 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs @@ -74,8 +74,8 @@ public AndroidToolchain () new AndroidPlatformComponent ("platform-34-ext7_r02", apiLevel: "34", pkgRevision: "2"), new AndroidPlatformComponent ("platform-35_r02", apiLevel: "35", pkgRevision: "2"), new AndroidPlatformComponent ("platform-36_r02", apiLevel: "36", pkgRevision: "2"), - new AndroidPlatformComponent ("platform-36.1_r01", apiLevel: "36.1", pkgRevision: "1", isLatestStable: true), - new AndroidPlatformComponent ("platform-37.0_r01", apiLevel: "37.0", pkgRevision: "1", isLatestStable: false, isPreview: true), + new AndroidPlatformComponent ("platform-36.1_r01", apiLevel: "36.1", pkgRevision: "1"), + new AndroidPlatformComponent ("platform-37.0_r01", apiLevel: "37.0", pkgRevision: "1", isLatestStable: true), new AndroidToolchainComponent ("source-36_r01", destDir: Path.Combine ("sources", "android-36"), diff --git a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs index 1f98ecadf3f..35946068248 100644 --- a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs +++ b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_Standard.cs @@ -30,7 +30,6 @@ protected override void AddSteps (Context context) protected override void AddEndSteps (Context context) { - Steps.Add (new Step_ThirdPartyNotices ()); Steps.Add (new Step_GenerateFiles (atBuildStart: false)); } diff --git a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_ThirdPartyNotices.cs b/build-tools/xaprepare/xaprepare/Scenarios/Scenario_ThirdPartyNotices.cs deleted file mode 100644 index 3934dc69ce3..00000000000 --- a/build-tools/xaprepare/xaprepare/Scenarios/Scenario_ThirdPartyNotices.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Xamarin.Android.Prepare -{ - [Scenario (isDefault: false)] - class Scenario_ThirdPartyNotices : Scenario - { - public Scenario_ThirdPartyNotices () - : base ("ThirdPartyNotices", "Generate the `THIRD-PARTY-NOTICES.TXT` files.") - { - NeedsGitSubmodules = true; - } - - protected override void AddSteps (Context context) - { - if (context == null) - throw new ArgumentNullException (nameof (context)); - - Steps.Add (new Step_ThirdPartyNotices ()); - } - - protected override void AddStartSteps (Context context) - { - } - - protected override void AddEndSteps (Context context) - { - } - } -} diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_CopyExtraResultFilesForCI.cs b/build-tools/xaprepare/xaprepare/Steps/Step_CopyExtraResultFilesForCI.cs index 4fecf7d4f43..2fcb8a04cb0 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_CopyExtraResultFilesForCI.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_CopyExtraResultFilesForCI.cs @@ -29,7 +29,6 @@ await Task.Run (() => { string[] xaRootDirBuildFiles = { "Configuration.OperatingSystem.props", "Configuration.Override.props", - "THIRD-PARTY-NOTICES.TXT", "config.log", "config.status", "config.h", diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs index 01214519f05..cface28e4f6 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs @@ -55,9 +55,9 @@ protected override async Task Execute (Context context) for (int attempt = 1; attempt <= maxAttempts; attempt++) { var logPath = $"{logPathBase}-attempt{attempt}.binlog"; var runner = new ProcessRunner (Configurables.Paths.DotNetPreviewTool, "restore", - ProcessRunner.QuoteArgument (packageDownloadProj), + packageDownloadProj, "--configfile", Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "NuGet.config"), - ProcessRunner.QuoteArgument ($"-bl:{logPath}"), + $"-bl:{logPath}", "--verbosity", "normal" ) { EchoStandardOutput = true, diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_ThirdPartyNotices.cs b/build-tools/xaprepare/xaprepare/Steps/Step_ThirdPartyNotices.cs deleted file mode 100644 index 47c2690e4cb..00000000000 --- a/build-tools/xaprepare/xaprepare/Steps/Step_ThirdPartyNotices.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; - -namespace Xamarin.Android.Prepare -{ - class Step_ThirdPartyNotices : Step - { - static readonly Dictionary tpnBlurbs = new Dictionary { - { ThirdPartyLicenseType.MicrosoftOSS, - @"xamarin-android - -THIRD - PARTY SOFTWARE NOTICES AND INFORMATION -Do Not Translate or Localize - -This project incorporates components from the projects listed below. -The original copyright notices and the licenses under which Microsoft -received such components are set forth below. -Microsoft reserves all rights not expressly granted herein, whether by -implication, estoppel or otherwise."}, - - { ThirdPartyLicenseType.Foundation, - @"xamarin-android uses third-party libraries or other resources that may be -distributed under licenses different than the xamarin-android software. - -Attributions and license notices for test cases originally authored by -third parties can be found in the respective test directories. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only."}, - - { ThirdPartyLicenseType.Commercial, - @"xamarin-android - -THIRD - PARTY SOFTWARE NOTICES AND INFORMATION -Do Not Translate or Localize - -Xamarin-Android incorporates components from the projects listed below. -Microsoft licenses these components to you under Microsoft’s licensing -terms, except that components licensed under open source licenses -requiring that such components remain under their original license are -being made available to you under their original licensing terms. -The original copyright notices and the licenses under which Microsoft -received such components are set forth below for informational purposes. -Microsoft reserves all rights not expressly granted herein, whether by -implication, estoppel or otherwise." } - }; - - public Step_ThirdPartyNotices () - : base ("Preparing Third Party Notices") - {} - -#pragma warning disable CS1998 - protected override async Task Execute (Context context) - { - GenerateThirdPartyNotices (Path.Combine (BuildPaths.XamarinAndroidSourceRoot, "THIRD-PARTY-NOTICES.TXT"), - ThirdPartyLicenseType.Foundation, - includeExternalDeps: false, - includeBuildDeps: true); - Log.StatusLine (); - GenerateThirdPartyNotices (Path.Combine (context.XAInstallPrefix, "THIRD-PARTY-NOTICES.TXT"), - ThirdPartyLicenseType.MicrosoftOSS, - includeExternalDeps: true, - includeBuildDeps: false); - - return true; - } -#pragma warning restore CS1998 - - void GenerateThirdPartyNotices (string outputPath, ThirdPartyLicenseType licenseType, bool includeExternalDeps, bool includeBuildDeps) - { - List types = Utilities.GetTypesWithCustomAttribute (); - if (types.Count == 0) { - Log.StatusLine ("No Third Party Notice entries found", ConsoleColor.Gray); - return; - } - - var licenses = new SortedDictionary (StringComparer.OrdinalIgnoreCase); - foreach (Type type in types) { - EnsureValidTPNType (type); - - if (type.IsSubclassOf (typeof (ThirdPartyNoticeGroup))) { - ProcessTPN (licenses, Activator.CreateInstance (type) as ThirdPartyNoticeGroup, includeExternalDeps, includeBuildDeps); - continue; - } - - if (type.IsSubclassOf (typeof (ThirdPartyNotice))) { - ProcessTPN (licenses, Activator.CreateInstance (type) as ThirdPartyNotice, includeExternalDeps, includeBuildDeps); - continue; - } - - throw new NotSupportedException ($"ThirdPartyNotice type {type.FullName} not supported"); - } - - if (licenses.Count == 0) - return; - - string? blurb; - if (!tpnBlurbs.TryGetValue (licenseType, out blurb) || blurb == null) - throw new InvalidOperationException ($"Unknown license type {licenseType}"); - - using (StreamWriter sw = Utilities.OpenStreamWriter (outputPath)) { - Log.StatusLine ($" Generating: {Utilities.GetRelativePath (BuildPaths.XamarinAndroidSourceRoot, outputPath)}", ConsoleColor.Gray); - Log.DebugLine ($"Full path: {outputPath}"); - - sw.WriteLine (blurb); - sw.WriteLine (); - - uint i = 0; - int pad = licenses.Count >= 10 ? 4 : 3; - foreach (var kvp in licenses) { - string name = kvp.Key; - ThirdPartyNotice tpn = kvp.Value; - - sw.Write ($"{++i}.".PadRight (pad)); - sw.WriteLine ($"{name} ({tpn.SourceUrl})"); - } - sw.WriteLine (); - - foreach (string key in licenses.Keys) { - ThirdPartyNotice tpn = licenses [key]; - - string heading = $"%% {tpn.Name} NOTICES AND INFORMATION BEGIN HERE"; - string underline = "=".PadRight (heading.Length, '='); - sw.WriteLine (heading); - sw.WriteLine (underline); - if (tpn.LicenseText.Length > 0) - sw.WriteLine (tpn.LicenseText.TrimStart ()); - else - sw.WriteLine (FetchTPNLicense (tpn.LicenseFile)); - sw.WriteLine (); - sw.WriteLine (underline); - sw.WriteLine ($"END OF {tpn.Name} NOTICES AND INFORMATION"); - sw.WriteLine (); - } - - sw.Flush (); - } - } - - string FetchTPNLicense (string relativeFilePath) - { - string path = Path.Combine (BuildPaths.XamarinAndroidSourceRoot, relativeFilePath); - if (!File.Exists (path)) - throw new InvalidOperationException ($"License file {path} does not exist"); - - return File.ReadAllText (path).ReplaceLineEndings (); - } - - void EnsureValidTPNType (Type type) - { - if (!type.IsClass || type.IsAbstract) - throw new InvalidOperationException ($"TPN type must be a non-abstract class ({type})"); - } - - void ProcessTPN (SortedDictionary licenses, ThirdPartyNotice? tpn, bool includeExternalDeps, bool includeBuildDeps) - { - if (tpn == null) - throw new ArgumentNullException (nameof (tpn)); - - tpn.EnsureValid (); - if (!tpn.Include (includeExternalDeps, includeBuildDeps)) - return; - - Log.StatusLine ($" {Context.Instance.Characters.Bullet} Processing: ", tpn.Name, ConsoleColor.Gray, ConsoleColor.White); - - if (licenses.ContainsKey (tpn.Name)) { - Log.InfoLine ($"Duplicate Third Party Notice '{tpn.Name}' (old class: {licenses [tpn.Name]}; new class: {tpn})"); - return; - } - - licenses.Add (tpn.Name, tpn); - } - - void ProcessTPN (SortedDictionary licenses, ThirdPartyNoticeGroup? tpng, bool includeExternalDeps, bool includeBuildDeps) - { - if (tpng == null) - throw new ArgumentNullException (nameof (tpng)); - - if (tpng.Notices == null || tpng.Notices.All (n => n == null)) - throw new InvalidOperationException ($"TPN group {tpng} without notices"); - - if (!tpng.Include (includeExternalDeps, includeBuildDeps)) - return; - - foreach (ThirdPartyNotice tpn in tpng.Notices) { - if (tpn == null) - throw new InvalidOperationException ($"TPN group {tpng} contains a null notice"); - if (tpn is ThirdPartyNoticeGroup tpg) - ProcessTPN (licenses, tpg, includeExternalDeps, includeBuildDeps); - else - ProcessTPN (licenses, tpn, includeExternalDeps, includeBuildDeps); - } - } - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/ELFSharp.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/ELFSharp.cs deleted file mode 100644 index a64b06f42ed..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/ELFSharp.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class KonradKuczynski_ELFSharp_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://elfsharp.it/"); - - public override string LicenseFile => String.Empty; - public override string Name => "KonradKuczynski/ELFSharp"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -Copyright (c) 2011 Konrad Kruczyński and other contributors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -This software uses ELF machine constants from the LLVM projects, whose license -is provided below: - -============================================================================== -LLVM Release License -============================================================================== -University of Illinois/NCSA -Open Source License - -Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. -All rights reserved. - -Developed by: - - LLVM Team - - University of Illinois at Urbana-Champaign - - http://llvm.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the ""Software""), to deal with -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -SOFTWARE. -"; - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Java.Interop.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Java.Interop.cs deleted file mode 100644 index ad3b47d475f..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Java.Interop.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class JavaInterop_External_Dependencies_Group : ThirdPartyNoticeGroup - { - protected override bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - - public override List Notices => new List { - new JavaInterop_xamarin_Java_Interop_TPN (), - new JavaInterop_gityf_crc_TPN (), - new JavaInterop_javaparser_javaparser_TPN (), - new JavaInterop_jbevain_mono_linq_expressions_TPN (), - new JavaInterop_mono_csharp_TPN (), - new JavaInterop_mono_LineEditor_TPN (), - new JavaInterop_mono_Options_TPN (), - new JavaInterop_zzzprojects_HtmlAgilityPack_TPN (), - }; - } - - class JavaInterop_xamarin_Java_Interop_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/dotnet/java-interop/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalJavaInteropDir, "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "dotnet/java-interop"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class JavaInterop_gityf_crc_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/gityf/crc"); - - public override string LicenseFile => String.Empty; - public override string Name => "gityf/crc"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" -Copyright (c) 2012, Salvatore Sanfilippo -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Redis nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ""AS IS"" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -"; - } - - // via: https://github.com/dotnet/java-interop/blob/b588ef502d8d3b4c32e0ad731115e1b71fd56b5c/tools/java-source-utils/build.gradle#L33-L34 - class JavaInterop_javaparser_javaparser_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/javaparser/javaparser/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalJavaInteropDir, "LICENSE"); - - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "javaparser/javaparser"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - // git submodules of Java.Interop - class JavaInterop_jbevain_mono_linq_expressions_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/jbevain/mono.linq.expressions/"); - - public override string LicenseFile => String.Empty; - public override string Name => "jbevain/mono.linq.expressions"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - Copyright (C) 2012 Jb Evain - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ""Software""), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -"; - - public override bool Include(bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps && includeBuildDeps; - } - - // from various packages.config files in Java.Interop - class JavaInterop_mono_csharp_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/mono/tree/master/mcs/class/Mono.CSharp"); - - public override string LicenseFile => CommonLicenses.MonoMITPath; - public override string Name => "mono/csharp"; - public override Uri SourceUrl => url; - - public override string LicenseText => String.Empty; - } - - class JavaInterop_mono_LineEditor_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/LineEditor/blob/master/LICENSE"); - - public override string LicenseFile => CommonLicenses.MonoMITPath; - public override string Name => "mono/LineEditor"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class JavaInterop_mono_Options_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/mono/tree/master/mcs/class/Mono.Options"); - - public override string LicenseFile => CommonLicenses.MonoMITPath; - public override string Name => "mono/Options"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - } - - class JavaInterop_zzzprojects_HtmlAgilityPack_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/zzzprojects/html-agility-pack"); - - public override string LicenseFile => String.Empty; - public override string Name => "zzzprojects/HtmlAgilityPack"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - The MIT License (MIT) - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the ""Software""), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -"; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/K4os.Compression.LZ4.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/K4os.Compression.LZ4.cs deleted file mode 100644 index c216bd37496..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/K4os.Compression.LZ4.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class MiloszKrajewski_K4os_Compression_LZ4_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/MiloszKrajewski/K4os.Compression.LZ4/"); - - public override string LicenseFile => String.Empty; - public override string Name => "MiloszKrajewski/K4os.Compression.LZ4"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -MIT License - -Copyright (c) 2017 Milosz Krajewski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -"; - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs deleted file mode 100644 index 27bf7e1dad4..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/LibZipSharp.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml.Linq; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class LibZipSharp_xamarin_LibZipSharp_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/xamarin/LibZipSharp/"); - static readonly string licenseFile = Path.Combine ( - Context.Instance.Properties.GetRequiredValue (KnownProperties.PkgXamarin_LibZipSharp), - "Licences", "LICENSE" - ); - - public override string LicenseFile => licenseFile; - public override string Name => "xamarin/LibZipSharp"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/StrongNameSigner.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/StrongNameSigner.cs deleted file mode 100644 index 45ab44b28b4..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/StrongNameSigner.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class StrongNameSigner_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/brutaldev/StrongNameSigner/"); - - public override string LicenseFile => string.Empty; - public override string Name => "brutaldev/StrongNameSigner"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -Copyright (c) Werner van Deventer (werner@brutaldev.com). All rights reserved. - -Licensed under the Apache License, Version 2.0 (the 'License'); you -may not use this file except in compliance with the License. You may -obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an 'AS IS' BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing permissions -and limitations under the License. -"; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Build.Tasks.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Build.Tasks.cs deleted file mode 100644 index b97a1e770e0..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Build.Tasks.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class XamarinAndroidBuildTasks_AOSP : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://android.googlesource.com/platform/tools/base/+/refs/heads/main/sdk-common/NOTICE"); - - public override string LicenseText => String.Empty; - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "android/platform/tools/base"; - public override Uri SourceUrl => url; - } - - // The contents of the following files are originally from - // https://github.com/bazelbuild/bazel/tree/master/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment - // * Xamarin.Android.Build.Tasks/Resources/IncrementalClassLoader.java - // * Xamarin.Android.Build.Tasks/Resources/Placeholder.java - // * Xamarin.Android.Build.Tasks/Resources/MonkeyPatcher.java - // * Xamarin.Android.Build.Tasks/Resources/ResourceLoader.java - - [TPN] - class XamarinAndroidBuildTasks_bazelbuild_bazel_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/bazelbuild/bazel/"); - - public override string LicenseText => String.Empty; - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "bazelbuild/bazel"; - public override Uri SourceUrl => url; - } - - [TPN] - class XamarinAndroidBuildTasks_External_Dependencies_Group : ThirdPartyNoticeGroup - { - protected override bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - - public override List Notices => new List { - new XamarinAndroidBuildTasks_fsharp_fsharp_TPN (), - new XamarinAndroidBuildTasks_IronyProject_Irony_TPN (), - new XamarinAndroidBuildTasks_JamesNK_NewtonsoftJson_TPN (), - new XamarinAndroidBuildTasks_NuGet_NuGetClient_TPN (), - new XamarinAndroidBuildTasks_gnu_binutils_TPN (), - }; - } - - class XamarinAndroidBuildTasks_fsharp_fsharp_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/fsharp/fsharp/"); - - public override string LicenseText => String.Empty; - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "fsharp/fsharp"; - public override Uri SourceUrl => url; - } - - class XamarinAndroidBuildTasks_IronyProject_Irony_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/IronyProject/Irony"); - - public override string LicenseFile => String.Empty; - public override string Name => "IronyProject/Irony"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - Copyright (c) 20012 Roman Ivantsov - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the ""Software""), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -"; - } - - class XamarinAndroidBuildTasks_JamesNK_NewtonsoftJson_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/JamesNK/Newtonsoft.Json"); - - public override string LicenseFile => String.Empty; - public override string Name => "JamesNK/Newtonsoft.Json"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - The MIT License (MIT) - - Copyright (c) 2007 James Newton-King - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - associated documentation files (the ""Software""), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the - following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial - portions of the Software. - - THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT - LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -"; - } - - class XamarinAndroidBuildTasks_NuGet_NuGetClient_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/NuGet/NuGet.Client"); - - public override string LicenseFile => String.Empty; - public override string Name => "NuGet/NuGet.Client"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - Copyright (c) .NET Foundation and Contributors. - - All rights reserved. - - Licensed under the Apache License, Version 2.0 (the ""License""); you may not use - these files except in compliance with the License. You may obtain a copy of the - License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software distributed - under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR - CONDITIONS OF ANY KIND, either express or implied. See the License for the - specific language governing permissions and limitations under the License. -"; - } - - class XamarinAndroidBuildTasks_gnu_binutils_TPN : ThirdPartyNotice { - - static readonly Uri url = new Uri ("https://sourceware.org/git/?p=binutils-gdb.git;a=tree;hb=HEAD"); - - public override string LicenseText => String.Empty; - public override string LicenseFile => CommonLicenses.GPLv3Path; - public override string Name => "gnu/binutils"; - public override Uri SourceUrl => url; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.NunitLite.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.NunitLite.cs deleted file mode 100644 index 3029285a30e..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.NunitLite.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - // The contents of the Xamarin.Android.NUnitLite/NUnitLite directory are - // from https://github.com/nunit/nunitlite/tree/master/src/framework - - [TPN] - class XamarinAndroidNunitLite_nunit_nunitlite_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/nunit/nunitlite/"); - - public override string LicenseFile => String.Empty; - public override string Name => "nunit/nunitlite"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" -Copyright (c) 2004-2013 Charlie Poole - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -"; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.Aidl.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.Aidl.cs deleted file mode 100644 index edcd42756af..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.Aidl.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - // External dependencies from `Xamarin.Android.Tools.Aidl/packages.config` - - [TPN] - class XamarinAndroidToolsAidl_IronyProject_Irony_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/IronyProject/Irony"); - - public override string LicenseFile => String.Empty; - public override string Name => "IronyProject/Irony"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - Copyright (c) 20012 Roman Ivantsov - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the ""Software""), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -"; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.JavadocImporter.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.JavadocImporter.cs deleted file mode 100644 index 07ff0edb167..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/Xamarin.Android.Tools.JavadocImporter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - // External dependencies from `Xamarin.Android.Tools.JavadocImporter/packages.config` - - [TPN] - class XamarinAndroidToolsJavadocImporter_lovettchris_SgmlReader_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/lovettchris/SgmlReader/"); - - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "lovettchris/SgmlReader"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include(bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/aapt2.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/aapt2.cs deleted file mode 100644 index 2ea9723f0d7..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/aapt2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class aapt2_google_aapt2_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://mvnrepository.com/artifact/com.android.tools.build/aapt2"); - - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "google/aapt2"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bionic.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bionic.cs deleted file mode 100644 index fcc87a3ae7b..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bionic.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class google_bionic_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://android.googlesource.com/platform/bionic/"); - - public override string LicenseFile => String.Empty; - public override string Name => "google/bionic"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -Copyright (C) 2006 The Android Open Source Project - -Licensed under the Apache License, Version 2.0 (the ""License""); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an ""AS IS"" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -"; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bundletool.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bundletool.cs deleted file mode 100644 index 9e4c9686aa4..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/bundletool.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class bundletool_google_bundletool_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/google/bundletool"); - - public override string LicenseFile => CommonLicenses.Apache20Path; - public override string Name => "google/bundletool"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs deleted file mode 100644 index 2011c562a4b..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/libzip.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class libzip_nih_at_libzip_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/nih-at/libzip/"); - static readonly string licenseFile = Path.Combine ( - Context.Instance.Properties.GetRequiredValue (KnownProperties.PkgXamarin_LibZipSharp), - "Licences", "libzip", "LICENSE" - ); - - public override string LicenseFile => licenseFile; - public override string Name => "nih-at/libzip"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/lz4.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/lz4.cs deleted file mode 100644 index c9d08f7e156..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/lz4.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class lz4_lz4_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/lz4/lz4/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalDir, "lz4", "lib", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "lz4/lz4"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs deleted file mode 100644 index 2a549a76210..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/mono.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class mono_External_Dependencies_Group : ThirdPartyNoticeGroup - { - protected override bool ShouldInclude (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - - public override List Notices => new List { - new mono_mono_cecil_TPN (), - new mono_mono_linker_TPN (), - }; - } - - class mono_mono_cecil_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/cecil/"); - static readonly string licenseFile = String.Empty; - - public override string LicenseFile => licenseFile; - public override string Name => "mono/cecil"; - public override Uri SourceUrl => url; - public override string LicenseText => @"Copyright (c) 2008 - 2015 Jb Evain -Copyright (c) 2008 - 2011 Novell, Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -""Software""), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -"; - } - - class mono_mono_linker_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/mono/linker/"); - static readonly string licenseFile = String.Empty; - - public override string LicenseFile => licenseFile; - public override string Name => "mono/linker"; - public override Uri SourceUrl => url; - public override string LicenseText => @"The MIT License (MIT) -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -"; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/r8.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/r8.cs deleted file mode 100644 index ba37fdb8ebc..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/r8.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - // monodroid/jni/zip - [TPN] - class XamarinAndroidToolsAidl_google_r8_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://r8.googlesource.com/r8/"); - - public override string LicenseFile => String.Empty; - public override string Name => "google/r8"; - public override Uri SourceUrl => url; - - public override string LicenseText => @" - https://opensource.org/licenses/BSD-3-Clause - - SPDX short identifier: BSD-3-Clause - - Note: This license has also been called the ""New BSD License"" or - ""Modified BSD License"". See also the 2-clause BSD License. - - Copyright (c) 2016, the R8 project authors. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ""AS IS"" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -"; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeExternalDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/robin-map.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/robin-map.cs deleted file mode 100644 index 560f8d62cdb..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/robin-map.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class tessil_robin_map_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/Tessil/robin-map"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalDir, "robin-map", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "tessil/robin-map"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeBuildDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xaprepare.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xaprepare.cs deleted file mode 100644 index 9545a68798c..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xaprepare.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class xaprepare_force_net_Crc32_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/force-net/Crc32.NET"); - - public override string LicenseFile => String.Empty; - public override string Name => "force-net/crc32.net"; - public override Uri SourceUrl => url; - public override string LicenseText => @" -The MIT License (MIT) - -Copyright (c) 2016 force - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the ""Software""), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -"; - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => !includeExternalDeps && includeBuildDeps; - } -} diff --git a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xxHash.cs b/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xxHash.cs deleted file mode 100644 index eca3569e106..00000000000 --- a/build-tools/xaprepare/xaprepare/ThirdPartyNotices/xxHash.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; - -namespace Xamarin.Android.Prepare -{ - [TPN] - class constexpr_xxh3_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/chys87/constexpr-xxh3/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalDir, "constexpr-xxh3", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "chys87/constexpr-xxh3"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeBuildDeps; - } - - [TPN] - class xxHash_TPN : ThirdPartyNotice - { - static readonly Uri url = new Uri ("https://github.com/Cyan4973/xxHash/"); - static readonly string licenseFile = Path.Combine (Configurables.Paths.ExternalDir, "xxHash", "LICENSE"); - - public override string LicenseFile => licenseFile; - public override string Name => "Cyan4973/xxHash"; - public override Uri SourceUrl => url; - public override string LicenseText => String.Empty; - - public override bool Include (bool includeExternalDeps, bool includeBuildDeps) => includeBuildDeps; - } -} diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ManifestGenerator.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ManifestGenerator.cs index e83e7120ff6..4220238e44f 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ManifestGenerator.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ManifestGenerator.cs @@ -148,7 +148,7 @@ XDocument CreateDefaultManifest () /// /// Manifest templates may use compat JNI names (e.g., "android.apptests.App") - /// but the trimmable path generates JCWs with CRC-based names (e.g., "crc64.../App"). + /// but the trimmable path generates JCWs with hashed package names (e.g., "crc64.../App"). /// This method rewrites any compat name references to the actual JCW name so the /// Android runtime can find the class. /// diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/Model/TypeMapAssemblyData.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/Model/TypeMapAssemblyData.cs index 5f945a8ac05..b9126586bf4 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/Model/TypeMapAssemblyData.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/Model/TypeMapAssemblyData.cs @@ -40,6 +40,12 @@ sealed class TypeMapAssemblyData /// public List AliasHolders { get; } = new (); + /// + /// Maximum array rank for which the generator emits per-rank __ArrayMapRank{N} + /// sentinel TypeDefs and TypeMap entries. 0 disables. + /// + public int MaxArrayRank { get; set; } + /// /// Assembly names that need [IgnoresAccessChecksTo] for cross-assembly n_* calls. /// @@ -77,6 +83,12 @@ sealed record TypeMapAttributeData /// True for 2-arg unconditional entries (ACW types, essential runtime types). /// public bool IsUnconditional => TargetTypeReference == null; + + /// + /// 1-based array rank when this entry should use a __ArrayMapRank{value} + /// sentinel as its TGroup instead of the default model anchor. + /// + public int? AnchorRank { get; init; } } /// diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ModelBuilder.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ModelBuilder.cs index 1baa3d23e92..7547c5ac38f 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ModelBuilder.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ModelBuilder.cs @@ -40,7 +40,11 @@ static class ModelBuilder /// Scanned Java peer types (typically from a single input assembly). /// Output .dll path — used to derive assembly/module names if not specified. /// Explicit assembly name. If null, derived from . - public static TypeMapAssemblyData Build (IReadOnlyList peers, string outputPath, string? assemblyName = null) + /// + /// Emit per-rank array TypeMap entries + __ArrayMapRank{N} sentinels + /// for ranks 1... 0 disables array entry emission. + /// + public static TypeMapAssemblyData Build (IReadOnlyList peers, string outputPath, string? assemblyName = null, int maxArrayRank = 0) { if (peers is null) { throw new ArgumentNullException (nameof (peers)); @@ -48,13 +52,16 @@ public static TypeMapAssemblyData Build (IReadOnlyList peers, stri if (outputPath is null) { throw new ArgumentNullException (nameof (outputPath)); } + if (maxArrayRank < 0) { + throw new ArgumentOutOfRangeException (nameof (maxArrayRank), maxArrayRank, "Must be >= 0."); + } assemblyName ??= Path.GetFileNameWithoutExtension (outputPath); - string moduleName = Path.GetFileName (outputPath); var model = new TypeMapAssemblyData { AssemblyName = assemblyName, - ModuleName = moduleName, + ModuleName = Path.GetFileName (outputPath), + MaxArrayRank = maxArrayRank, }; // Invoker types are NOT emitted as separate proxies or TypeMap entries. @@ -90,6 +97,10 @@ public static TypeMapAssemblyData Build (IReadOnlyList peers, stri } EmitPeers (model, jniName, peersForName, assemblyName, usedProxyNames); + + if (maxArrayRank > 0) { + EmitArrayEntries (model, jniName, peersForName, maxArrayRank); + } } // Compute IgnoresAccessChecksTo from cross-assembly references @@ -410,4 +421,55 @@ static TypeMapAttributeData BuildEntry (JavaPeerInfo peer, JavaPeerProxyData? pr static string AssemblyQualify (string typeName, string assemblyName) => $"{typeName}, {assemblyName}"; + + /// + /// Emits per-rank array TypeMap entries for one peer, anchored to the per-assembly + /// __ArrayMapRank{N} sentinels. Keys are bare element JNI names (rank is encoded + /// by the sentinel anchor, not by JNI array prefixes). Skips open generics, primitive JNI + /// keyword keys (handled by the legacy primitive-array path), and alias groups. + /// + static void EmitArrayEntries (TypeMapAssemblyData model, string jniName, List peersForName, int maxArrayRank) + { + if (jniName.Length == 1 && IsJniPrimitiveKeyword (jniName [0])) { + return; + } + if (peersForName.Count != 1) { + return; + } + + var peer = peersForName [0]; + if (peer.IsGenericDefinition) { + return; + } + + for (int rank = 1; rank <= maxArrayRank; rank++) { + string arrayTypeRef = AssemblyQualify (peer.ManagedTypeName + Brackets (rank), peer.AssemblyName); + model.Entries.Add (new TypeMapAttributeData { + JniName = jniName, + ProxyTypeReference = arrayTypeRef, + TargetTypeReference = arrayTypeRef, + AnchorRank = rank, + }); + } + } + + static string Brackets (int rank) => rank switch { + 1 => "[]", + 2 => "[][]", + 3 => "[][][]", + _ => BuildBrackets (rank), + }; + + static string BuildBrackets (int rank) + { + var sb = new StringBuilder (rank * 2); + for (int i = 0; i < rank; i++) { + sb.Append ("[]"); + } + return sb.ToString (); + } + + static bool IsJniPrimitiveKeyword (char c) + => c == 'Z' || c == 'B' || c == 'C' || c == 'S' || c == 'I' + || c == 'J' || c == 'F' || c == 'D' || c == 'V'; } diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/RootTypeMapAssemblyGenerator.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/RootTypeMapAssemblyGenerator.cs index 56eed743c84..5d5f7434d49 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/RootTypeMapAssemblyGenerator.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/RootTypeMapAssemblyGenerator.cs @@ -10,7 +10,7 @@ namespace Microsoft.Android.Sdk.TrimmableTypeMap; /// /// Generates the root _Microsoft.Android.TypeMaps.dll assembly that: /// -/// References all per-assembly typemap assemblies via [assembly: TypeMapAssemblyTargetAttribute<__TypeMapAnchor>("name")]. +/// References all per-assembly typemap assemblies via [assembly: TypeMapAssemblyTargetAttribute<T>("name")]. /// Emits a TypeMapLoader class whose Initialize() method calls /// with the appropriate /// type mapping dictionaries. @@ -35,7 +35,8 @@ namespace Microsoft.Android.Sdk.TrimmableTypeMap; /// // Option A: Shared universe /// TrimmableTypeMap.Initialize( /// TypeMapping.GetOrCreateExternalTypeMapping<Java.Lang.Object>(), -/// TypeMapping.GetOrCreateProxyTypeMapping<Java.Lang.Object>()); +/// TypeMapping.GetOrCreateProxyTypeMapping<Java.Lang.Object>(), +/// arrayMapsByAssemblyAndRank); /// /// // Option B: Per-assembly universes (aggregated) /// var typeMaps = new IReadOnlyDictionary<string, Type>[] { @@ -46,7 +47,7 @@ namespace Microsoft.Android.Sdk.TrimmableTypeMap; /// TypeMapping.GetOrCreateProxyTypeMapping<_Mono_Android_TypeMap.__TypeMapAnchor>(), /// TypeMapping.GetOrCreateProxyTypeMapping<_MyApp_TypeMap.__TypeMapAnchor>(), /// }; -/// TrimmableTypeMap.Initialize(typeMaps, proxyMaps); +/// TrimmableTypeMap.Initialize(typeMaps, proxyMaps, arrayMapsByAssemblyAndRank); /// } /// } /// } @@ -72,7 +73,12 @@ public RootTypeMapAssemblyGenerator (Version systemRuntimeVersion) /// Stream to write the output PE to. /// Optional assembly name (defaults to _Microsoft.Android.TypeMaps). /// Optional module name for the PE metadata. - public void Generate (IReadOnlyList perAssemblyTypeMapNames, bool useSharedTypemapUniverse, Stream stream, string? assemblyName = null, string? moduleName = null) + /// + /// Maximum array rank for which per-assembly typemaps emitted __ArrayMapRank{N} + /// sentinels. Must match the value passed to the per-assembly generators. 0 means + /// no array sentinels were emitted; the loader passes null for array maps. + /// + public void Generate (IReadOnlyList perAssemblyTypeMapNames, bool useSharedTypemapUniverse, Stream stream, string? assemblyName = null, string? moduleName = null, int maxArrayRank = 0) { if (perAssemblyTypeMapNames is null) { throw new ArgumentNullException (nameof (perAssemblyTypeMapNames)); @@ -115,18 +121,19 @@ public void Generate (IReadOnlyList perAssemblyTypeMapNames, bool useSha } else { EmitPerAssemblyUniverseAssemblyTargetAttributes (pe, perAssemblyTypeMapNames); } + EmitArrayAssemblyTargetAttributes (pe, perAssemblyTypeMapNames, maxArrayRank); // Emit [assembly: IgnoresAccessChecksTo("...")] so TypeMapLoader.Initialize() can access - // internal types (SingleUniverseTypeMap, AggregateTypeMap in Mono.Android, - // and __TypeMapAnchor in each per-assembly typemap DLL). + // internal types (TrimmableTypeMap and friends in Mono.Android, and private anchors + // in each per-assembly typemap DLL when aggregate universes or array maps are used). var accessTargets = new List { "Mono.Android" }; - if (!useSharedTypemapUniverse) { + if (!useSharedTypemapUniverse || maxArrayRank > 0) { accessTargets.AddRange (perAssemblyTypeMapNames); } pe.EmitIgnoresAccessChecksToAttribute (accessTargets); // Emit TypeMapLoader class with Initialize() method - EmitTypeMapLoader (pe, anchorTypeHandle, perAssemblyTypeMapNames, useSharedTypemapUniverse); + EmitTypeMapLoader (pe, anchorTypeHandle, perAssemblyTypeMapNames, useSharedTypemapUniverse, maxArrayRank); pe.WritePE (stream); } @@ -152,6 +159,24 @@ static void EmitPerAssemblyUniverseAssemblyTargetAttributes (PEAssemblyBuilder p } } + static void EmitArrayAssemblyTargetAttributes (PEAssemblyBuilder pe, IReadOnlyList perAssemblyTypeMapNames, int maxArrayRank) + { + if (maxArrayRank == 0) { + return; + } + + var openAttrRef = GetTypeMapAssemblyTargetAttributeRef (pe); + foreach (var name in perAssemblyTypeMapNames) { + var asmRef = pe.FindOrAddAssemblyRef (name); + for (int rank = 1; rank <= maxArrayRank; rank++) { + var rankAnchorRef = pe.Metadata.AddTypeReference (asmRef, + default, pe.Metadata.GetOrAddString ($"__ArrayMapRank{rank}")); + var ctorRef = GetTypeMapAssemblyTargetAttributeCtorRef (pe, openAttrRef, rankAnchorRef); + EmitAssemblyTargetAttribute (pe, ctorRef, name); + } + } + } + static TypeReferenceHandle GetTypeMapAssemblyTargetAttributeRef (PEAssemblyBuilder pe) { return pe.Metadata.AddTypeReference (pe.SystemRuntimeInteropServicesRef, @@ -174,7 +199,7 @@ static void EmitAssemblyTargetAttribute (PEAssemblyBuilder pe, MemberReferenceHa pe.Metadata.AddCustomAttribute (EntityHandle.AssemblyDefinition, ctorRef, blobHandle); } - static void EmitTypeMapLoader (PEAssemblyBuilder pe, EntityHandle anchorTypeHandle, IReadOnlyList perAssemblyTypeMapNames, bool useSharedTypemapUniverse) + static void EmitTypeMapLoader (PEAssemblyBuilder pe, EntityHandle anchorTypeHandle, IReadOnlyList perAssemblyTypeMapNames, bool useSharedTypemapUniverse, int maxArrayRank) { var metadata = pe.Metadata; @@ -209,49 +234,34 @@ static void EmitTypeMapLoader (PEAssemblyBuilder pe, EntityHandle anchorTypeHand MetadataTokens.FieldDefinitionHandle (metadata.GetRowCount (TableIndex.Field) + 1), MetadataTokens.MethodDefinitionHandle (metadata.GetRowCount (TableIndex.MethodDef) + 1)); + var externalDictTypeSpec = MakeIReadOnlyDictTypeSpec (pe, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + var externalDictArrayTypeSpec = MakeIReadOnlyDictArrayTypeSpec (pe, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + if (useSharedTypemapUniverse) { - // TrimmableTypeMap.Initialize(IReadOnlyDictionary, IReadOnlyDictionary) - var initializeRef = AddInitializeSingleRef (pe, trimmableTypeMapRef, iReadOnlyDictOpenRef, systemTypeRef); - EmitInitializeWithSingleTypeMap (pe, anchorTypeHandle, getExternalMemberRef, getProxyMemberRef, initializeRef); + var initializeRef = AddInitializeSingleWithArraysRef (pe, trimmableTypeMapRef, iReadOnlyDictOpenRef, systemTypeRef); + EmitInitializeWithSingleTypeMap (pe, anchorTypeHandle, getExternalMemberRef, getProxyMemberRef, + initializeRef, externalDictTypeSpec, externalDictArrayTypeSpec, perAssemblyTypeMapNames, maxArrayRank); } else { - // TrimmableTypeMap.Initialize(IReadOnlyDictionary[], IReadOnlyDictionary[]) - var initializeRef = AddInitializeAggregateRef (pe, trimmableTypeMapRef, iReadOnlyDictOpenRef, systemTypeRef); - var externalDictTypeSpec = MakeIReadOnlyDictTypeSpec (pe, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + var initializeRef = AddInitializeAggregateWithArraysRef (pe, trimmableTypeMapRef, iReadOnlyDictOpenRef, systemTypeRef); var proxyDictTypeSpec = MakeIReadOnlyDictTypeSpec (pe, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); - EmitInitializeWithAggregateTypeMap (pe, perAssemblyTypeMapNames, getExternalMemberRef, getProxyMemberRef, initializeRef, externalDictTypeSpec, proxyDictTypeSpec, iReadOnlyDictOpenRef, systemTypeRef); + EmitInitializeWithAggregateTypeMap (pe, perAssemblyTypeMapNames, getExternalMemberRef, getProxyMemberRef, + initializeRef, externalDictTypeSpec, proxyDictTypeSpec, externalDictArrayTypeSpec, iReadOnlyDictOpenRef, systemTypeRef, maxArrayRank); } } - static void EmitInitializeWithSingleTypeMap (PEAssemblyBuilder pe, EntityHandle anchorTypeHandle, - MemberReferenceHandle getExternalMemberRef, MemberReferenceHandle getProxyMemberRef, - MemberReferenceHandle initializeRef) - { - var getExternalSpec = MakeGenericMethodSpec (pe, getExternalMemberRef, anchorTypeHandle); - var getProxySpec = MakeGenericMethodSpec (pe, getProxyMemberRef, anchorTypeHandle); - - pe.EmitBody ("Initialize", - MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig, - sig => sig.MethodSignature ().Parameters (0, rt => rt.Void (), p => { }), - encoder => { - // TypeMapping.GetOrCreateExternalTypeMapping<__TypeMapAnchor>() - encoder.OpCode (ILOpCode.Call); - encoder.Token (getExternalSpec); - // TypeMapping.GetOrCreateProxyTypeMapping<__TypeMapAnchor>() - encoder.OpCode (ILOpCode.Call); - encoder.Token (getProxySpec); - // TrimmableTypeMap.Initialize(typeMap, proxyMap) - encoder.OpCode (ILOpCode.Call); - encoder.Token (initializeRef); - encoder.OpCode (ILOpCode.Ret); - }); - } - + /// + /// Aggregate IL emit. Builds typeMaps[N], proxyMaps[N], and either + /// arrayMapsByAssemblyAndRank[N][maxArrayRank] from per-assembly + /// __ArrayMapRank{N} anchors or null when is 0. + /// static void EmitInitializeWithAggregateTypeMap (PEAssemblyBuilder pe, IReadOnlyList perAssemblyTypeMapNames, MemberReferenceHandle getExternalMemberRef, MemberReferenceHandle getProxyMemberRef, MemberReferenceHandle initializeRef, TypeSpecificationHandle externalDictTypeSpec, TypeSpecificationHandle proxyDictTypeSpec, - TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef) + TypeSpecificationHandle externalDictArrayTypeSpec, + TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef, + int maxArrayRank) { var count = perAssemblyTypeMapNames.Count; @@ -269,54 +279,170 @@ static void EmitInitializeWithAggregateTypeMap (PEAssemblyBuilder pe, MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig, sig => sig.MethodSignature ().Parameters (0, rt => rt.Void (), p => { }), encoder => { - // var typeMaps = new IReadOnlyDictionary[N]; - encoder.LoadConstantI4 (count); - encoder.OpCode (ILOpCode.Newarr); - encoder.Token (externalDictTypeSpec); - encoder.OpCode (ILOpCode.Stloc_0); - - for (int i = 0; i < count; i++) { - encoder.OpCode (ILOpCode.Ldloc_0); - encoder.LoadConstantI4 (i); - encoder.OpCode (ILOpCode.Call); - encoder.Token (getExternalSpecs [i]); - encoder.OpCode (ILOpCode.Stelem_ref); - } - - // var proxyMaps = new IReadOnlyDictionary[N]; - encoder.LoadConstantI4 (count); - encoder.OpCode (ILOpCode.Newarr); - encoder.Token (proxyDictTypeSpec); - encoder.OpCode (ILOpCode.Stloc_1); - - for (int i = 0; i < count; i++) { - encoder.OpCode (ILOpCode.Ldloc_1); - encoder.LoadConstantI4 (i); - encoder.OpCode (ILOpCode.Call); - encoder.Token (getProxySpecs [i]); - encoder.OpCode (ILOpCode.Stelem_ref); - } - - // TrimmableTypeMap.Initialize(typeMaps, proxyMaps) - encoder.OpCode (ILOpCode.Ldloc_0); - encoder.OpCode (ILOpCode.Ldloc_1); + // var typeMaps = new IReadOnlyDictionary[N]; (loc 0) + EmitNewArrayLocal (encoder, count, externalDictTypeSpec, slot: 0); + EmitFillArrayLocal (encoder, count, getExternalSpecs, slot: 0); + + // var proxyMaps = new IReadOnlyDictionary[N]; (loc 1) + EmitNewArrayLocal (encoder, count, proxyDictTypeSpec, slot: 1); + EmitFillArrayLocal (encoder, count, getProxySpecs, slot: 1); + + // TrimmableTypeMap.Initialize(typeMaps, proxyMaps, arrayMapsByAssemblyAndRank-or-null) + encoder.LoadLocal (0); + encoder.LoadLocal (1); + EmitArrayMapsByAssemblyAndRankOrNull (pe, encoder, perAssemblyTypeMapNames, getExternalMemberRef, externalDictTypeSpec, externalDictArrayTypeSpec, maxArrayRank); encoder.OpCode (ILOpCode.Call); encoder.Token (initializeRef); encoder.OpCode (ILOpCode.Ret); }, encodeLocals: localsSig => { - // LOCAL_SIG header + 2 locals localsSig.WriteByte (0x07); // LOCAL_SIG localsSig.WriteCompressedInteger (2); // count - // local 0: IReadOnlyDictionary[] - localsSig.WriteByte (0x1D); // SZARRAY + // loc 0: IReadOnlyDictionary[] + localsSig.WriteByte (0x1D); EncodeIReadOnlyDictType (localsSig, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); - // local 1: IReadOnlyDictionary[] - localsSig.WriteByte (0x1D); // SZARRAY + // loc 1: IReadOnlyDictionary[] + localsSig.WriteByte (0x1D); EncodeIReadOnlyDictType (localsSig, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); }); } + static void EmitNewArrayLocal (InstructionEncoder encoder, int count, TypeSpecificationHandle elemSpec, int slot) + { + encoder.LoadConstantI4 (count); + encoder.OpCode (ILOpCode.Newarr); + encoder.Token (elemSpec); + encoder.StoreLocal (slot); + } + + static void EmitFillArrayLocal (InstructionEncoder encoder, int count, EntityHandle[] specs, int slot) + { + for (int i = 0; i < count; i++) { + encoder.LoadLocal (slot); + encoder.LoadConstantI4 (i); + encoder.OpCode (ILOpCode.Call); + encoder.Token (specs [i]); + encoder.OpCode (ILOpCode.Stelem_ref); + } + } + + /// MemberRef for TrimmableTypeMap.Initialize(typeMaps[], proxyMaps[], arrayMapsByAssemblyAndRank[][]). + static MemberReferenceHandle AddInitializeAggregateWithArraysRef (PEAssemblyBuilder pe, TypeReferenceHandle trimmableTypeMapRef, + TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef) + { + var blob = new BlobBuilder (96); + blob.WriteByte (0x00); // DEFAULT (static) + blob.WriteCompressedInteger (3); // parameter count + blob.WriteByte (0x01); // return type: void + // Param 1: IReadOnlyDictionary[] + blob.WriteByte (0x1D); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + // Param 2: IReadOnlyDictionary[] + blob.WriteByte (0x1D); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); + // Param 3: IReadOnlyDictionary?[][] + blob.WriteByte (0x1D); + blob.WriteByte (0x1D); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + return pe.Metadata.AddMemberReference (trimmableTypeMapRef, + pe.Metadata.GetOrAddString ("Initialize"), pe.Metadata.GetOrAddBlob (blob)); + } + + /// + /// Shared-universe IL emit. Single merged main map (anchored on Java.Lang.Object) + /// plus either arrayMapsByAssemblyAndRank[N][maxArrayRank] from per-assembly + /// __ArrayMapRank{N} anchors or null when is 0. + /// + static void EmitInitializeWithSingleTypeMap (PEAssemblyBuilder pe, EntityHandle anchorTypeHandle, + MemberReferenceHandle getExternalMemberRef, MemberReferenceHandle getProxyMemberRef, + MemberReferenceHandle initializeRef, + TypeSpecificationHandle externalDictTypeSpec, TypeSpecificationHandle externalDictArrayTypeSpec, + IReadOnlyList perAssemblyTypeMapNames, + int maxArrayRank) + { + var getExternalSpec = MakeGenericMethodSpec (pe, getExternalMemberRef, anchorTypeHandle); + var getProxySpec = MakeGenericMethodSpec (pe, getProxyMemberRef, anchorTypeHandle); + + pe.EmitBody ("Initialize", + MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig, + sig => sig.MethodSignature ().Parameters (0, rt => rt.Void (), p => { }), + encoder => { + // TrimmableTypeMap.Initialize(GetExternal(), GetProxy(), arrayMapsByAssemblyAndRank-or-null) + encoder.OpCode (ILOpCode.Call); + encoder.Token (getExternalSpec); + encoder.OpCode (ILOpCode.Call); + encoder.Token (getProxySpec); + EmitArrayMapsByAssemblyAndRankOrNull (pe, encoder, perAssemblyTypeMapNames, getExternalMemberRef, externalDictTypeSpec, externalDictArrayTypeSpec, maxArrayRank); + encoder.OpCode (ILOpCode.Call); + encoder.Token (initializeRef); + encoder.OpCode (ILOpCode.Ret); + }); + } + + /// MemberRef for TrimmableTypeMap.Initialize(typeMap, proxyMap, arrayMapsByAssemblyAndRank[][]). + static MemberReferenceHandle AddInitializeSingleWithArraysRef (PEAssemblyBuilder pe, TypeReferenceHandle trimmableTypeMapRef, + TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef) + { + var blob = new BlobBuilder (96); + blob.WriteByte (0x00); // DEFAULT (static) + blob.WriteCompressedInteger (3); // parameter count + blob.WriteByte (0x01); // return type: void + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); + blob.WriteByte (0x1D); + blob.WriteByte (0x1D); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); + return pe.Metadata.AddMemberReference (trimmableTypeMapRef, + pe.Metadata.GetOrAddString ("Initialize"), pe.Metadata.GetOrAddBlob (blob)); + } + + /// + /// Emits IL that pushes either a fresh + /// IReadOnlyDictionary<string, Type>?[assemblyCount][maxArrayRank] + /// (when > 0) or ldnull. + /// + static void EmitArrayMapsByAssemblyAndRankOrNull (PEAssemblyBuilder pe, InstructionEncoder encoder, + IReadOnlyList perAssemblyTypeMapNames, + MemberReferenceHandle getExternalMemberRef, + TypeSpecificationHandle externalDictTypeSpec, TypeSpecificationHandle externalDictArrayTypeSpec, + int maxArrayRank) + { + if (maxArrayRank == 0) { + encoder.OpCode (ILOpCode.Ldnull); + return; + } + + encoder.LoadConstantI4 (perAssemblyTypeMapNames.Count); + encoder.OpCode (ILOpCode.Newarr); + encoder.Token (externalDictArrayTypeSpec); + for (int i = 0; i < perAssemblyTypeMapNames.Count; i++) { + var asmRef = pe.FindOrAddAssemblyRef (perAssemblyTypeMapNames [i]); + encoder.OpCode (ILOpCode.Dup); + encoder.LoadConstantI4 (i); + EmitArrayMapsByRank (pe, encoder, asmRef, getExternalMemberRef, externalDictTypeSpec, maxArrayRank); + encoder.OpCode (ILOpCode.Stelem_ref); + } + } + + static void EmitArrayMapsByRank (PEAssemblyBuilder pe, InstructionEncoder encoder, + AssemblyReferenceHandle assemblyRef, + MemberReferenceHandle getExternalMemberRef, TypeSpecificationHandle externalDictTypeSpec, int maxArrayRank) + { + encoder.LoadConstantI4 (maxArrayRank); + encoder.OpCode (ILOpCode.Newarr); + encoder.Token (externalDictTypeSpec); + for (int r = 0; r < maxArrayRank; r++) { + var rankRef = pe.Metadata.AddTypeReference (assemblyRef, default, + pe.Metadata.GetOrAddString ($"__ArrayMapRank{r + 1}")); + var rankSpec = MakeGenericMethodSpec (pe, getExternalMemberRef, rankRef); + encoder.OpCode (ILOpCode.Dup); + encoder.LoadConstantI4 (r); + encoder.OpCode (ILOpCode.Call); + encoder.Token (rankSpec); + encoder.OpCode (ILOpCode.Stelem_ref); + } + } + /// /// Creates a MethodSpec for a generic method instantiation with a specific type argument. /// @@ -349,48 +475,24 @@ static MemberReferenceHandle AddTypeMappingMethodRef (PEAssemblyBuilder pe, Type } /// - /// Creates a MemberRef for TrimmableTypeMap.Initialize(IReadOnlyDictionary<string, Type>, IReadOnlyDictionary<Type, Type>). - /// - static MemberReferenceHandle AddInitializeSingleRef (PEAssemblyBuilder pe, TypeReferenceHandle trimmableTypeMapRef, - TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef) - { - var blob = new BlobBuilder (64); - blob.WriteByte (0x00); // DEFAULT (static) - blob.WriteCompressedInteger (2); // parameter count - blob.WriteByte (0x01); // return type: void - EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); - EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); - return pe.Metadata.AddMemberReference (trimmableTypeMapRef, - pe.Metadata.GetOrAddString ("Initialize"), pe.Metadata.GetOrAddBlob (blob)); - } - - /// - /// Creates a MemberRef for TrimmableTypeMap.Initialize(IReadOnlyDictionary<string, Type>[], IReadOnlyDictionary<Type, Type>[]). + /// Creates a TypeSpec for a closed IReadOnlyDictionary<K, V> generic type (for newarr). /// - static MemberReferenceHandle AddInitializeAggregateRef (PEAssemblyBuilder pe, TypeReferenceHandle trimmableTypeMapRef, - TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef) + static TypeSpecificationHandle MakeIReadOnlyDictTypeSpec (PEAssemblyBuilder pe, + TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef, bool keyIsString) { - var blob = new BlobBuilder (64); - blob.WriteByte (0x00); // DEFAULT (static) - blob.WriteCompressedInteger (2); // parameter count - blob.WriteByte (0x01); // return type: void - // Param 1: IReadOnlyDictionary[] - blob.WriteByte (0x1D); // SZARRAY - EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: true); - // Param 2: IReadOnlyDictionary[] - blob.WriteByte (0x1D); // SZARRAY - EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString: false); - return pe.Metadata.AddMemberReference (trimmableTypeMapRef, - pe.Metadata.GetOrAddString ("Initialize"), pe.Metadata.GetOrAddBlob (blob)); + var blob = new BlobBuilder (32); + EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString); + return pe.Metadata.AddTypeSpecification (pe.Metadata.GetOrAddBlob (blob)); } /// - /// Creates a TypeSpec for a closed IReadOnlyDictionary<K, V> generic type (for newarr). + /// Creates a TypeSpec for IReadOnlyDictionary<K, V>[] (for jagged-array newarr). /// - static TypeSpecificationHandle MakeIReadOnlyDictTypeSpec (PEAssemblyBuilder pe, + static TypeSpecificationHandle MakeIReadOnlyDictArrayTypeSpec (PEAssemblyBuilder pe, TypeReferenceHandle iReadOnlyDictOpenRef, TypeReferenceHandle systemTypeRef, bool keyIsString) { var blob = new BlobBuilder (32); + blob.WriteByte (0x1D); EncodeIReadOnlyDictType (blob, iReadOnlyDictOpenRef, systemTypeRef, keyIsString); return pe.Metadata.AddTypeSpecification (pe.Metadata.GetOrAddBlob (blob)); } diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyEmitter.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyEmitter.cs index ccf1ac857a4..4e74b6e3e54 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyEmitter.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyEmitter.cs @@ -129,6 +129,16 @@ sealed class TypeMapAssemblyEmitter EntityHandle _anchorTypeHandle; + // Per-rank array sentinel TypeDefs, 0-indexed by (rank - 1). Empty when array entries + // aren't emitted. + EntityHandle [] _rankAnchorHandles = []; + + // Per-anchor TypeMap(string, Type, Type) ctor refs, lazily built. + readonly Dictionary _typeMapAttr3ArgCtorRefByAnchor = new (); + + // Cached open TypeMapAttribute`1 ref shared across closed TypeSpecs. + TypeReferenceHandle _typeMapAttrOpenRef; + /// /// Creates a new emitter. /// @@ -178,6 +188,7 @@ void EmitCore (TypeMapAssemblyData model, bool useSharedTypemapUniverse) } else { EmitAnchorType (); } + EmitRankSentinels (model); EmitMemberReferences (); // Track wrapper method names → handles for RegisterNatives @@ -280,6 +291,31 @@ void EmitAnchorType () MetadataTokens.MethodDefinitionHandle (metadata.GetRowCount (TableIndex.MethodDef) + 1)); } + /// + /// Emits private __ArrayMapRank{N} classes used as group type parameters + /// for array TypeMap<T> entries. Each per-assembly typemap owns its + /// rank anchors so array maps stay scoped to the generated assembly. + /// + void EmitRankSentinels (TypeMapAssemblyData model) + { + if (model.MaxArrayRank <= 0) { + return; + } + + _rankAnchorHandles = new EntityHandle [model.MaxArrayRank]; + var objectRef = _pe.Metadata.AddTypeReference (_pe.SystemRuntimeRef, + _pe.Metadata.GetOrAddString ("System"), _pe.Metadata.GetOrAddString ("Object")); + for (int i = 0; i < model.MaxArrayRank; i++) { + _rankAnchorHandles [i] = _pe.Metadata.AddTypeDefinition ( + TypeAttributes.NotPublic | TypeAttributes.Sealed | TypeAttributes.Class, + default, + _pe.Metadata.GetOrAddString ($"__ArrayMapRank{i + 1}"), + objectRef, + MetadataTokens.FieldDefinitionHandle (_pe.Metadata.GetRowCount (TableIndex.Field) + 1), + MetadataTokens.MethodDefinitionHandle (_pe.Metadata.GetRowCount (TableIndex.MethodDef) + 1)); + } + } + void EmitMemberReferences () { _getTypeFromHandleRef = _pe.AddMemberRef (_systemTypeRef, "GetTypeFromHandle", @@ -410,13 +446,15 @@ void EmitMemberReferences () void EmitTypeMapAttributeCtorRef () { var metadata = _pe.Metadata; - var typeMapAttrOpenRef = metadata.AddTypeReference (_pe.SystemRuntimeInteropServicesRef, + _typeMapAttrOpenRef = metadata.AddTypeReference (_pe.SystemRuntimeInteropServicesRef, metadata.GetOrAddString ("System.Runtime.InteropServices"), metadata.GetOrAddString ("TypeMapAttribute`1")); - var closedAttrTypeSpec = _pe.MakeGenericTypeSpec (typeMapAttrOpenRef, _anchorTypeHandle); + var closedAttrTypeSpec = _pe.MakeGenericTypeSpec (_typeMapAttrOpenRef, _anchorTypeHandle); - // 2-arg: TypeMap(string jniName, Type proxyType) — unconditional + // 2-arg: TypeMap(string jniName, Type proxyType) — unconditional. Default anchor only; + // rank-anchored entries are always conditional (3-arg) so no per-rank 2-arg ctor is + // needed today. _typeMapAttrCtorRef2Arg = _pe.AddMemberRef (closedAttrTypeSpec, ".ctor", sig => sig.MethodSignature (isInstanceMethod: true).Parameters (2, rt => rt.Void (), @@ -425,8 +463,27 @@ void EmitTypeMapAttributeCtorRef () p.AddParameter ().Type ().Type (_systemTypeRef, false); })); - // 3-arg: TypeMap(string jniName, Type proxyType, Type targetType) — trimmable - _typeMapAttrCtorRef3Arg = _pe.AddMemberRef (closedAttrTypeSpec, ".ctor", + // 3-arg: TypeMap(string jniName, Type proxyType, Type targetType) — trimmable. + // Cache by anchor so rank-anchored entries can build their own closed ctor on demand. + _typeMapAttrCtorRef3Arg = AddTypeMapAttr3ArgCtorRef (_anchorTypeHandle); + _typeMapAttr3ArgCtorRefByAnchor [_anchorTypeHandle] = _typeMapAttrCtorRef3Arg; + } + + /// Cached 3-arg TypeMap<TGroup> ctor ref for the given anchor, built on first use. + MemberReferenceHandle GetOrAddTypeMapAttr3ArgCtorRef (EntityHandle anchor) + { + if (_typeMapAttr3ArgCtorRefByAnchor.TryGetValue (anchor, out var cached)) { + return cached; + } + var ctorRef = AddTypeMapAttr3ArgCtorRef (anchor); + _typeMapAttr3ArgCtorRefByAnchor [anchor] = ctorRef; + return ctorRef; + } + + MemberReferenceHandle AddTypeMapAttr3ArgCtorRef (EntityHandle anchor) + { + var closedAttrTypeSpec = _pe.MakeGenericTypeSpec (_typeMapAttrOpenRef, anchor); + return _pe.AddMemberRef (closedAttrTypeSpec, ".ctor", sig => sig.MethodSignature (isInstanceMethod: true).Parameters (3, rt => rt.Void (), p => { @@ -976,16 +1033,20 @@ MethodDefinitionHandle EmitUcoConstructor (UcoConstructorData uco, JavaPeerProxy JniSignatureHelper.EncodeClrType (p.AddParameter ().Type (), jniParams [j]); }); - // Open generic types can't be activated — emit a no-op UCO. + // Open generic types can't be activated because Java construction cannot provide the type arguments. if (proxy.IsGenericDefinition) { - var noopHandle = _pe.EmitBody (uco.WrapperName, + var openGenericHandle = _pe.EmitBody (uco.WrapperName, MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.HideBySig, encodeSig, - encoder => { - encoder.OpCode (ILOpCode.Ret); - }); - AddUnmanagedCallersOnlyAttribute (noopHandle); - return noopHandle; + (encoder, cfb) => EmitUcoConstructorBodyWithMarshal (encoder, cfb, enc => { + enc.LoadString (_pe.Metadata.GetOrAddUserString ("Constructing instances of generic types from Java is not supported, as the type parameters cannot be determined.")); + enc.OpCode (ILOpCode.Newobj); + enc.Token (_notSupportedExceptionCtorRef); + enc.OpCode (ILOpCode.Throw); + }), + EncodeUcoConstructorLocals_Standard); + AddUnmanagedCallersOnlyAttribute (openGenericHandle); + return openGenericHandle; } MethodDefinitionHandle handle; @@ -1304,7 +1365,23 @@ void AddUnmanagedCallersOnlyAttribute (MethodDefinitionHandle handle) void EmitTypeMapAttribute (TypeMapAttributeData entry) { - var ctorRef = entry.IsUnconditional ? _typeMapAttrCtorRef2Arg : _typeMapAttrCtorRef3Arg; + MemberReferenceHandle ctorRef; + if (entry.AnchorRank is int rank) { + if (entry.IsUnconditional) { + throw new InvalidOperationException ( + $"Rank-anchored TypeMap entries must be conditional (3-arg). Entry '{entry.JniName}' rank={rank}."); + } + int anchorIndex = rank - 1; + if ((uint)anchorIndex >= (uint)_rankAnchorHandles.Length) { + throw new InvalidOperationException ( + $"No rank-{rank} anchor available for entry '{entry.JniName}'. " + + $"Ensure TypeMapAssemblyData.MaxArrayRank was >= {rank} before emit."); + } + ctorRef = GetOrAddTypeMapAttr3ArgCtorRef (_rankAnchorHandles [anchorIndex]); + } else { + ctorRef = entry.IsUnconditional ? _typeMapAttrCtorRef2Arg : _typeMapAttrCtorRef3Arg; + } + var blob = _pe.BuildAttributeBlob (b => { b.WriteSerializedString (entry.JniName); b.WriteSerializedString (entry.ProxyTypeReference); diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyGenerator.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyGenerator.cs index 939689a43a5..48ca89f45bc 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyGenerator.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/TypeMapAssemblyGenerator.cs @@ -27,9 +27,10 @@ public TypeMapAssemblyGenerator (Version systemRuntimeVersion) /// /// When true, uses Java.Lang.Object as the shared anchor type. When false, emits a per-assembly anchor. /// - public void Generate (IReadOnlyList peers, Stream stream, string assemblyName, bool useSharedTypemapUniverse = false) + /// Max rank for per-rank array TypeMap entries. 0 disables. + public void Generate (IReadOnlyList peers, Stream stream, string assemblyName, bool useSharedTypemapUniverse = false, int maxArrayRank = 0) { - var model = ModelBuilder.Build (peers, assemblyName + ".dll", assemblyName); + var model = ModelBuilder.Build (peers, assemblyName + ".dll", assemblyName, maxArrayRank); var emitter = new TypeMapAssemblyEmitter (_systemRuntimeVersion); emitter.Emit (model, stream, useSharedTypemapUniverse); } diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj index 249bdc8def1..99399656317 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj @@ -5,6 +5,7 @@ $(TargetFrameworkNETStandard) enable Nullable + true Microsoft.Android.Sdk.TrimmableTypeMap true ..\..\product.snk @@ -18,6 +19,8 @@ + + diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaPeerScanner.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaPeerScanner.cs index dda7460271c..4dce0cb466e 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaPeerScanner.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaPeerScanner.cs @@ -6,6 +6,7 @@ using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; using System.Reflection.PortableExecutable; +using Java.Interop.Tools.JavaCallableWrappers; namespace Microsoft.Android.Sdk.TrimmableTypeMap; /// @@ -16,8 +17,19 @@ namespace Microsoft.Android.Sdk.TrimmableTypeMap; /// public sealed class JavaPeerScanner : IDisposable { + enum HashedPackageNamingPolicy { + Crc64, + LowercaseCrc64, + } + readonly Dictionary assemblyCache = new (StringComparer.Ordinal); readonly Dictionary<(string typeName, string assemblyName), ActivationCtorInfo> activationCtorCache = new (); + readonly HashedPackageNamingPolicy packageNamingPolicy; + + public JavaPeerScanner (string? packageNamingPolicy = null) + { + this.packageNamingPolicy = ParsePackageNamingPolicy (packageNamingPolicy); + } /// /// Resolves a type name + assembly name to a TypeDefinitionHandle + AssemblyIndex. @@ -936,7 +948,7 @@ static string GetJavaAccess (MethodAttributes access) return registerJniName; } - // Fall back to already-scanned results (component-attributed or CRC64-computed peers) + // Fall back to already-scanned results (component-attributed or hashed-package peers) if (results.TryGetValue ((baseTypeName, baseIndex.AssemblyName), out var basePeer)) { return basePeer.JavaName; } @@ -1377,12 +1389,12 @@ bool ExtendsJavaPeer (TypeDefinition typeDef, AssemblyIndex index) /// /// Compute both JNI name and compat JNI name for a type without [Register] or component Name. - /// JNI name uses CRC64 hash of "namespace:assemblyName" for the package. + /// JNI name uses the selected package naming policy hash for "namespace:assemblyName". /// Compat JNI name uses the raw managed namespace (lowercased). /// If a declaring type has [Register], its JNI name is used as prefix for both. /// Generic backticks are replaced with _. /// - static (string jniName, string compatJniName) ComputeAutoJniNames (TypeDefinition typeDef, AssemblyIndex index) + (string jniName, string compatJniName) ComputeAutoJniNames (TypeDefinition typeDef, AssemblyIndex index) { var (typeName, parentJniName, ns) = ComputeTypeNameParts (typeDef, index); @@ -1391,7 +1403,7 @@ bool ExtendsJavaPeer (TypeDefinition typeDef, AssemblyIndex index) return (name, name); } - var packageName = GetCrc64PackageName (ns, index.AssemblyName); + var packageName = GetHashedPackageName (ns, index.AssemblyName); var jniName = $"{packageName}/{typeName}"; string compatName = ns.Length == 0 @@ -1406,7 +1418,7 @@ bool ExtendsJavaPeer (TypeDefinition typeDef, AssemblyIndex index) /// registered JNI name or the outermost namespace. /// Matches JavaNativeTypeManager.ToJniName behavior: walks up declaring types /// and if a parent has [Register] or a component attribute JNI name, uses that - /// as prefix instead of computing CRC64 from the namespace. + /// as prefix instead of computing hashed package names from the namespace. /// static (string typeName, string? parentJniName, string ns) ComputeTypeNameParts (TypeDefinition typeDef, AssemblyIndex index) { @@ -1511,16 +1523,26 @@ static void ParseConnectorDeclaringType (string? connector, out string declaring declaringAssemblyName = nextComma >= 0 ? rest.Substring (0, nextComma).Trim () : rest.Trim (); } - static string GetCrc64PackageName (string ns, string assemblyName) + string GetHashedPackageName (string ns, string assemblyName) { // Only Mono.Android preserves the namespace directly if (assemblyName == "Mono.Android") { return ns.ToLowerInvariant ().Replace ('.', '/'); } - var data = System.Text.Encoding.UTF8.GetBytes ($"{ns}:{assemblyName}"); - var hash = System.IO.Hashing.Crc64.Hash (data); - return $"crc64{BitConverter.ToString (hash).Replace ("-", "").ToLowerInvariant ()}"; + return packageNamingPolicy switch { + HashedPackageNamingPolicy.LowercaseCrc64 => "crc64" + ScannerHashingHelper.ToLegacyCrc64 (ns, assemblyName), + HashedPackageNamingPolicy.Crc64 => "crc64" + ScannerHashingHelper.ToCrc64 (ns, assemblyName), + _ => throw new InvalidOperationException ($"Unsupported package naming policy: {packageNamingPolicy}"), + }; + } + + static HashedPackageNamingPolicy ParsePackageNamingPolicy (string? packageNamingPolicy) + { + if (string.Equals (packageNamingPolicy, "LowercaseCrc64", StringComparison.OrdinalIgnoreCase)) { + return HashedPackageNamingPolicy.LowercaseCrc64; + } + return HashedPackageNamingPolicy.Crc64; } static string ExtractNamespace (string fullName) diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/ScannerHashingHelper.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/ScannerHashingHelper.cs new file mode 100644 index 00000000000..f10b66387db --- /dev/null +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/ScannerHashingHelper.cs @@ -0,0 +1,112 @@ +using System; +using System.Buffers; +using Java.Interop.Tools.JavaCallableWrappers; + +namespace Microsoft.Android.Sdk.TrimmableTypeMap; + +internal static class ScannerHashingHelper +{ + internal static string ToLegacyCrc64 (string ns, string assemblyName) + { + int byteCount = GetNamespaceAssemblyUtf8ByteCount (ns, assemblyName); + byte[] rented = ArrayPool.Shared.Rent (byteCount); + try { + int bytesWritten = GetNamespaceAssemblyUtf8Bytes (ns, assemblyName, rented.AsSpan (0, byteCount)); + ulong crc = ulong.MaxValue; + ulong length = 0; + Crc64Helper.HashCore (rented, 0, bytesWritten, ref crc, ref length); + Span hash = stackalloc byte [8]; + WriteUInt64LittleEndian (hash, crc ^ length); + return ToHexString (hash, lowercase: true); + } finally { + ArrayPool.Shared.Return (rented); + } + } + + internal static string ToCrc64 (string ns, string assemblyName) + { + const int stackallocThresholdBytes = 256; + int byteCount = GetNamespaceAssemblyUtf8ByteCount (ns, assemblyName); + Span utf8Buffer = byteCount <= stackallocThresholdBytes + ? stackalloc byte [stackallocThresholdBytes] + : new byte [byteCount]; + + int bytesWritten = GetNamespaceAssemblyUtf8Bytes (ns, assemblyName, utf8Buffer.Slice (0, byteCount)); + Span hash = stackalloc byte [8]; + System.IO.Hashing.Crc64.Hash (utf8Buffer.Slice (0, bytesWritten), hash); + ulong hashValue = ReadUInt64LittleEndian (hash); + WriteUInt64LittleEndian (hash, hashValue ^ (ulong) bytesWritten); + return ToHexString (hash, lowercase: true); + } + + static int GetNamespaceAssemblyUtf8ByteCount (string ns, string assemblyName) + { + return System.Text.Encoding.UTF8.GetByteCount (ns) + 1 + System.Text.Encoding.UTF8.GetByteCount (assemblyName); + } + + static unsafe int GetNamespaceAssemblyUtf8Bytes (string ns, string assemblyName, Span destination) + { + int bytesWritten = 0; + fixed (char* nsPtr = ns) + fixed (byte* destinationPtr = destination) { + bytesWritten += System.Text.Encoding.UTF8.GetBytes (nsPtr, ns.Length, destinationPtr, destination.Length); + } + + destination [bytesWritten++] = (byte) ':'; + + fixed (char* assemblyNamePtr = assemblyName) + fixed (byte* destinationPtr = destination) { + bytesWritten += System.Text.Encoding.UTF8.GetBytes (assemblyNamePtr, assemblyName.Length, destinationPtr + bytesWritten, destination.Length - bytesWritten); + } + + return bytesWritten; + } + + static string ToHexString (ReadOnlySpan hash, bool lowercase) + { + const int maxStackCharLength = 128; + int charLength = hash.Length * 2; + Span chars = charLength <= maxStackCharLength + ? stackalloc char [charLength] + : new char [charLength]; + + for (int i = 0, j = 0; i < hash.Length; i += 1, j += 2) { + byte b = hash [i]; + chars [j] = GetHexValue (b / 16, lowercase); + chars [j + 1] = GetHexValue (b % 16, lowercase); + } + + return ((ReadOnlySpan) chars).ToString (); + } + + static void WriteUInt64LittleEndian (Span destination, ulong value) + { + destination [0] = (byte) value; + destination [1] = (byte) (value >> 8); + destination [2] = (byte) (value >> 16); + destination [3] = (byte) (value >> 24); + destination [4] = (byte) (value >> 32); + destination [5] = (byte) (value >> 40); + destination [6] = (byte) (value >> 48); + destination [7] = (byte) (value >> 56); + } + + static ulong ReadUInt64LittleEndian (ReadOnlySpan source) + { + return (ulong) source [0] + | ((ulong) source [1] << 8) + | ((ulong) source [2] << 16) + | ((ulong) source [3] << 24) + | ((ulong) source [4] << 32) + | ((ulong) source [5] << 40) + | ((ulong) source [6] << 48) + | ((ulong) source [7] << 56); + } + + static char GetHexValue (int value, bool lowercase) + { + return (char) (value < 10 + ? value + '0' + : value - 10 + (lowercase ? 'a' : 'A')); + } +} diff --git a/src/Microsoft.Android.Sdk.TrimmableTypeMap/TrimmableTypeMapGenerator.cs b/src/Microsoft.Android.Sdk.TrimmableTypeMap/TrimmableTypeMapGenerator.cs index 07d689854bb..4851fde0857 100644 --- a/src/Microsoft.Android.Sdk.TrimmableTypeMap/TrimmableTypeMapGenerator.cs +++ b/src/Microsoft.Android.Sdk.TrimmableTypeMap/TrimmableTypeMapGenerator.cs @@ -32,13 +32,18 @@ public TrimmableTypeMapResult Execute ( HashSet frameworkAssemblyNames, bool useSharedTypemapUniverse = false, ManifestConfig? manifestConfig = null, - XDocument? manifestTemplate = null) + XDocument? manifestTemplate = null, + string? packageNamingPolicy = null, + int maxArrayRank = 0) { _ = assemblies ?? throw new ArgumentNullException (nameof (assemblies)); _ = systemRuntimeVersion ?? throw new ArgumentNullException (nameof (systemRuntimeVersion)); _ = frameworkAssemblyNames ?? throw new ArgumentNullException (nameof (frameworkAssemblyNames)); + if (maxArrayRank < 0) { + throw new ArgumentOutOfRangeException (nameof (maxArrayRank), maxArrayRank, "Must be >= 0."); + } - var (allPeers, assemblyManifestInfo) = ScanAssemblies (assemblies); + var (allPeers, assemblyManifestInfo) = ScanAssemblies (assemblies, packageNamingPolicy); if (allPeers.Count == 0) { logger.LogNoJavaPeerTypesFound (); return new TrimmableTypeMapResult ([], [], allPeers); @@ -48,7 +53,7 @@ public TrimmableTypeMapResult Execute ( PropagateDeferredRegistrationToBaseClasses (allPeers); PropagateCannotRegisterToDescendants (allPeers); - var generatedAssemblies = GenerateTypeMapAssemblies (allPeers, systemRuntimeVersion, useSharedTypemapUniverse); + var generatedAssemblies = GenerateTypeMapAssemblies (allPeers, systemRuntimeVersion, useSharedTypemapUniverse, maxArrayRank); var jcwPeers = allPeers.Where (p => !frameworkAssemblyNames.Contains (p.AssemblyName) || p.JavaName.StartsWith ("mono/", StringComparison.Ordinal)).ToList (); @@ -130,16 +135,16 @@ GeneratedManifest GenerateManifest (List allPeers, AssemblyManifes return new GeneratedManifest (doc, providerNames.Count > 0 ? providerNames.ToArray () : []); } - (List peers, AssemblyManifestInfo manifestInfo) ScanAssemblies (IReadOnlyList<(string Name, PEReader Reader)> assemblies) + (List peers, AssemblyManifestInfo manifestInfo) ScanAssemblies (IReadOnlyList<(string Name, PEReader Reader)> assemblies, string? packageNamingPolicy) { - using var scanner = new JavaPeerScanner (); + using var scanner = new JavaPeerScanner (packageNamingPolicy); var peers = scanner.Scan (assemblies); var manifestInfo = scanner.ScanAssemblyManifestInfo (); logger.LogJavaPeerScanInfo (assemblies.Count, peers.Count); return (peers, manifestInfo); } - List GenerateTypeMapAssemblies (List allPeers, Version systemRuntimeVersion, bool useSharedTypemapUniverse) + List GenerateTypeMapAssemblies (List allPeers, Version systemRuntimeVersion, bool useSharedTypemapUniverse, int maxArrayRank) { List<(string AssemblyName, List Peers)> peersByAssembly; @@ -168,14 +173,14 @@ List GenerateTypeMapAssemblies (List allPeers, string typeMapAssemblyName = $"_{assemblyName}.TypeMap"; perAssemblyNames.Add (typeMapAssemblyName); var stream = new MemoryStream (); - generator.Generate (peers, stream, typeMapAssemblyName, useSharedTypemapUniverse); + generator.Generate (peers, stream, typeMapAssemblyName, useSharedTypemapUniverse, maxArrayRank); stream.Position = 0; generatedAssemblies.Add (new GeneratedAssembly (typeMapAssemblyName, stream)); logger.LogGeneratedTypeMapAssemblyInfo (typeMapAssemblyName, peers.Count); } var rootStream = new MemoryStream (); var rootGenerator = new RootTypeMapAssemblyGenerator (systemRuntimeVersion); - rootGenerator.Generate (perAssemblyNames, useSharedTypemapUniverse, rootStream); + rootGenerator.Generate (perAssemblyNames, useSharedTypemapUniverse, rootStream, maxArrayRank: maxArrayRank); rootStream.Position = 0; generatedAssemblies.Add (new GeneratedAssembly ("_Microsoft.Android.TypeMaps", rootStream)); logger.LogGeneratedRootTypeMapInfo (perAssemblyNames.Count); diff --git a/src/Mono.Android/Android.Runtime/JNIEnv.cs b/src/Mono.Android/Android.Runtime/JNIEnv.cs index 8104ee308a2..20b635cfb70 100644 --- a/src/Mono.Android/Android.Runtime/JNIEnv.cs +++ b/src/Mono.Android/Android.Runtime/JNIEnv.cs @@ -27,16 +27,43 @@ public static partial class JNIEnv { static Array ArrayCreateInstance (Type elementType, int length) { if (RuntimeFeature.TrimmableTypeMap) { - var factory = TrimmableTypeMap.Instance?.GetContainerFactory (elementType); - if (factory is not null) - return factory.CreateArray (length, 1); + if (System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported) { + // CoreCLR runtime type loader can construct any T[] dynamically. + // IsDynamicCodeSupported is a [FeatureGuard] so this branch is + // dead-coded under PublishAot. + return Array.CreateInstance (elementType, length); + } + + // NativeAOT: resolve via per-rank typemap + Array.CreateInstanceFromArrayType. + if (TrimmableTypeMap.Instance.TryGetArrayType (elementType, out var arrayType)) { + return Array.CreateInstanceFromArrayType (arrayType, length); + } + + throw new NotSupportedException ( + $"No TrimmableTypeMap array entry for element type '{elementType}'. " + + $"Array lookups use the element type within the per-rank __ArrayMapRank{GetArrayRank (elementType)} typemap group; " + + $"ensure the mapping is emitted for that rank (for example by increasing _AndroidTrimmableTypeMapMaxArrayRank) or report an issue."); } - #pragma warning disable IL3050 // Array.CreateInstance is not AOT-safe, but this is the legacy fallback path + #pragma warning disable IL3050 // legacy fallback path return Array.CreateInstance (elementType, length); #pragma warning restore IL3050 } + static int GetArrayRank (Type elementType) + { + int rank = 1; + while (elementType.IsSZArray) { + rank++; + var nestedElementType = elementType.GetElementType (); + if (nestedElementType is null) { + break; + } + elementType = nestedElementType; + } + return rank; + } + static Type MakeArrayType (Type type) => // FIXME: https://github.com/xamarin/xamarin-android/issues/8724 // IL3050 disabled in source: if someone uses NativeAOT, they will get the warning. diff --git a/src/Mono.Android/Java.Interop/JavaPeerContainerFactory.cs b/src/Mono.Android/Java.Interop/JavaPeerContainerFactory.cs index 0f569b918bb..04995ea206c 100644 --- a/src/Mono.Android/Java.Interop/JavaPeerContainerFactory.cs +++ b/src/Mono.Android/Java.Interop/JavaPeerContainerFactory.cs @@ -10,16 +10,11 @@ namespace Java.Interop { /// - /// AOT-safe factory for creating typed containers (arrays, lists, collections, dictionaries) - /// without using MakeGenericType() or Array.CreateInstance(). + /// AOT-safe factory for creating typed containers (lists, collections, dictionaries). + /// Array creation lives in JNIEnv.ArrayCreateInstance. /// public abstract class JavaPeerContainerFactory { - /// - /// Creates a typed jagged array. Rank 1 = T[], rank 2 = T[][], etc. - /// - internal abstract Array CreateArray (int length, int rank); - /// /// Creates a typed JavaList<T> from a JNI handle. /// @@ -71,31 +66,6 @@ public sealed class JavaPeerContainerFactory< JavaPeerContainerFactory () { } - // TODO (https://github.com/dotnet/android/issues/10794): This might cause unnecessary code bloat for NativeAOT. Revisit - // how we use this API and instead use a differnet approach that uses AOT-safe `Array.CreateInstanceFromArrayType` - // with statically provided array types based on a statically known array type. - internal override Array CreateArray (int length, int rank) => rank switch { - 1 => new T [length], - 2 => new T [length][], - 3 => new T [length][][], - _ when rank >= 0 => CreateHigherRankArray (length, rank), - _ => throw new ArgumentOutOfRangeException (nameof (rank), rank, "Rank must be non-negative."), - }; - - static Array CreateHigherRankArray (int length, int rank) - { - if (!RuntimeFeature.IsDynamicCodeSupported) { - throw new NotSupportedException ($"Cannot create array of rank {rank} because dynamic code is not supported."); - } - - var arrayType = typeof (T); - for (int i = 0; i < rank; i++) { - arrayType = arrayType.MakeArrayType (); - } - - return Array.CreateInstanceFromArrayType (arrayType, length); - } - internal override IList CreateList (IntPtr handle, JniHandleOwnership transfer) => new Android.Runtime.JavaList (handle, transfer); diff --git a/src/Mono.Android/Microsoft.Android.Runtime/AggregateTypeMap.cs b/src/Mono.Android/Microsoft.Android.Runtime/AggregateTypeMap.cs index 3a997d0bca6..0374570f12a 100644 --- a/src/Mono.Android/Microsoft.Android.Runtime/AggregateTypeMap.cs +++ b/src/Mono.Android/Microsoft.Android.Runtime/AggregateTypeMap.cs @@ -11,7 +11,7 @@ namespace Microsoft.Android.Runtime; /// results across all universes. Debug-only — each assembly has its own /// universe with an isolated TypeMapLazyDictionary. /// -sealed class AggregateTypeMap : ITypeMapWithAliasing +sealed class AggregateTypeMap : ITypeMap { readonly SingleUniverseTypeMap[] _universes; @@ -41,4 +41,16 @@ public bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? pr proxyType = null; return false; } + + public bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType) + { + foreach (var universe in _universes) { + if (universe.TryGetArrayType (jniName, rankIndex, out arrayType)) { + return true; + } + } + + arrayType = null; + return false; + } } diff --git a/src/Mono.Android/Microsoft.Android.Runtime/ITypeMapWithAliasing.cs b/src/Mono.Android/Microsoft.Android.Runtime/ITypeMap.cs similarity index 66% rename from src/Mono.Android/Microsoft.Android.Runtime/ITypeMapWithAliasing.cs rename to src/Mono.Android/Microsoft.Android.Runtime/ITypeMap.cs index df77c07041d..8aa230d273f 100644 --- a/src/Mono.Android/Microsoft.Android.Runtime/ITypeMapWithAliasing.cs +++ b/src/Mono.Android/Microsoft.Android.Runtime/ITypeMap.cs @@ -7,12 +7,12 @@ namespace Microsoft.Android.Runtime; /// -/// Abstraction over the typemap dictionary that handles alias resolution. +/// Abstraction over a generated typemap universe. /// Both Debug (per-assembly universes) and Release (single merged universe) -/// go through this interface, so doesn't -/// need to know about aliasing mechanics. +/// go through this interface, so doesn't need +/// to know about aliasing mechanics or per-rank array map storage. /// -interface ITypeMapWithAliasing +interface ITypeMap { /// /// Returns all proxy types mapped to a JNI name, resolving alias holders. @@ -24,4 +24,9 @@ interface ITypeMapWithAliasing /// carries the attribute). /// bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? proxyType); + + /// + /// Resolves a JNI leaf name and 0-based array rank index to a managed array type. + /// + bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType); } diff --git a/src/Mono.Android/Microsoft.Android.Runtime/JavaMarshalValueManager.cs b/src/Mono.Android/Microsoft.Android.Runtime/JavaMarshalValueManager.cs index b4791cfdde0..210f6f343a0 100644 --- a/src/Mono.Android/Microsoft.Android.Runtime/JavaMarshalValueManager.cs +++ b/src/Mono.Android/Microsoft.Android.Runtime/JavaMarshalValueManager.cs @@ -514,7 +514,9 @@ void ProcessContext (HandleContext* context) if (RuntimeFeature.TrimmableTypeMap) { try { - // Map universal request types to concrete peers before proxy lookup. + // Mirror legacy GetPeerType: callers commonly request universal + // interfaces / boxes (IJavaPeerable, object, Exception) — map these + // to a concrete peer type so the proxy lookup can succeed. var resolvedTargetType = ResolvePeerType (targetType); var typeMap = TrimmableTypeMap.Instance; @@ -536,7 +538,16 @@ void ProcessContext (HandleContext* context) return peer; } - // Preserve CreatePeer's bad-cast vs missing-mapping behavior. + // Disambiguate the failure — match the contract of the base + // JniRuntime.JniValueManager.CreatePeer so JavaCast / JavaAs + // surface the right exception (or null) to callers: + // + // (a) target type has no Java mapping at all → ArgumentException + // (b) Java instance is not assignable to the target's Java class + // → return null (JavaAs returns null; JavaCast wraps to + // InvalidCastException via its `??` clause) + // (c) classes are compatible but no proxy / activation failed + // → NotSupportedException (genuine generator gap) if (resolvedTargetType is not null && IsIncompatibleCast (typeMap, ref reference, resolvedTargetType)) { return null; diff --git a/src/Mono.Android/Microsoft.Android.Runtime/SingleUniverseTypeMap.cs b/src/Mono.Android/Microsoft.Android.Runtime/SingleUniverseTypeMap.cs index d1094a2a283..a6afdba2bab 100644 --- a/src/Mono.Android/Microsoft.Android.Runtime/SingleUniverseTypeMap.cs +++ b/src/Mono.Android/Microsoft.Android.Runtime/SingleUniverseTypeMap.cs @@ -14,17 +14,35 @@ namespace Microsoft.Android.Runtime; /// alias resolution within that universe. /// Used in both Debug (one per assembly) and Release (single merged). /// -sealed class SingleUniverseTypeMap : ITypeMapWithAliasing +sealed class SingleUniverseTypeMap : ITypeMap { readonly IReadOnlyDictionary _typeMap; readonly IReadOnlyDictionary _proxyTypeMap; + readonly IReadOnlyDictionary?[][] _arrayMapsByUniverseAndRank; public SingleUniverseTypeMap (IReadOnlyDictionary typeMap, IReadOnlyDictionary proxyTypeMap) + : this (typeMap, proxyTypeMap, arrayMapsByRank: null) + { + } + + public SingleUniverseTypeMap ( + IReadOnlyDictionary typeMap, + IReadOnlyDictionary proxyTypeMap, + IReadOnlyDictionary?[]? arrayMapsByRank) + : this (typeMap, proxyTypeMap, arrayMapsByRank is null ? null : [arrayMapsByRank]) + { + } + + public SingleUniverseTypeMap ( + IReadOnlyDictionary typeMap, + IReadOnlyDictionary proxyTypeMap, + IReadOnlyDictionary?[][]? arrayMapsByUniverseAndRank) { ArgumentNullException.ThrowIfNull (typeMap); ArgumentNullException.ThrowIfNull (proxyTypeMap); _typeMap = typeMap; _proxyTypeMap = proxyTypeMap; + _arrayMapsByUniverseAndRank = arrayMapsByUniverseAndRank ?? []; } public IEnumerable GetProxyTypes (string jniName) @@ -83,4 +101,18 @@ public bool TryGetProxyType (Type managedType, [NotNullWhen (true)] out Type? pr proxyType = null; return false; } + + public bool TryGetArrayType (string jniName, int rankIndex, [NotNullWhen (true)] out Type? arrayType) + { + foreach (var arrayMapsByRank in _arrayMapsByUniverseAndRank) { + if ((uint)rankIndex < (uint)arrayMapsByRank.Length && + arrayMapsByRank [rankIndex] is { } dict && + dict.TryGetValue (jniName, out arrayType)) { + return true; + } + } + + arrayType = null; + return false; + } } diff --git a/src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs b/src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs index f18dbfeb39b..58455d8ea79 100644 --- a/src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs +++ b/src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs @@ -13,7 +13,7 @@ namespace Microsoft.Android.Runtime; /// -/// Central type map for the trimmable typemap path. Owns the ITypeMapWithAliasing +/// Central type map for the trimmable typemap path. Owns the ITypeMap /// and provides peer creation, invoker resolution, container factories, and native /// method registration. All proxy attribute access is encapsulated here. /// @@ -28,33 +28,74 @@ public class TrimmableTypeMap s_instance ?? throw new InvalidOperationException ( "TrimmableTypeMap has not been initialized. Ensure RuntimeFeature.TrimmableTypeMap is enabled and the JNI runtime is initialized."); - readonly ITypeMapWithAliasing _typeMap; + readonly ITypeMap _typeMap; readonly ConcurrentDictionary _proxyCache = new (); readonly ConcurrentDictionary _jniProxyCache = new (StringComparer.Ordinal); - TrimmableTypeMap (ITypeMapWithAliasing typeMap) + TrimmableTypeMap (ITypeMap typeMap) { _typeMap = typeMap; } /// - /// Initializes the singleton with a single merged typemap universe. - /// Called from in the generated root assembly - /// (_Microsoft.Android.TypeMaps) when assembly typemaps are merged (Release builds). + /// Initializes the singleton with a single merged typemap universe and optional + /// per-rank array dictionaries (consulted by JNIEnv.ArrayCreateInstance under NativeAOT). /// - public static void Initialize (IReadOnlyDictionary typeMap, IReadOnlyDictionary proxyMap) + public static void Initialize ( + IReadOnlyDictionary typeMap, + IReadOnlyDictionary proxyMap) + { + Initialize (typeMap, proxyMap, arrayMapsByRank: null); + } + + /// + /// Initializes the singleton with a single merged typemap universe and optional + /// per-rank array dictionaries (consulted by JNIEnv.ArrayCreateInstance under NativeAOT). + /// + /// 0-indexed by (rank - 1); null when no array entries were emitted. + public static void Initialize ( + IReadOnlyDictionary typeMap, + IReadOnlyDictionary proxyMap, + IReadOnlyDictionary?[]? arrayMapsByRank) + { + ArgumentNullException.ThrowIfNull (typeMap); + ArgumentNullException.ThrowIfNull (proxyMap); + InitializeCore (new SingleUniverseTypeMap (typeMap, proxyMap, arrayMapsByRank)); + } + + /// + /// Initializes the singleton with a single merged typemap universe and per-assembly array maps. + /// + public static void Initialize ( + IReadOnlyDictionary typeMap, + IReadOnlyDictionary proxyMap, + IReadOnlyDictionary?[][]? arrayMapsByUniverseAndRank) { ArgumentNullException.ThrowIfNull (typeMap); ArgumentNullException.ThrowIfNull (proxyMap); - InitializeCore (new SingleUniverseTypeMap (typeMap, proxyMap)); + InitializeCore (new SingleUniverseTypeMap (typeMap, proxyMap, arrayMapsByUniverseAndRank)); + } + + /// + /// Initializes the singleton with multiple per-assembly typemap universes and optional + /// per-universe array dictionaries. + /// + public static void Initialize ( + IReadOnlyDictionary[] typeMaps, + IReadOnlyDictionary[] proxyMaps) + { + Initialize (typeMaps, proxyMaps, arrayMapsByUniverseAndRank: null); } /// - /// Initializes the singleton with multiple per-assembly typemap universes. - /// Called from in the generated root assembly - /// (_Microsoft.Android.TypeMaps) when each assembly has its own typemap universe (Debug builds). + /// Initializes the singleton with multiple per-assembly typemap universes and optional + /// per-universe array dictionaries. /// - public static void Initialize (IReadOnlyDictionary[] typeMaps, IReadOnlyDictionary[] proxyMaps) + /// Array maps indexed by universe, then by 0-based rank. + public static void Initialize ( + IReadOnlyDictionary[] typeMaps, + IReadOnlyDictionary[] proxyMaps, + IReadOnlyDictionary?[][]? arrayMapsByUniverseAndRank) { ArgumentNullException.ThrowIfNull (typeMaps); ArgumentNullException.ThrowIfNull (proxyMaps); @@ -64,14 +105,18 @@ public static void Initialize (IReadOnlyDictionary[] typeMaps, IRe if (typeMaps.Length != proxyMaps.Length) { throw new ArgumentException ($"typeMaps.Length ({typeMaps.Length}) must equal proxyMaps.Length ({proxyMaps.Length}).", nameof (proxyMaps)); } + if (arrayMapsByUniverseAndRank is not null && arrayMapsByUniverseAndRank.Length != typeMaps.Length) { + throw new ArgumentException ($"arrayMapsByUniverseAndRank.Length ({arrayMapsByUniverseAndRank.Length}) must equal typeMaps.Length ({typeMaps.Length}).", nameof (arrayMapsByUniverseAndRank)); + } + var universes = new SingleUniverseTypeMap [typeMaps.Length]; for (int i = 0; i < typeMaps.Length; i++) { - universes [i] = new SingleUniverseTypeMap (typeMaps [i], proxyMaps [i]); + universes [i] = new SingleUniverseTypeMap (typeMaps [i], proxyMaps [i], arrayMapsByUniverseAndRank? [i]); } InitializeCore (new AggregateTypeMap (universes)); } - static void InitializeCore (ITypeMapWithAliasing typeMap) + static void InitializeCore (ITypeMap typeMap) { lock (s_initLock) { if (s_instance is not null) { @@ -324,6 +369,66 @@ internal static bool TargetTypeMatches (Type targetType, Type proxyTargetType) return GetProxyForManagedType (type)?.GetContainerFactory (); } + /// AOT-safe lookup of the closed managed array type for the given element type. + internal bool TryGetArrayType (Type elementType, [NotNullWhen (true)] out Type? arrayType) + { + arrayType = null; + + // Walk array nesting to the leaf; rankIndex = depth = (rank - 1). + // Reject multi-dim arrays (byte[,]) — JNI only supports szarrays. + var leaf = elementType; + int rankIndex = 0; + while (leaf.IsArray) { + if (!leaf.IsSZArray) { + return false; + } + var next = leaf.GetElementType (); + if (next is null) { + return false; + } + leaf = next; + rankIndex++; + } + + bool isPrimitiveLeaf = leaf.IsPrimitive; + string? leafJniName = isPrimitiveLeaf + ? TryGetPrimitiveJniName (leaf, out var p) ? p : null + : TryGetJniNameForManagedType (leaf, out var jni) ? jni : null; + + if (leafJniName is not null && _typeMap.TryGetArrayType (leafJniName, rankIndex, out arrayType)) { + return true; + } + + if (isPrimitiveLeaf) { + arrayType = MakePrimitiveArrayType (elementType); + return true; + } + + return false; + } + + static Type MakePrimitiveArrayType (Type elementType) + { +#pragma warning disable IL3050 // Primitive array types are runtime intrinsic; no generated generic code is needed. + return elementType.MakeArrayType (); +#pragma warning restore IL3050 + } + + /// JNI single-letter encoding for primitive element types. + static bool TryGetPrimitiveJniName (Type primitive, [NotNullWhen (true)] out string? jni) + { + if (primitive == typeof (bool)) { jni = "Z"; return true; } + if (primitive == typeof (byte)) { jni = "B"; return true; } + if (primitive == typeof (char)) { jni = "C"; return true; } + if (primitive == typeof (short)) { jni = "S"; return true; } + if (primitive == typeof (int)) { jni = "I"; return true; } + if (primitive == typeof (long)) { jni = "J"; return true; } + if (primitive == typeof (float)) { jni = "F"; return true; } + if (primitive == typeof (double)) { jni = "D"; return true; } + jni = null; + return false; + } + [UnmanagedCallersOnly] static void OnRegisterNatives (IntPtr jnienv, IntPtr klass, IntPtr nativeClassHandle) { diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 89bf52ac3b1..ea0c64a2ace 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -361,7 +361,7 @@ - + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index c2b059f3fcf..60133cb930a 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -84,12 +84,6 @@ _ResolveAssemblies MSBuild target. - diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index a6b22f41b7d..6138e7e2e8e 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -10,6 +10,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. + @@ -296,46 +297,77 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. <_AndroidNativeAotSharedLibrary>$(NativeOutputPath)$(NativeBinaryPrefix)$(TargetName).so + + <_NdkApiSysrootDir>$(_NdkSysrootDir)$(_NDKApiLevel)/ + <_NdkClangResourceDir>$(_AndroidNdkDirectory)toolchains/llvm/prebuilt/$(_NdkPrebuiltAbi)/lib/clang + - <_AndroidNativeAotLinkerArgs Include=""$(NativeObject)"" /> - <_AndroidNativeAotLinkerArgs Include="-shared" /> - <_AndroidNativeAotLinkerArgs Include="-fuse-ld=lld" /> - <_AndroidNativeAotLinkerArgs Include="-o "$(_AndroidNativeAotSharedLibrary)"" /> - - <_AndroidNativeAotLinkerArgs Include="-Wl,-e,0x0" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,-z,max-page-size=16384" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,--version-script="$(ExportsFile)"" Condition="'$(ExportsFile)' != ''" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,--export-dynamic" Condition="'$(ExportsFile)' != ''" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,--discard-all" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,--gc-sections" /> - <_AndroidNativeAotLinkerArgs Include="-Wl,-T,"$(NativeIntermediateOutputPath)sections.ld"" /> - <_AndroidNativeAotLinkerArgs Include="@(LinkerArg)" /> + + <_NativeAotCrtStartFiles Include="$(_NdkApiSysrootDir)crtbegin_so.o"> + @(_PrivateBuildTargetAbi) + + + + <_NativeAotCrtEndFiles Include="$(_NdkApiSysrootDir)crtend_so.o"> + @(_PrivateBuildTargetAbi) + + + + <_NativeAotLibSearchPaths Include="$(_NdkApiSysrootDir)" /> + <_NativeAotLibSearchPaths Include="$(_NdkSysrootDir)" /> + + + + <_NativeAotLinkLibraries Include="@(NativeLibrary)" /> + <_NativeAotLinkLibraries Include="@(_NdkLibs)" /> + + + <_NativeAotAdditionalObjects Include="@(_PrivateJniInitFuncsNativeObjectFile)" /> + <_NativeAotAdditionalObjects Include="@(_PrivateEnvironmentNativeObjectFile)" /> + + + <_NativeAotSystemLibraries Include="dl" /> + <_NativeAotSystemLibraries Include="z" /> + <_NativeAotSystemLibraries Include="log" /> + <_NativeAotSystemLibraries Include="m" /> + <_NativeAotSystemLibraries Include="c" /> + + + <_NativeAotCompilerRtLibs Include="$(_NdkClangResourceDir)/**/libclang_rt.builtins-$(_NdkAbi)-android.a" /> + <_NativeAotCompilerRtLibs Include="$(_NdkClangResourceDir)/**/$(_NdkAbi)/libunwind.a" /> - - - - - - - - - - + @@ -345,7 +377,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. PreserveNewest - + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets index 6ff49d6868c..df007eb13cb 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets @@ -12,6 +12,11 @@ <_TypeMapAssemblyName>_Microsoft.Android.TypeMaps + <_TrimmableTypeMapPackageNamingPolicy Condition=" '$(_AndroidPackageNamingPolicySetByUser)' == 'true' ">$(AndroidPackageNamingPolicy) + <_TrimmableTypeMapPackageNamingPolicy Condition=" '$(_TrimmableTypeMapPackageNamingPolicy)' == '' ">Crc64 + + true @@ -20,6 +25,12 @@ <_TypeMapBaseOutputDir>$(_TypeMapBaseOutputDir.Replace('\','/')) <_TypeMapOutputDirectory>$(_TypeMapBaseOutputDir)typemap/ <_TypeMapJavaOutputDirectory>$(_TypeMapBaseOutputDir)typemap/java + + + <_AndroidTrimmableTypeMapMaxArrayRank Condition=" '$(_AndroidTrimmableTypeMapMaxArrayRank)' == '' and '$(PublishAot)' == 'true' ">3 + <_AndroidTrimmableTypeMapMaxArrayRank Condition=" '$(_AndroidTrimmableTypeMapMaxArrayRank)' == '' ">0 @@ -77,6 +88,8 @@ Debug="$(AndroidIncludeDebugSymbols)" NeedsInternet="$(AndroidNeedsInternetPermission)" EmbedAssemblies="$(EmbedAssembliesIntoApk)" + PackageNamingPolicy="$(_TrimmableTypeMapPackageNamingPolicy)" + MaxArrayRank="$(_AndroidTrimmableTypeMapMaxArrayRank)" ManifestPlaceholders="$(AndroidManifestPlaceholders)" CheckedBuild="$(_AndroidCheckedBuild)" ApplicationJavaClass="$(AndroidApplicationJavaClass)" diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 3d8b411c1fb..53fe8f57e0f 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -6,16 +6,16 @@ "packs": [ "Microsoft.Android.Sdk.net11", "Microsoft.Android.Sdk.net10", - "Microsoft.Android.Ref.36.1", - "Microsoft.Android.Runtime.36.1.android", - "Microsoft.Android.Runtime.Mono.36.1.android-arm", - "Microsoft.Android.Runtime.Mono.36.1.android-arm64", - "Microsoft.Android.Runtime.Mono.36.1.android-x86", - "Microsoft.Android.Runtime.Mono.36.1.android-x64", - "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm64", - "Microsoft.Android.Runtime.CoreCLR.36.1.android-x64", - "Microsoft.Android.Runtime.NativeAOT.36.1.android-arm64", - "Microsoft.Android.Runtime.NativeAOT.36.1.android-x64", + "Microsoft.Android.Ref.37", + "Microsoft.Android.Runtime.37.android", + "Microsoft.Android.Runtime.Mono.37.android-arm", + "Microsoft.Android.Runtime.Mono.37.android-arm64", + "Microsoft.Android.Runtime.Mono.37.android-x86", + "Microsoft.Android.Runtime.Mono.37.android-x64", + "Microsoft.Android.Runtime.CoreCLR.37.android-arm64", + "Microsoft.Android.Runtime.CoreCLR.37.android-x64", + "Microsoft.Android.Runtime.NativeAOT.37.android-arm64", + "Microsoft.Android.Runtime.NativeAOT.37.android-x64", "Microsoft.Android.Templates" ], "platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ], @@ -62,43 +62,35 @@ "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Ref.36.1": { + "Microsoft.Android.Runtime.Mono.37.android-arm": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.36.1.android": { + "Microsoft.Android.Runtime.Mono.37.android-arm64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.Mono.36.1.android-arm": { + "Microsoft.Android.Runtime.Mono.37.android-x86": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.Mono.36.1.android-arm64": { + "Microsoft.Android.Runtime.Mono.37.android-x64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.Mono.36.1.android-x86": { + "Microsoft.Android.Runtime.CoreCLR.37.android-arm64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.Mono.36.1.android-x64": { + "Microsoft.Android.Runtime.CoreCLR.37.android-x64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.CoreCLR.36.1.android-arm64": { + "Microsoft.Android.Runtime.NativeAOT.37.android-arm64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, - "Microsoft.Android.Runtime.CoreCLR.36.1.android-x64": { - "kind": "framework", - "version": "@WORKLOAD_VERSION@" - }, - "Microsoft.Android.Runtime.NativeAOT.36.1.android-arm64": { - "kind": "framework", - "version": "@WORKLOAD_VERSION@" - }, - "Microsoft.Android.Runtime.NativeAOT.36.1.android-x64": { + "Microsoft.Android.Runtime.NativeAOT.37.android-x64": { "kind": "framework", "version": "@WORKLOAD_VERSION@" }, diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 34033588a39..ff837114b9d 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -783,16 +783,7 @@ public static string XA1023 { } /// - /// Looks up a localized string similar to Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher.. - /// - public static string XA1024 { - get { - return ResourceManager.GetString("XA1024", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.. + /// Looks up a localized string similar to The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild propertyis not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.. /// public static string XA1025 { get { diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx index 76645d8a1a2..327b9e29efc 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Použití kompilátoru DX DEX není podporováno. Nastavte kompilátor DEX na 'd8' na stránkách vlastností projektu Visual Studio nebo upravte soubor projektu v textovém editoru a nastavte vlastnost Microsoft Build Engine AndroidDexTool na 'd8'. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Ignoruje se konfigurační soubor {0}. Konfigurační soubory .NET se v projektech .NET pro Android, které cílí na .NET 6 nebo vyšší, nepodporují. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - Experimentální hodnota Hybrid pro vlastnost MSBuildu AndroidAotMode není v tuto chvíli kompatibilní s cílovým ABI armeabi-v7a. Pokud chcete i nadále používat experimentální hodnotu Hybrid pro AndroidAotMode, zrušte výběr cílového ABI armeabi-v7a na stránkách vlastností projektu sady Visual Studio, nebo upravte soubor projektu v textovém editoru a odeberte z vlastnosti MSBuild AndroidSupportedAbis možnost armeabi-v7a. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Pokud chcete pro sestavení z příkazového řádku použít vlastní cestu JDK - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + Vlastnost MSBuild {0} není kompatibilní s modulem runtime {1}. Sestavení nemůže pokračovat, pokud je tato vlastnost povolena. Odeberte vlastnost nebo ji ošetřete podmínkou: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx index 7437f5da9dc..a6dece58c59 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Die Verwendung des DX DEX-Compiler wird nicht unterstützt. Legen Sie den DEX-Compiler in den Visual Studio-Projekteigenschaftenseiten auf "d8" fest, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und legen Sie die MSBuild-Eigenschaft "AndroidDexTool" auf "d8" fest. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Die Konfigurationsdatei „{0}“ wird ignoriert. .NET-Konfigurationsdateien werden in .NET für Android-Projekten, die auf .NET 6 oder höher ausgerichtet sind, nicht unterstützt. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - Der experimentelle Wert "Hybrid" für die MSBuild-Eigenschaft "AndroidAotMode" ist derzeit nicht mit der Ziel-ABI "armeabi-v7a" kompatibel. Um den experimentellen Wert "Hybrid" für "AndroidAotMode" weiterhin zu verwenden, heben Sie die Auswahl der Ziel-ABI "armeabi-v7a" auf den Visual Studio-Projekteigenschaftenseiten auf, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und entfernen Sie "armeabi-v7a" aus der MSBuild-Eigenschaft "AndroidSupportedAbis". The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Um einen benutzerdefinierten JDK-Pfad für einen Befehlszeilenbuild zu verwenden - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + Die MSBuild-Eigenschaft „{0}“ ist nicht mit der {1} Laufzeit kompatibel. Der Build kann nicht fortgesetzt werden, solange diese Eigenschaft aktiviert ist. Entfernen Sie entweder die Eigenschaft, oder schützen Sie sie mit einer Bedingung: Condition="$(UseMonoRuntime)" == "true"" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx index ef811c16ed7..8b0625c47bd 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Ya no se admite el uso de ProGuard con el compilador DX DEX. Establezca el compilador DEX en "d8" en las páginas de propiedades del proyecto de Visual Studio o edite el archivo de proyecto en un editor de texto y establezca la propiedad "AndroidLinkTool" de MSBuild en "d8". The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Ignorando el archivo de configuración "{0}". Los archivos de configuración .NET no son compatibles con proyectos .NET para Android que tengan como objetivo .NET 6 o superior. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - El valor "Hybrid" experimental de la propiedad de MSBuild "AndroidAotMode" no es compatible actualmente con el valor ABI de destino armeabi-v7a. Para seguir usando el valor "Hybrid" experimental para "AndroidAotMode", anule la selección del valor ABI de destino armeabi-v7a en las páginas de propiedades del proyecto de Visual Studio o edite el archivo del proyecto en un editor de texto y quite "armeabi-v7a" de la propiedad de MSBuild "AndroidSupportedAbis". The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Para usar una ruta de acceso de JDK personalizada para una compilación de líne - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + La propiedad "{0}" de MSBuild no es compatible con el tiempo de {1} ejecución. La compilación no puede continuar mientras esta propiedad esté habilitada. Quite la propiedad o resguarde con una condición: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx index 72321c69e61..9265d86c8fd 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i L'utilisation du compilateur DEX DX n’est pas prise en charge. Affectez au compilateur DEX la valeur 'd8' dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte, puis affectez la valeur 'd8' à la propriété MSBuild 'AndroidDexTool'. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Fichier de configuration «{0}» ignoré. Les fichiers de configuration .NET ne sont pas pris en charge dans .NET pour les projets Android qui ciblent .NET 6 ou version ultérieure. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - L'utilisation de la valeur expérimentale 'Hybrid' pour la propriété MSBuild 'AndroidAotMode' n'est pas compatible avec l'ABI cible armeabi-v7a. Si vous souhaitez continuer à utiliser la valeur expérimentale 'Hybrid' pour 'AndroidAotMode', désélectionnez l'ABI cible armeabi-v7a dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte, puis supprimez 'armeabi-v7a' dans la propriété MSBuild 'AndroidSupportedAbis'. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Pour utiliser un chemin JDK personnalisé pour une build de ligne de commande, d - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + La propriété MSBuild « {0} » n’est pas compatible avec le runtime {1}. La compilation ne peut pas continuer tant que cette propriété est activée. Supprimez la propriété ou protégez-la avec une condition : Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx index 864701b5429..a5038617a04 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i L'uso del compilatore DX DEX non è supportato. Impostare il compilatore DEX su 'd8' nelle pagine delle proprietà del progetto Visual Studio oppure modificare il file di progetto in un editor di testo e impostare la proprietà MSBuild 'AndroidDexTool' su 'd8'. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Il file di configurazione '{0}' verrà ignorato. I file di configurazione .NET non sono supportati in progetti .NET per Android destinati a .NET 6 o versione successiva. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - Il valore sperimentale 'Hybrid' per la proprietà 'AndroidAotMode' MSBuild non è attualmente compatibile con l'ABI di destinazione armeabi-v7a. Per continuare a usare il valore sperimentale 'Hybrid' per 'AndroidAotMode', deselezionare l'ABI di destinazione armeabi-v7a nelle pagine delle proprietà del progetto Visual Studio o modificare il file di progetto in un editor di testo e rimuovere 'armeabi-v7a' dalla proprietà 'AndroidSupportedAbis' di MSBuild. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Per usare un percorso JDK personalizzato per una compilazione della riga di coma - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + La proprietà MSBuild "{0}" non è compatibile con il runtime {1}. La compilazione non può continuare mentre questa proprietà è abilitata. Rimuovi la proprietà o proteggerla con una condizione: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx index 7a9432c4624..4294d7aab31 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i DX DEX コンパイラはサポートされなくなりました。Visual Studio プロジェクトのプロパティ ページで DEX コンパイラを 'd8' に設定するか、テキスト エディターでプロジェクト ファイルを編集して 'AndroidDexTool' MSBuild プロパティを 'd8' に設定してください。 The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - 構成ファイル '{0}' を無視しています。.NET 構成ファイルは、.NET 6 以降を対象とする .NET for Android プロジェクトではサポートされていません。 - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - 'AndroidAotMode' MSBuild プロパティの試験的な 'Hybrid' 値は、現在、armeabi-v7a ターゲット ABI と互換性がありません。'AndroidAotMode' の試験的な 'Hybrid' 値を継続して使用するには、Visual Studio プロジェクト プロパティ ページで armeabi-v7a ターゲット ABI の選択を解除するか、テキスト エディターでプロジェクト ファイルを編集して、'AndroidSupportedAbis' MSBuild プロパティから 'armeabi-v7a' を削除します。 The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1015,7 +1010,7 @@ In this message, the term "handheld app" means "app for handheld devices." - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + MSBuild プロパティ '{0}' は {1} ランタイムと互換性がありません。このプロパティが有効な間はビルドを続行できません。プロパティを削除するか、次の条件で保護してください: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx index 5af6d56464a..487c11326de 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i DX DEX 컴파일러 사용은 지원되지 않습니다. Visual Studio 프로젝트 속성 페이지에서 DEX 컴파일러를 'd8'로 설정하거나 텍스트 편집기에서 프로젝트 파일을 편집하고 'AndroidDexTool' MSBuild 속성을 'd8'로 설정하세요. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - 구성 파일 '{0}'을(를) 무시합니다. .Net 6 이상을 대상으로 Android용 .NET 프로젝트에서는 .NET 구성 파일이 지원되지 않습니다. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - 'AndroidAotMode' MSBuild 속성의 실험적 'Hybrid' 값은 현재 armeabi-v7a 대상 ABI와 호환되지 않습니다. 'AndroidAotMode'에 대해 실험적 'Hybrid' 값을 계속 사용하려면 Visual Studio 프로젝트 속성 페이지에서 armeabi-v7a 대상 ABI를 선택 취소하거나 텍스트 편집기에서 프로젝트 파일을 편집하고 'AndroidSupportedAbis' MSBuild 속성에서 'armeabi-v7a'를 제거하세요. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ In this message, the term "handheld app" means "app for handheld devices." - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + MSBuild 속성 '{0}'은(는) {1} 런타임과 호환되지 않습니다. 이 속성이 활성화된 상태에서는 빌드를 계속할 수 없습니다. 속성을 제거하거나 Condition="'$(UseMonoRuntime)' == 'true'" 조건으로 보호하세요. The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx index f7dc350f411..6a95292cab6 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Używanie kompilatora DX DEX nie jest obsługiwane. Ustaw kompilator DEX na „d8” na stronach właściwości projektu w programie Visual Studio lub edytuj plik projektu w edytorze tekstów i ustaw właściwość „AndroidDexTool” MSBuild na wartość „d8”. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Plik konfiguracji „{0}” zostanie zignorowany. Pliki konfiguracji platformy .NET nie są obsługiwane w projektach platformy .NET dla systemu Android , których miejscem docelowym jest platforma .NET 6 lub nowsza. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - Eksperymentalna wartość „Hybrid” dla właściwości programu MSBuild „AndroidAotMode” jest obecnie niezgodna z docelowym interfejsem ABI armeabi-v7a. Aby nadal używać eksperymentalnej wartości „Hybrid” dla właściwości „AndroidAotMode”, usuń zaznaczenie docelowego interfejsu ABI armeabi-v7a na stronach właściwości projektu w programie Visual Studio albo zmodyfikuj plik projektu w edytorze tekstów, usuwając wartość „armeabi-v7a” z właściwości programu MSBuild „AndroidSupportedAbis”. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Aby użyć niestandardowej ścieżki zestawu JDK dla kompilacji wiersza poleceni - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + Właściwość MSBuild „{0}” nie jest zgodna ze środowiskiem uruchomieniowym {1}. Nie można kontynuować kompilacji, gdy ta właściwość jest włączona. Usuń właściwość lub zapewnij ochronę za pomocą warunku: Condition="$(UseMonoRuntime)" == "true"" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx index 918aa910e69..f8859846d3a 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Não há suporte para o uso do Compilador DX DEX. Defina o compilador DEX para 'd8' nas páginas de propriedades do projeto do Visual Studio ou edite o arquivo de projeto em um editor de texto e defina a propriedade 'AndroidDexTool' do MSBuild como 'd8'. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Ignorando o arquivo de configuração '{0}'. Não há suporte para arquivos de configuração .NET em projetos .NET para Android direcionados ao .NET 6 ou superior. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - O valor 'Hybrid' experimental para a propriedade 'AndroidAotMode' do MSBuild não é compatível atualmente com o ABI de destino armeabi-v7a. Para continuar usando o valor 'Hybrid' experimental para 'AndroidAotMode', desmarque o ABI de destino armeabi-v7a nas páginas de propriedades do projeto do Visual Studio ou edite o arquivo de projeto em um editor de texto e remova 'armeabi-v7a' da propriedade 'AndroidSupportedAbis' do MSBuild. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Para usar um caminho JDK personalizado para um build de linha de comando, defina - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + A propriedade MSBuild '{0}' não é compatível com o runtime {1}. A compilação não pode continuar enquanto esta propriedade estiver habilitada. Remova a propriedade ou proteja-a com uma condição: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index 0251f8b6166..214d4b89df3 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Using the DX DEX Compiler is not supported. Please set the DEX compiler to 'd8' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidDexTool' MSBuild property to 'd8'. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET for Android projects that target .NET 6 or higher. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx index fd7c59b3836..b4cf99bd276 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i Использование DEX-компилятора DX не поддерживается. Установите компилятор DEX "d8" на страницах свойств проекта в Visual Studio или измените файл проекта в текстовом редакторе, задав значение "d8" для свойства MSBuild "AndroidDexTool". The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - Пропуск файла конфигурации "{0}". Файлы конфигурации .NET не поддерживаются в проектах .NET для Android, ориентированных на .NET 6 или более позднюю версию. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - Экспериментальное значение "Hybrid" для свойства MSBuild "AndroidAotMode" сейчас не совместимо с целевым ABI armeabi-v7a. Чтобы продолжить использовать экспериментальное значение "Hybrid" для свойства "AndroidAotMode", отмените выбор целевого ABI armeabi-v7a на страницах свойств проекта Visual Studio или откройте файл проекта в текстовом редакторе и удалите "armeabi-v7a" из свойства "AndroidSupportedAbis" MSBuild. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ In this message, the term "handheld app" means "app for handheld devices." - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + Свойство MSBuild "{0}" несовместимо со средой выполнения {1}. Сборка не может продолжаться, пока это свойство включено. Удалите свойство или защитите его условием: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx index a23c933cccb..2c13039f196 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i DX DEX Derleyicisinin kullanılması desteklenmemektedir. Lütfen Visual Studio projesi özellik sayfalarında DEX derleyicisini 'd8' olarak ayarlayın veya proje dosyasını bir metin düzenleyicide düzenleyip 'AndroidDexTool' MSBuild özelliğini 'd8' olarak ayarlayın. The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - '{0}' yapılandırma dosyası göz ardı ediliyor. .NET yapılandırma dosyaları, .NET 6 veya üstünü hedefleyen Android için .NET projelerinde desteklenmez. - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - 'AndroidAotMode' MSBuild özelliği için deneysel 'Hybrid' değeri şu anda armeabi-v7a hedef ABI ile uyumlu değil. 'AndroidAotMode' için deneysel 'Hybrid' değerini kullanmaya devam etmek için Visual Studio projesinin özellik sayfalarındaki armeabi-v7a hedef ABI seçimini kaldırın veya metin düzenleyicisinde proje dosyasını düzenleyerek 'AndroidSupportedAbis' MSBuild özelliğinden 'armeabi-v7a' öğesini kaldırın. The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ Bir komut satırı derlemesi için özel bir SDK yolu kullanmak için 'JavaSdkDi - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + '{0}' MSBuild özelliği {1} çalışma zamanıyla uyumlu değil. Bu özellik etkin durumdayken derleme devam edemez. Özelliği kaldırın veya şu koşulla koruyun: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx index ade3240e89e..ed0dc36ad40 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i 已不支持 DX DEX 编译器。请在 Visual Studio 项目属性页中将 DEX 编译器设置为 "d8",或者在文本编辑器中编辑项目文件,并将 "AndroidDexTool" MSBuild 属性设置为 "d8"。 The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - 正在忽略配置文件“{0}”。面向 .NET 6 或更高版本的 .NET for Android 项目不支持 .NET 配置文件。 - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - "AndroidAotMode" MSBuild 属性的实验性“混合”值当前与 armeabi-v7a 目标 ABI 不兼容。若要继续使用 "AndroidAotMode" 的实验性“混合”值,请在 Visual Studio 项目属性页中取消选择 armeabi-v7a 目标 ABI,或在文本编辑器中编辑项目文件,并从 "AndroidSupportedAbis' MSBuild" 属性中删除 "armeabi-v7a"。 The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ In this message, the term "handheld app" means "app for handheld devices." - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + MSBuild 属性“{0}”与 {1} 运行时不兼容。启用此属性时,无法继续生成。移除属性或使用条件保护它: Condition="'$(UseMonoRuntime)' == 'true'" The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx index 51ebb78efdc..8f3c63311eb 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx @@ -458,11 +458,6 @@ In this message, the term "binding" means a piece of generated code that makes i 已不支援使用 DX DEX 編譯器。請在 Visual Studio 專案屬性頁中將 DEX 編譯器設為 'd8',或在文字編輯器中編輯專案檔,並將 'AndroidDexTool' MSBuild 屬性設為 'd8'。 The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - - 正在忽略設定檔 '{0}'。以 .NET 6 或更新版本為目標的 .NET Android 專案不支援 .NET 設定檔。 - The following are literal names and should not be translated: .NET, .NET for Android. -{0} - The file name such as 'Foo.dll.config' - 'AndroidAotMode' MSBuild 屬性的實驗性 'Hybrid' 值目前與 armeabi v7a 目標 ABI 不相容。若要繼續使用 'AndroidAotMode' 的實驗性 'Hybrid' 值,請取消選取 Visual Studio 專案屬性頁面中的 armeabi-v7a 目標 ABI,或在文字編輯器中編輯專案檔,從 'AndroidSupportedAbis' MSBuild 屬性中移除 'armeabi-v7a'。 The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' @@ -1014,7 +1009,7 @@ In this message, the term "handheld app" means "app for handheld devices." - The MSBuild property '{0}' is not compatible with the {1} runtime. The build cannot continue while this property is enabled. Either remove the property or guard it with a condition: Condition="'$(UseMonoRuntime)' == 'true'" + MSBuild 屬性 '{0}' 與 {1} 執行階段不相容。啟用此屬性時,建置無法繼續。移除屬性或使用條件: Condition="'$(UseMonoRuntime)' == 'true'" 保護它 The following are literal names and should not be translated: MSBuild, UseMonoRuntime. {0} - The MSBuild property name (e.g. RunAOTCompilation, EnableLLVM). {1} - The name of the .NET runtime (e.g. CoreCLR, NativeAOT). diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs index f80a14157f1..c58b43fa1d2 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs @@ -68,6 +68,14 @@ public void LogManifestReferencedTypeNotFoundWarning (string javaTypeName) => public bool Debug { get; set; } public bool NeedsInternet { get; set; } public bool EmbedAssemblies { get; set; } + public string? PackageNamingPolicy { get; set; } + + /// + /// Maximum array rank for which the generator emits per-rank __ArrayMapRank{N} + /// sentinels and TypeMap entries. 0 disables. Set via + /// $(_AndroidTrimmableTypeMapMaxArrayRank). + /// + public int MaxArrayRank { get; set; } public string? ManifestPlaceholders { get; set; } public string? CheckedBuild { get; set; } public string? ApplicationJavaClass { get; set; } @@ -130,8 +138,10 @@ public override bool RunTask () systemRuntimeVersion, frameworkAssemblyNames, useSharedTypemapUniverse: !Debug, - manifestConfig, - manifestTemplate); + manifestConfig: manifestConfig, + manifestTemplate: manifestTemplate, + packageNamingPolicy: PackageNamingPolicy, + maxArrayRank: MaxArrayRank); GeneratedAssemblies = WriteAssembliesToDisk (result.GeneratedAssemblies, assemblyPaths); GeneratedJavaFiles = WriteJavaSourcesToDisk (result.GeneratedJavaSources); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeAotSharedLibrary.cs b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeAotSharedLibrary.cs new file mode 100644 index 00000000000..491ece9dd1b --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeAotSharedLibrary.cs @@ -0,0 +1,231 @@ +#nullable enable +using System; +using System.Collections.Generic; +using System.IO; + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using Microsoft.Android.Build.Tasks; + +namespace Xamarin.Android.Tasks; + +/// +/// Links a NativeAOT shared library (.so) from the ILC-compiled object file and runtime archives. +/// Uses ld.lld directly instead of clang, matching the approach used by NativeLinker for CoreCLR/Mono. +/// +public class LinkNativeAotSharedLibrary : AndroidTask +{ + public override string TaskPrefix => "LNAS"; + + [Required] + public string AndroidBinUtilsDirectory { get; set; } = ""; + + [Required] + public string IntermediateOutputPath { get; set; } = ""; + + [Required] + public ITaskItem [] RuntimePackLibraryDirectories { get; set; } = []; + + /// + /// The ILC-compiled object file (e.g., TestApp.o) + /// + [Required] + public ITaskItem NativeObject { get; set; } = null!; // NRT - guarded by [Required] + + /// + /// The output shared library path (e.g., libTestApp.so) + /// + [Required] + public ITaskItem OutputSharedLibrary { get; set; } = null!; // NRT - guarded by [Required] + + /// + /// Runtime and BCL static archives to link (e.g., libSystem.Native.a, libRuntime.WorkstationGC.a) + /// + [Required] + public ITaskItem [] NativeLibraries { get; set; } = []; + + /// + /// Additional object files to link (e.g., jni_init_funcs.o, environment.o, libbootstrapperdll.o) + /// + public ITaskItem []? AdditionalObjectFiles { get; set; } + + /// + /// CRT start files (e.g., crtbegin_so.o) — linked first + /// + public ITaskItem []? CrtStartFiles { get; set; } + + /// + /// CRT end files (e.g., crtend_so.o) — linked last + /// + public ITaskItem []? CrtEndFiles { get; set; } + + /// + /// Compiler-rt and unwinder libraries to link after user libraries (explicit file paths) + /// + public ITaskItem []? CompilerRuntimeLibraries { get; set; } + + /// + /// System libraries to link with -l (e.g., "dl", "c", "m", "z", "log") + /// + public ITaskItem []? SystemLibraries { get; set; } + + /// + /// Additional library search paths (e.g., NDK sysroot paths) + /// + public ITaskItem []? LibrarySearchPaths { get; set; } + + /// + /// Version script for symbol visibility (e.g., TestApp.exports) + /// + public string? ExportsFile { get; set; } + + /// + /// Linker script (e.g., sections.ld for __modules retention) + /// + public string? LinkerScript { get; set; } + + /// + /// Linker script content to write before linking + /// + public string? LinkerScriptContent { get; set; } + + /// + /// Extra arguments to pass directly to the linker, separated by semicolons. + /// + public string? ExtraLinkerArgs { get; set; } + + [Required] + public string SupportedAbis { get; set; } = ""; + + public bool DebugBuild { get; set; } + + public override bool RunTask () + { + foreach (string abi in SupportedAbis.Split (new [] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { + if (!LinkForAbi (abi)) { + return false; + } + } + return true; + } + + bool LinkForAbi (string abi) + { + var linker = new NativeLinker ( + Log, + abi, + Path.GetFileName (OutputSharedLibrary.ItemSpec), + AndroidBinUtilsDirectory, + IntermediateOutputPath, + RuntimePackLibraryDirectories + ) { + StripDebugSymbols = !DebugBuild, + SaveDebugSymbols = !DebugBuild, + AllowUndefinedSymbols = false, + + // NativeAOT-specific options + ExportDynamic = true, + UseEhFrameHdr = true, + DiscardAll = true, + AsNeeded = true, + HashStyleBoth = true, + LittleEndian = true, + EntryPoint = "0x0", + CompressDebugSections = "zlib", + }; + + if (!ExportsFile.IsNullOrEmpty ()) { + linker.VersionScript = ExportsFile; + } + + if (!ExtraLinkerArgs.IsNullOrEmpty ()) { + linker.ExtraArgs = new List (); + foreach (var arg in ExtraLinkerArgs.Split (new [] { ';' }, StringSplitOptions.RemoveEmptyEntries)) { + linker.ExtraArgs.Add (arg.Trim ()); + } + } + + // Write linker script if content is provided + if (!LinkerScriptContent.IsNullOrEmpty () && !LinkerScript.IsNullOrEmpty ()) { + string? dir = Path.GetDirectoryName (LinkerScript); + if (!dir.IsNullOrEmpty ()) { + Directory.CreateDirectory (dir); + } + File.WriteAllText (LinkerScript, LinkerScriptContent); + } + + if (!LinkerScript.IsNullOrEmpty ()) { + linker.LinkerScript = LinkerScript; + } + + if (LibrarySearchPaths != null) { + linker.AdditionalSearchPaths = new List (); + foreach (var path in LibrarySearchPaths) { + linker.AdditionalSearchPaths.Add (path.ItemSpec); + } + } + + // Build the link items in order: + // 1. ILC object file + // 2. Native libraries (.a archives from ILC runtime pack) + // 3. System libraries (-ldl, -lz, -llog, -lm, -lc) + // 4. Additional object files (jni_init, environment, etc.) + // 5. Compiler-rt and unwinder libraries + var linkItems = new List (); + + linkItems.Add (CopyItemWithAbi (NativeObject, abi)); + + foreach (var lib in NativeLibraries) { + linkItems.Add (CopyItemWithAbi (lib, abi)); + } + + if (SystemLibraries != null) { + foreach (var lib in SystemLibraries) { + linkItems.Add (NativeLinker.MakeLibraryItem (lib.ItemSpec, abi)); + } + } + + if (AdditionalObjectFiles != null) { + foreach (var obj in AdditionalObjectFiles) { + linkItems.Add (CopyItemWithAbi (obj, abi)); + } + } + + if (CompilerRuntimeLibraries != null) { + foreach (var lib in CompilerRuntimeLibraries) { + linkItems.Add (CopyItemWithAbi (lib, abi)); + } + } + + // CRT start/end files + List? startFiles = null; + if (CrtStartFiles != null && CrtStartFiles.Length > 0) { + startFiles = new List (); + foreach (var crt in CrtStartFiles) { + startFiles.Add (CopyItemWithAbi (crt, abi)); + } + } + + List? endFiles = null; + if (CrtEndFiles != null && CrtEndFiles.Length > 0) { + endFiles = new List (); + foreach (var crt in CrtEndFiles) { + endFiles.Add (CopyItemWithAbi (crt, abi)); + } + } + + var output = CopyItemWithAbi (OutputSharedLibrary, abi); + + return linker.Link (output, linkItems, startFiles, endFiles); + } + + /// + /// Copy a task item preserving all metadata, then set or override the Abi metadata. + /// + static ITaskItem CopyItemWithAbi (ITaskItem source, string abi) + { + var item = new TaskItem (source); + item.SetMetadata (KnownMetadata.Abi, abi); + return item; + } +} diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ReadAndroidManifest.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ReadAndroidManifest.cs index 9a31cd7487e..4c77c4a89be 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/ReadAndroidManifest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/ReadAndroidManifest.cs @@ -5,8 +5,6 @@ using System.IO; using Xamarin.Android.Tools; using Microsoft.Android.Build.Tasks; -using System; -using System.Globalization; namespace Xamarin.Android.Tasks { @@ -64,21 +62,17 @@ public override bool RunTask () } var libraries = new List (); + var platformPath = MonoAndroidHelper.AndroidSdk.TryGetPlatformDirectoryFromApiLevel (AndroidApiLevel, MonoAndroidHelper.SupportedVersions); + if (platformPath == null) { + Log.LogDebugMessage ($"Could not find platform directory for API level '{AndroidApiLevel}'"); + } foreach (var uses_library in app.Elements ("uses-library")) { var attribute = uses_library.Attribute (androidNs + "name"); if (attribute != null && !attribute.Value.IsNullOrEmpty ()) { + if (platformPath == null) + continue; var required = uses_library.Attribute (androidNs + "required")?.Value; - string apiLevel; - if (MonoAndroidHelper.TryParseApiLevel (AndroidApiLevel, out Version version)) { - if (version.Minor == 0) { - apiLevel = version.Major.ToString (CultureInfo.InvariantCulture); - } else { - apiLevel = version.ToString (); - } - } else { - apiLevel = AndroidApiLevel; - } - var path = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{apiLevel}", "optional", $"{attribute.Value}.jar"); + var path = Path.Combine (platformPath, "optional", $"{attribute.Value}.jar"); if (File.Exists (path)) { libraries.Add (new TaskItem (path)); } else { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs index c98c394daed..afff1ba0c0a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs @@ -34,7 +34,7 @@ public void InstallAndroidDependenciesTest ([Values ("GoogleV2", "Xamarin")] str // Set to true when we are marking a new Android API level as stable, but it has not // been added to the Xamarin manifest yet. - var xamarin_manifest_needs_updating = false; + var xamarin_manifest_needs_updating = true; AssertCommercialBuild (); var oldSdkPath = Environment.GetEnvironmentVariable ("TEST_ANDROID_SDK_PATH"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidGradleProjectTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidGradleProjectTests.cs index 28eeecd4d57..a1d13e8d1a0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidGradleProjectTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidGradleProjectTests.cs @@ -585,8 +585,9 @@ static IEnumerable GetAgpGradleVersionTestData () // AGP 8.5.0 only supports up to compileSdk 34 yield return new object[] { "8.5.0", "8.7", 34 }; // AGP 9.0.0 with Gradle 9.1.0 - tests the Gradle 9.x stricter Kotlin type checking fix + // AGP 9.0.0 only supports up to compileSdk 36 // Note: Full version "9.1.0" is required for the download URL to work correctly - yield return new object[] { "9.0.0", "9.1.0", XABuildConfig.AndroidDefaultTargetDotnetApiLevel.Major }; + yield return new object[] { "9.0.0", "9.1.0", 36 }; } /// diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index a8a90ae9ff3..d607be2c85e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -942,6 +942,7 @@ public void IfAndroidJarDoesNotExistThrowXA5207 ([Values(true, false)] bool buil } [Test] + [Ignore ("This test requires a minor API level (e.g. 37.1) as the stable target. Re-enable when a minor API level is added.")] public void MinorApiLevelFallbackThrowsXA5207 () { var stableApiLevel = XABuildConfig.AndroidLatestStableApiLevel; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index 759d6a2f855..86366d2a73f 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -2066,7 +2066,10 @@ public void BuildBasicApplicationCheckConfigFiles ([Values] AndroidRuntime runti }; proj.OtherBuildItems.Add (config); Assert.IsTrue (b.Build (proj), "Build should have succeeded."); - StringAssertEx.Contains ("XA1024", b.LastBuildOutput, "Output should contain XA1024 warnings"); + // TODO: NativeAOT has trimmer warnings: https://github.com/dotnet/android/issues/9784 + if (runtime != AndroidRuntime.NativeAOT) { + b.AssertHasNoWarnings (); + } } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/Aapt2Tests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/Aapt2Tests.cs index 483eaadaf55..b9443fd44af 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/Aapt2Tests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/Aapt2Tests.cs @@ -173,7 +173,7 @@ public void Aapt2Link ([Values (true, false)] bool compilePerFile) CompiledResourceFlatFiles = compilePerFile ? items.ToArray () : null, OutputFile = outputFile, AssemblyIdentityMapFile = Path.Combine (path, "foo.map"), - JavaPlatformJarPath = Path.Combine (AndroidSdkPath, "platforms", $"android-{platform.Major}", "android.jar"), + JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform), }; Assert.True (task.Execute (), $"task should have succeeded. {string.Join (";", errors.Select (x => x.Message))}"); Assert.AreEqual (0, errors.Count, "There should be no errors."); @@ -466,7 +466,7 @@ public void Aapt2AndroidResgenExtraArgsAreInvalid () CompiledResourceFlatArchive = new TaskItem (Path.Combine (path, "compiled.flata")), OutputFile = outputFile, AssemblyIdentityMapFile = Path.Combine (path, "foo.map"), - JavaPlatformJarPath = Path.Combine (AndroidSdkPath, "platforms", $"android-{platform}", "android.jar"), + JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform), ExtraArgs = "--no-crunch " }; Assert.False (task.Execute (), "task should have failed."); @@ -508,7 +508,7 @@ public void Aapt2AndroidResgenExtraArgsAreSplit () CompiledResourceFlatArchive = new TaskItem (Path.Combine (archivePath, "compiled.flata")), OutputFile = outputFile, AssemblyIdentityMapFile = Path.Combine (path, "foo.map"), - JavaPlatformJarPath = Path.Combine (AndroidSdkPath, "platforms", $"android-{platform.Major}", "android.jar"), + JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform), ExtraArgs = $@"--no-version-vectors -v --emit-ids ""{emitids}"" --output-text-symbols '{Rtxt}'" }; Assert.True (task.Execute (), $"task should have succeeded. {string.Join (" ", errors.Select (e => e.Message))}"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs index 534ec6bfcee..21edf2f634d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs @@ -399,7 +399,7 @@ GenerateResourceDesigner CreateTask (string path) task.CaseMapFile = Path.Combine (Root, path, "case_map.txt"); task.IsApplication = true; var platform = AndroidSdkResolver.GetMaxInstalledPlatform (); - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform.Major}", "android.jar"); + task.JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform); return task; } @@ -505,7 +505,7 @@ public void UpdateLayoutIdIsIncludedInDesigner ([Values(true, false)] bool useRt File.WriteAllText (task.ResourceFlagFile, string.Empty); task.IsApplication = true; var platform = AndroidSdkResolver.GetMaxInstalledPlatform (); - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform.Major}", "android.jar"); + task.JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform); Assert.IsTrue (task.Execute (), "Task should have executed successfully."); Assert.IsTrue (File.Exists (task.NetResgenOutputFile), $"{task.NetResgenOutputFile} should have been created."); var expected = Path.Combine (ExpectedOutputDir, "GenerateDesignerFileExpected.cs"); @@ -540,7 +540,7 @@ public void RtxtGeneratorOutput () RTxtFile = rTxt, ResourceDirectory = resPath, CaseMapFile = Path.Combine (Root, path, "case_map.txt"), - JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform.Major}", "android.jar"), + JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform), ResourceFlagFile = Path.Combine (Root, path, "res.flag"), AdditionalResourceDirectories = new string[] { Path.Combine (Root, path, "lp", "res"), @@ -592,7 +592,7 @@ public void CompareAapt2AndManagedParserOutput () CompiledResourceFlatArchive = new TaskItem (Path.Combine (Root, path, "compiled.flata")), OutputFile = Path.Combine (Root, path, "foo.apk"), AssemblyIdentityMapFile = Path.Combine (Root, path, "foo.map"), - JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform.Major}", "android.jar"), + JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform), JavaDesignerOutputDirectory = Path.Combine (Root, path, "java"), ResourceSymbolsTextFile = rTxt, @@ -655,7 +655,7 @@ public void CheckPerformanceOfManagedParser () int i; for (i = 0; i < 100; i++) { var parser = new ManagedResourceParser (loggingHelper) { - JavaPlatformDirectory = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform.Major}"), + JavaPlatformDirectory = Path.Combine (AndroidSdkDirectory, "platforms", AndroidSdkResolver.GetPlatformDirectoryName (platform)), ResourceFlagFile = flagFile, }; sw.Start (); @@ -733,7 +733,7 @@ int styleable ElevenAttributes_attr09 9 task.Resources = new TaskItem [] {}; task.IsApplication = true; var platform = AndroidSdkResolver.GetMaxInstalledPlatform (); - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform}", "android.jar"); + task.JavaPlatformJarPath = AndroidSdkResolver.GetAndroidJarPath (platform); Assert.IsTrue (task.Execute (), "Task should have executed successfully."); Assert.IsTrue (File.Exists (task.NetResgenOutputFile), $"{task.NetResgenOutputFile} should have been created."); var expected = Path.Combine (ExpectedOutputDir, "GenerateDesignerFileWithElevenStyleableAttributesExpected.cs"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs index 942b5982d6d..22a15e6eb7c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs @@ -37,12 +37,6 @@ public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease return; } - // NativeAOT incremental builds re-run CoreCompile due to AssemblyModifierPipeline - // touching assembly timestamps in-place. See https://github.com/dotnet/android/issues/11265 - if (runtime == AndroidRuntime.NativeAOT) { - Assert.Ignore ("NativeAOT incremental builds affected by timestamp issue."); - } - var proj = new XamarinAndroidApplicationProject { IsRelease = isRelease, }; @@ -63,12 +57,12 @@ public void Build_WithTrimmableTypeMap_IncrementalBuild ([Values] bool isRelease } [Test] - public void Build_WithTrimmableTypeMap_DoesNotHitCopyIfChangedMismatch () + public void Build_WithTrimmableTypeMap_DoesNotHitCopyIfChangedMismatch ([Values (AndroidRuntime.CoreCLR, AndroidRuntime.NativeAOT)] AndroidRuntime runtime) { var proj = new XamarinAndroidApplicationProject { IsRelease = true, }; - proj.SetRuntime (AndroidRuntime.CoreCLR); + proj.SetRuntime (runtime); proj.SetProperty ("_AndroidTypeMapImplementation", "trimmable"); using var builder = CreateApkBuilder (); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidGradleProject.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidGradleProject.cs index cefda07e799..c183570f858 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidGradleProject.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidGradleProject.cs @@ -15,13 +15,13 @@ public class AndroidGradleProject public string BuildFilePath => Path.Combine (ProjectDirectory, "build.gradle.kts"); /// - /// Android Gradle Plugin version (e.g., "8.5.0", "9.0.0") + /// Android Gradle Plugin version (e.g., "8.5.0", "9.1.1") /// - public string AgpVersion { get; set; } = "9.1.0"; + public string AgpVersion { get; set; } = "9.1.1"; /// /// Gradle wrapper version to use (e.g., "8.12", "9.0"). - /// Defaults to "9.3.1" (minimum required by AGP 9.1.0). If set to null or empty, the Gradle wrapper version generated by gradle init is used. + /// Defaults to "9.3.1" (minimum required by AGP 9.1.1). If set to null or empty, the Gradle wrapper version generated by gradle init is used. /// public string? GradleVersion { get; set; } = "9.3.1"; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs index a2b31442b14..13e27f82d3e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs @@ -152,5 +152,37 @@ static Version GetMaxInstalledPlatformInternal () } return maxInstalled ?? new Version (0, 0); } + + /// + /// Returns the platform directory name (e.g. "android-37.0") for the given platform version. + /// Starting with API 37, Google ships platforms as "android-37.0" instead of "android-37", + /// so we check for both and return whichever exists. Falls back to "{Major}" if neither exists. + /// + public static string GetPlatformDirectoryName (Version platform) + { + string sdkPath = GetAndroidSdkPath (); + string platformsPath = Path.Combine (sdkPath, "platforms"); + + // Try "{Major}.{Minor}" first (e.g. "android-37.0") + string fullDir = Path.Combine (platformsPath, $"android-{platform}"); + if (Directory.Exists (fullDir)) + return $"android-{platform}"; + + // Try "{Major}" (e.g. "android-37") + string majorDir = Path.Combine (platformsPath, $"android-{platform.Major}"); + if (Directory.Exists (majorDir)) + return $"android-{platform.Major}"; + + // Default to full version string + return $"android-{platform}"; + } + + /// + /// Returns the full path to android.jar for the given platform version. + /// + public static string GetAndroidJarPath (Version platform) + { + return Path.Combine (GetAndroidSdkPath (), "platforms", GetPlatformDirectoryName (platform), "android.jar"); + } } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index ac53cfebd11..05f7568a6ae 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -22,10 +22,8 @@ class NativeLinker "--gc-sections", // "--icf=safe", // "--lto=full|thin", - "--export-dynamic", "-z relro", "-z noexecstack", - "-z max-page-size=16384", "-z now", // we need it for security reasons (without it PLT can be overwritten) "--enable-new-dtags", "--build-id=sha1", @@ -53,6 +51,20 @@ class NativeLinker public string? NdkApiLevel { get; set; } public int ZipAlignmentPages { get; set; } = AndroidZipAlign.DefaultZipAlignment64Bit; + // Additional linker options (opt-in, defaults preserve existing behavior) + public bool ExportDynamic { get; set; } = true; + public bool UseEhFrameHdr { get; set; } = false; + public bool DiscardAll { get; set; } = false; + public bool AsNeeded { get; set; } = false; + public bool HashStyleBoth { get; set; } = false; + public bool LittleEndian { get; set; } = false; + public string? VersionScript { get; set; } + public string? LinkerScript { get; set; } + public string? EntryPoint { get; set; } + public string? CompressDebugSections { get; set; } + public List? AdditionalSearchPaths { get; set; } + public List? ExtraArgs { get; set; } + public NativeLinker (TaskLoggingHelper log, string abi, string soname, string binutilsDir, string intermediateDir, IEnumerable runtimePackLibDirs, CancellationToken? cancellationToken = null, Action? cancelTask = null) { @@ -65,7 +77,7 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi ld = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "ld")); objcopy = Path.Combine (binutilsDir, MonoAndroidHelper.GetExecutablePath (binutilsDir, "llvm-objcopy")); - extraArgs.Add ($"-soname {soname}"); + extraArgs.Add ($"-soname {MonoAndroidHelper.QuoteFileNameArgument (soname)}"); string? elfArch = null; uint maxPageSize; @@ -105,7 +117,9 @@ public NativeLinker (TaskLoggingHelper log, string abi, string soname, string bi extraArgs.Add ($"-z max-page-size={maxPageSize}"); string? nativeLibsDir = MonoAndroidHelper.GetRuntimePackNativeLibDir (MonoAndroidHelper.AbiToTargetArch (abi), runtimePackLibDirs); - extraArgs.Add ($"-L {MonoAndroidHelper.QuoteFileNameArgument (nativeLibsDir)}"); + if (!nativeLibsDir.IsNullOrEmpty ()) { + extraArgs.Add ($"-L {MonoAndroidHelper.QuoteFileNameArgument (nativeLibsDir)}"); + } } /// @@ -149,20 +163,62 @@ public bool Link (ITaskItem outputLibraryPath, List linkItems, List linkItems, List (); WriteFilesToResponseFile (sw, linkStartFiles); WriteFilesToResponseFile (sw, linkItems); diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets index 047f37ba58f..34f67926f65 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.targets @@ -159,7 +159,7 @@ <_XACommonPropsReplacement Include="@PACKAGE_VERSION@=$(ProductVersion)" /> <_XACommonPropsReplacement Include="@SDK_BUILD_TOOLS_VERSION@=$(XABuildToolsFolder)" /> <_XACommonPropsReplacement Include="@SDK_PLATFORM_TOOLS_VERSION@=$(XAPlatformToolsVersion)" /> - <_XACommonPropsReplacement Include="@SDK_PLATFORM_VERSION@=android-$(AndroidLatestStableApiLevel)" /> + <_XACommonPropsReplacement Include="@SDK_PLATFORM_VERSION@=android-$(AndroidLatestStablePlatformId)" /> {abi}{versionCode:D5} UpdateGeneratedFiles True + <_AndroidPackageNamingPolicySetByUser Condition=" '$(AndroidPackageNamingPolicy)' != '' ">true LowercaseCrc64 False @BUNDLETOOL_VERSION@ diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index ff9c93940e6..dd2ab89a61e 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1464,7 +1464,7 @@ because xbuild doesn't support framework reference assemblies. ScanFixtures () => _cachedScanResult.Value.peers; + private protected static List ScanFixtures (string packageNamingPolicy) + { + using var scanner = new JavaPeerScanner (packageNamingPolicy); + var peReader = new PEReader (File.OpenRead (TestFixtureAssemblyPath)); + var mdReader = peReader.GetMetadataReader (); + var assemblyName = mdReader.GetString (mdReader.GetAssemblyDefinition ().Name); + var assemblies = new [] { (assemblyName, peReader) }; + var peers = scanner.Scan (assemblies); + peReader.Dispose (); + return peers; + } + private protected static AssemblyManifestInfo ScanAssemblyManifestInfo () => _cachedScanResult.Value.manifestInfo; private protected static JavaPeerInfo FindFixtureByJavaName (string javaName) @@ -54,6 +66,14 @@ private protected static JavaPeerInfo FindFixtureByManagedName (string managedNa return peer; } + private protected static JavaPeerInfo FindFixtureByManagedName (string managedName, string packageNamingPolicy) + { + var peers = ScanFixtures (packageNamingPolicy); + var peer = peers.FirstOrDefault (p => p.ManagedTypeName == managedName); + Assert.NotNull (peer); + return peer; + } + static (string ns, string shortName) ParseManagedTypeName (string managedName) { var ns = managedName.Contains ('.') ? managedName.Substring (0, managedName.LastIndexOf ('.')) : ""; @@ -143,4 +163,32 @@ private protected static List GetMemberRefNames (MetadataReader reader) .Select (m => reader.GetString (m.Name)) .ToList (); + /// + /// Returns true if the IL byte stream contains a Call (0x28) or Callvirt (0x6F) instruction + /// whose metadata token matches . + /// + private protected static bool ILContainsCallToken (byte[] ilBytes, int token) + { + return ILContainsOpcodeToken (ilBytes, token, (byte) ILOpCode.Call, (byte) ILOpCode.Callvirt); + } + + private protected static bool ILContainsNewobjToken (byte[] ilBytes, int token) + { + return ILContainsOpcodeToken (ilBytes, token, (byte) ILOpCode.Newobj); + } + + static bool ILContainsOpcodeToken (byte[] ilBytes, int token, params byte[] opcodes) + { + byte t0 = (byte)(token & 0xFF); + byte t1 = (byte)((token >> 8) & 0xFF); + byte t2 = (byte)((token >> 16) & 0xFF); + byte t3 = (byte)((token >> 24) & 0xFF); + for (int i = 0; i < ilBytes.Length - 4; i++) { + if (opcodes.Contains (ilBytes [i]) && + ilBytes [i + 1] == t0 && ilBytes [i + 2] == t1 && + ilBytes [i + 3] == t2 && ilBytes [i + 4] == t3) + return true; + } + return false; + } } diff --git a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/RootTypeMapAssemblyGeneratorTests.cs b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/RootTypeMapAssemblyGeneratorTests.cs index 1a14dd1c09c..7de6aec0679 100644 --- a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/RootTypeMapAssemblyGeneratorTests.cs +++ b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/RootTypeMapAssemblyGeneratorTests.cs @@ -12,11 +12,11 @@ namespace Microsoft.Android.Sdk.TrimmableTypeMap.Tests; public class RootTypeMapAssemblyGeneratorTests : FixtureTestBase { - static MemoryStream GenerateRootAssembly (IReadOnlyList perAssemblyNames, bool useSharedTypemapUniverse = false, string? assemblyName = null) + static MemoryStream GenerateRootAssembly (IReadOnlyList perAssemblyNames, bool useSharedTypemapUniverse = false, string? assemblyName = null, int maxArrayRank = 0) { var stream = new MemoryStream (); var generator = new RootTypeMapAssemblyGenerator (new Version (11, 0, 0, 0)); - generator.Generate (perAssemblyNames, useSharedTypemapUniverse, stream, assemblyName); + generator.Generate (perAssemblyNames, useSharedTypemapUniverse, stream, assemblyName, maxArrayRank: maxArrayRank); stream.Position = 0; return stream; } @@ -135,6 +135,25 @@ public void Generate_MergedMode_TargetAttributesUseSharedAnchor () }, targetAttributes); } + [Theory] + [InlineData (true)] + [InlineData (false)] + public void Generate_WithArrays_TargetAttributesUsePerAssemblyRankAnchors (bool useSharedTypemapUniverse) + { + var targets = new [] { "_App.TypeMap", "_Mono.Android.TypeMap" }; + using var stream = GenerateRootAssembly (targets, useSharedTypemapUniverse, maxArrayRank: 2); + using var pe = new PEReader (stream); + var reader = pe.GetMetadataReader (); + + var targetAttributes = GetTypeMapAssemblyTargetAttributeTargetTypes (reader); + + Assert.Contains (("_App.TypeMap", "_App.TypeMap", "__ArrayMapRank1"), targetAttributes); + Assert.Contains (("_App.TypeMap", "_App.TypeMap", "__ArrayMapRank2"), targetAttributes); + Assert.Contains (("_Mono.Android.TypeMap", "_Mono.Android.TypeMap", "__ArrayMapRank1"), targetAttributes); + Assert.Contains (("_Mono.Android.TypeMap", "_Mono.Android.TypeMap", "__ArrayMapRank2"), targetAttributes); + Assert.DoesNotContain (targetAttributes, t => t.GenericArgumentTypeName == "__ArrayMapRank3"); + } + static List GetTypeMapAssemblyTargetAttributes (MetadataReader reader) { var result = new List (); @@ -170,6 +189,25 @@ static List GetTypeMapAssemblyTargetAttributes (MetadataReader return result; } + static List<(string TargetName, string GenericArgumentScope, string GenericArgumentTypeName)> GetTypeMapAssemblyTargetAttributeTargetTypes (MetadataReader reader) + { + var result = new List<(string TargetName, string GenericArgumentScope, string GenericArgumentTypeName)> (); + foreach (var attr in GetTypeMapAssemblyTargetAttributes (reader)) { + var targetName = GetTypeMapAssemblyTargetName (reader, attr); + var memberRef = reader.GetMemberReference ((MemberReferenceHandle)attr.Constructor); + var typeSpec = reader.GetTypeSpecification ((TypeSpecificationHandle)memberRef.Parent); + var blob = reader.GetBlobReader (typeSpec.Signature); + Assert.Equal (0x15, blob.ReadByte ()); // ELEMENT_TYPE_GENERICINST + Assert.Equal (0x12, blob.ReadByte ()); // ELEMENT_TYPE_CLASS + blob.ReadCompressedInteger (); // TypeMapAssemblyTargetAttribute`1 type + Assert.Equal (1, blob.ReadCompressedInteger ()); + Assert.Equal (0x12, blob.ReadByte ()); // ELEMENT_TYPE_CLASS + var targetType = DecodeTypeDefOrRefOrSpec (blob.ReadCompressedInteger ()); + result.Add ((targetName, GetResolutionScopeName (reader, targetType), GetTypeName (reader, targetType))); + } + return result; + } + static string GetTypeMapAssemblyTargetName (MetadataReader reader, CustomAttribute attr) { var blob = reader.GetBlobReader (attr.Value); @@ -211,6 +249,17 @@ static string GetResolutionScopeName (MetadataReader reader, EntityHandle handle }; } + static string GetTypeName (MetadataReader reader, EntityHandle handle) + { + if (handle.Kind == HandleKind.TypeDefinition) { + return reader.GetString (reader.GetTypeDefinition ((TypeDefinitionHandle)handle).Name); + } + if (handle.Kind != HandleKind.TypeReference) { + throw new InvalidOperationException ($"Unexpected type handle kind: {handle.Kind}"); + } + return reader.GetString (reader.GetTypeReference ((TypeReferenceHandle)handle).Name); + } + [Theory] [InlineData (true)] [InlineData (false)] @@ -322,4 +371,51 @@ static List GetIgnoresAccessChecksToValues (MetadataReader reader) } return result; } + + [Fact] + public void Generate_MergedMode_WithArrays_ProducesValidPEAssembly () + { + using var stream = GenerateRootAssembly (["_App.TypeMap", "_Mono.Android.TypeMap"], + useSharedTypemapUniverse: true, maxArrayRank: 3); + using var pe = new PEReader (stream); + Assert.True (pe.HasMetadata); + } + + [Theory] + [InlineData (true)] + [InlineData (false)] + public void Generate_WithArrays_ReferencesPerAsmRankSentinels (bool useSharedTypemapUniverse) + { + using var stream = GenerateRootAssembly (["_App.TypeMap", "_Mono.Android.TypeMap"], + useSharedTypemapUniverse: useSharedTypemapUniverse, maxArrayRank: 2); + using var pe = new PEReader (stream); + var reader = pe.GetMetadataReader (); + + var rankRefsByAssembly = reader.TypeReferences + .Select (h => reader.GetTypeReference (h)) + .Where (t => reader.GetString (t.Name).StartsWith ("__ArrayMapRank", StringComparison.Ordinal)) + .Select (t => ( + Name: reader.GetString (t.Name), + Assembly: reader.GetString (reader.GetAssemblyReference ((AssemblyReferenceHandle) t.ResolutionScope).Name))) + .ToList (); + Assert.Contains (("__ArrayMapRank1", "_App.TypeMap"), rankRefsByAssembly); + Assert.Contains (("__ArrayMapRank2", "_App.TypeMap"), rankRefsByAssembly); + Assert.Contains (("__ArrayMapRank1", "_Mono.Android.TypeMap"), rankRefsByAssembly); + Assert.Contains (("__ArrayMapRank2", "_Mono.Android.TypeMap"), rankRefsByAssembly); + Assert.DoesNotContain (rankRefsByAssembly, r => r.Name == "__ArrayMapRank3"); + } + + [Fact] + public void Generate_MergedMode_WithArrays_HasIgnoresAccessChecksToArrayAssemblies () + { + using var stream = GenerateRootAssembly (["_App.TypeMap", "_Mono.Android.TypeMap"], + useSharedTypemapUniverse: true, maxArrayRank: 3); + using var pe = new PEReader (stream); + var reader = pe.GetMetadataReader (); + + var accessAttrs = GetIgnoresAccessChecksToValues (reader); + Assert.Contains ("Mono.Android", accessAttrs); + Assert.Contains ("_App.TypeMap", accessAttrs); + Assert.Contains ("_Mono.Android.TypeMap", accessAttrs); + } } diff --git a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapAssemblyGeneratorTests.cs b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapAssemblyGeneratorTests.cs index 8ece123b853..ec37cbff9af 100644 --- a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapAssemblyGeneratorTests.cs +++ b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapAssemblyGeneratorTests.cs @@ -1173,28 +1173,61 @@ public void Generate_UcoConstructor_JiStyle_HasExceptionRegions () } [Fact] - public void Generate_UcoConstructor_GenericDefinition_NoExceptionRegions () + public void Generate_UcoConstructor_GenericDefinition_ThrowsWithMarshalMethodPattern () { - // Open-generic UCO constructors are no-ops and must NOT have exception regions - // (a single 'ret' is emitted with no surrounding try/catch/finally). - var peers = ScanFixtures (); - var generic = peers.First (p => p.JavaName == "my/app/GenericHolder"); - Assert.True (generic.IsGenericDefinition); + // Open-generic UCO constructors throw inside the same marshal-method wrapper used + // by normal UCO constructors, so the exception is surfaced through + // JniRuntime.OnUserUnhandledException instead of crossing the JNI boundary. + var generic = MakeAcwPeer ("test/GenericHolder", "Test.GenericHolder`1", "TestAsm") with { + IsGenericDefinition = true, + }; using var stream = GenerateAssembly (new [] { generic }, "GenericUcoCtorTest"); using var pe = new PEReader (stream); var reader = pe.GetMetadataReader (); var nctorMethodHandle = FindNctorUcoMethod (reader); + Assert.False (nctorMethodHandle.IsNil, "Open-generic ACWs should emit a throwing nctor_*_uco method"); - if (!nctorMethodHandle.IsNil) { - // If a nctor_*_uco method exists for the generic type, it must be a no-op (no exception regions). - var nctorMethod = reader.GetMethodDefinition (nctorMethodHandle); - var body = pe.GetMethodBody (nctorMethod.RelativeVirtualAddress); - Assert.NotNull (body); - Assert.Empty (body.ExceptionRegions); - } - // Open-generic types do not get a nctor_*_uco wrapper — no UCO ctors for generics. + var nctorMethod = reader.GetMethodDefinition (nctorMethodHandle); + var body = pe.GetMethodBody (nctorMethod.RelativeVirtualAddress); + Assert.NotNull (body); + + var regions = body.ExceptionRegions; + Assert.True (regions.Length >= 2, + $"Open-generic UCO constructor should have at least 2 exception regions, found {regions.Length}"); + Assert.Contains (regions, r => r.Kind == ExceptionRegionKind.Catch); + Assert.Contains (regions, r => r.Kind == ExceptionRegionKind.Finally); + + var typeNames = GetTypeRefNames (reader); + Assert.Contains ("NotSupportedException", typeNames); + + var ilBytes = body.GetILBytes (); + Assert.NotNull (ilBytes); + var memberRefHandles = Enumerable.Range (1, reader.GetTableRowCount (TableIndex.MemberRef)) + .Select (i => MetadataTokens.MemberReferenceHandle (i)) + .ToList (); + var notSupportedExceptionCtorHandle = memberRefHandles.First (h => { + var member = reader.GetMemberReference (h); + if (reader.GetString (member.Name) != ".ctor" || member.Parent.Kind != HandleKind.TypeReference) { + return false; + } + + var parent = reader.GetTypeReference ((TypeReferenceHandle) member.Parent); + return reader.GetString (parent.Name) == "NotSupportedException"; + }); + var beginHandle = memberRefHandles.First (h => reader.GetString (reader.GetMemberReference (h).Name) == "BeginMarshalMethod"); + var endHandle = memberRefHandles.First (h => reader.GetString (reader.GetMemberReference (h).Name) == "EndMarshalMethod"); + var exHandle = memberRefHandles.First (h => reader.GetString (reader.GetMemberReference (h).Name) == "OnUserUnhandledException"); + int notSupportedExceptionCtorToken = MetadataTokens.GetToken (notSupportedExceptionCtorHandle); + int beginToken = MetadataTokens.GetToken (beginHandle); + int endToken = MetadataTokens.GetToken (endHandle); + int exToken = MetadataTokens.GetToken (exHandle); + Assert.True (ILContainsNewobjToken (ilBytes, notSupportedExceptionCtorToken), "open-generic nctor_*_uco IL should construct NotSupportedException"); + Assert.True (ilBytes.Contains ((byte) ILOpCode.Throw), "open-generic nctor_*_uco IL should throw"); + Assert.True (ILContainsCallToken (ilBytes, beginToken), "open-generic nctor_*_uco IL should call BeginMarshalMethod"); + Assert.True (ILContainsCallToken (ilBytes, endToken), "open-generic nctor_*_uco IL should call EndMarshalMethod"); + Assert.True (ILContainsCallToken (ilBytes, exToken), "open-generic nctor_*_uco IL should call OnUserUnhandledException"); } [Fact] diff --git a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapModelBuilderTests.cs b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapModelBuilderTests.cs index 15331e47fb4..ee29afa9466 100644 --- a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapModelBuilderTests.cs +++ b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapModelBuilderTests.cs @@ -16,6 +16,12 @@ static TypeMapAssemblyData BuildModel (IReadOnlyList peers, string return ModelBuilder.Build (peers, outputPath, assemblyName); } + static TypeMapAssemblyData BuildModelWithArrays (IReadOnlyList peers, string? assemblyName = null, int maxArrayRank = 3) + { + var outputPath = Path.Combine (Path.GetTempPath (), (assemblyName ?? "TestTypeMap") + ".dll"); + return ModelBuilder.Build (peers, outputPath, assemblyName, maxArrayRank); + } + public class BasicStructure { [Fact] @@ -851,6 +857,238 @@ public void Build_SameInput_ProducesDeterministicOutput () } } + public class ArrayEntries + { + [Fact] + public void Build_DefaultEmitArrayEntriesFalse_NoArrayEntries () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var model = BuildModel (new [] { peer }); + + Assert.Equal (0, model.MaxArrayRank); + Assert.DoesNotContain (model.Entries, e => e.AnchorRank is not null); + } + + [Fact] + public void Build_EmitArrayEntries_SetsMaxArrayRank () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var model = BuildModelWithArrays (new [] { peer }); + + Assert.Equal (3, model.MaxArrayRank); + } + + [Fact] + public void Build_EmitArrayEntries_HonoursMaxArrayRank () + { + // Caller can ask for fewer or more ranks than the default. Verifies the + // $(_AndroidTrimmableTypeMapMaxArrayRank) MSBuild property's effect. + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + + var model5 = BuildModelWithArrays (new [] { peer }, maxArrayRank: 5); + Assert.Equal (5, model5.MaxArrayRank); + var rank5Entries = model5.Entries.Where (e => e.AnchorRank is not null).ToList (); + Assert.Equal (5, rank5Entries.Count); + Assert.Equal ("Foo.Bar[][][][][], App", rank5Entries.Single (e => e.AnchorRank == 5).TargetTypeReference); + + var model1 = BuildModelWithArrays (new [] { peer }, maxArrayRank: 1); + Assert.Equal (1, model1.MaxArrayRank); + Assert.Single (model1.Entries, e => e.AnchorRank is not null); + } + + [Fact] + public void Build_EmitArrayEntries_EmitsRanks1Through3 () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var model = BuildModelWithArrays (new [] { peer }); + + var arrayEntries = model.Entries.Where (e => e.AnchorRank is not null).ToList (); + Assert.Equal (3, arrayEntries.Count); + Assert.Equal (new int? [] { 1, 2, 3 }, arrayEntries.Select (e => e.AnchorRank).ToArray ()); + Assert.All (arrayEntries, e => Assert.Equal ("foo/Bar", e.JniName)); + } + + [Fact] + public void Build_EmitArrayEntries_KeyIsElementJniName () + { + // No "[L...;" prefix at runtime — the key is the bare element JNI name and rank + // is encoded by which sentinel anchor (TGroup) the entry uses. + var peer = MakeMcwPeer ("java/lang/String", "System.String", "System.Runtime"); + var model = BuildModelWithArrays (new [] { peer }); + + var arrayEntries = model.Entries.Where (e => e.AnchorRank is not null).ToList (); + Assert.All (arrayEntries, e => Assert.Equal ("java/lang/String", e.JniName)); + Assert.All (arrayEntries, e => Assert.False (e.JniName.StartsWith ("[", StringComparison.Ordinal))); + } + + [Fact] + public void Build_EmitArrayEntries_TrimTargetIsClosedArrayType () + { + // 3rd ctor arg = the closed array type itself, so ILC's per-shape conditional + // drops the entry when the array shape is never constructed. + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var model = BuildModelWithArrays (new [] { peer }); + + var rank1 = model.Entries.Single (e => e.AnchorRank == 1); + Assert.Equal ("Foo.Bar[], App", rank1.ProxyTypeReference); + Assert.Equal ("Foo.Bar[], App", rank1.TargetTypeReference); + var rank2 = model.Entries.Single (e => e.AnchorRank == 2); + Assert.Equal ("Foo.Bar[][], App", rank2.ProxyTypeReference); + Assert.Equal ("Foo.Bar[][], App", rank2.TargetTypeReference); + var rank3 = model.Entries.Single (e => e.AnchorRank == 3); + Assert.Equal ("Foo.Bar[][][], App", rank3.ProxyTypeReference); + Assert.Equal ("Foo.Bar[][][], App", rank3.TargetTypeReference); + } + + [Fact] + public void Build_EmitArrayEntries_AllConditional () + { + // 2-arg unconditional makes no sense for arrays — the trim conditioning on the + // array shape is the whole point. + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var model = BuildModelWithArrays (new [] { peer }); + + foreach (var entry in model.Entries.Where (e => e.AnchorRank is not null)) { + Assert.False (entry.IsUnconditional); + Assert.NotNull (entry.TargetTypeReference); + } + } + + [Fact] + public void Build_EmitArrayEntries_OpenGenericPeer_Skipped () + { + // typeof(JavaList<>[]) is not a valid IL token. + var openGeneric = MakeMcwPeer ("java/util/ArrayList", "Android.Runtime.JavaList`1", "Mono.Android") + with { IsGenericDefinition = true }; + var model = BuildModelWithArrays (new [] { openGeneric }); + + Assert.DoesNotContain (model.Entries, e => e.AnchorRank is not null); + } + + [Fact] + public void Build_EmitArrayEntries_AliasGroup_Skipped () + { + // Alias groups (multiple peers sharing one JNI name) would produce duplicate + // JNI array keys; deferred pending an alias-aware design. + var peers = new List { + MakeMcwPeer ("test/Dup", "Test.First", "App"), + MakeMcwPeer ("test/Dup", "Test.Second", "App"), + }; + var model = BuildModelWithArrays (peers); + + Assert.DoesNotContain (model.Entries, e => e.AnchorRank is not null); + } + + [Theory] + [InlineData ("Z")] + [InlineData ("B")] + [InlineData ("C")] + [InlineData ("S")] + [InlineData ("I")] + [InlineData ("J")] + [InlineData ("F")] + [InlineData ("D")] + public void Build_EmitArrayEntries_PrimitiveJniKeyword_Skipped (string jniKeyword) + { + // Primitive JNI keyword keys are handled by the legacy + // JniRuntime.JniTypeManager.GetPrimitiveArrayTypesForSimpleReference path. + // Emitting array entries here would shadow that built-in handling. + var peer = MakeMcwPeer (jniKeyword, "FakePrimitive.Wrapper", "App"); + var model = BuildModelWithArrays (new [] { peer }); + + Assert.DoesNotContain (model.Entries, e => e.AnchorRank is not null); + } + + [Fact] + public void Build_EmitArrayEntries_MultiplePeers_GetIndependentTrios () + { + var peers = new List { + MakeMcwPeer ("foo/A", "Foo.A", "App"), + MakeMcwPeer ("foo/B", "Foo.B", "App"), + }; + var model = BuildModelWithArrays (peers); + + var arrayEntries = model.Entries.Where (e => e.AnchorRank is not null).ToList (); + Assert.Equal (6, arrayEntries.Count); // 2 peers × 3 ranks + + foreach (var jni in new [] { "foo/A", "foo/B" }) { + var perPeer = arrayEntries.Where (e => e.JniName == jni).OrderBy (e => e.AnchorRank).ToList (); + Assert.Equal (3, perPeer.Count); + Assert.Equal (new int? [] { 1, 2, 3 }, perPeer.Select (e => e.AnchorRank).ToArray ()); + } + } + } + + public class ArrayEntriesPeBlob + { + [Fact] + public void FullPipeline_ArrayEntries_DefinesPrivateRankAnchors () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var outputPath = Path.Combine (Path.GetTempPath (), "ArrSentinels.dll"); + var model = ModelBuilder.Build (new [] { peer }, outputPath, "ArrSentinels", maxArrayRank: 3); + Assert.Equal (3, model.MaxArrayRank); + + EmitAndVerify (model, "ArrSentinels", (pe, reader) => { + var typeDefNames = reader.TypeDefinitions + .Select (h => reader.GetString (reader.GetTypeDefinition (h).Name)) + .ToHashSet (StringComparer.Ordinal); + Assert.Contains ("__ArrayMapRank1", typeDefNames); + Assert.Contains ("__ArrayMapRank2", typeDefNames); + Assert.Contains ("__ArrayMapRank3", typeDefNames); + + var rankTypeRefs = reader.TypeReferences + .Select (h => reader.GetTypeReference (h)) + .Where (t => reader.GetString (t.Name).StartsWith ("__ArrayMapRank", StringComparison.Ordinal)) + .Select (t => reader.GetString (t.Name)) + .ToHashSet (StringComparer.Ordinal); + Assert.Empty (rankTypeRefs); + }); + } + + [Fact] + public void FullPipeline_NoArrayEntries_DoesNotReferenceRankAnchors () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var outputPath = Path.Combine (Path.GetTempPath (), "NoArrSentinels.dll"); + var model = ModelBuilder.Build (new [] { peer }, outputPath, "NoArrSentinels"); + Assert.Equal (0, model.MaxArrayRank); + + EmitAndVerify (model, "NoArrSentinels", (pe, reader) => { + var typeDefNames = reader.TypeDefinitions + .Select (h => reader.GetString (reader.GetTypeDefinition (h).Name)) + .ToHashSet (StringComparer.Ordinal); + Assert.DoesNotContain ("__ArrayMapRank1", typeDefNames); + Assert.DoesNotContain ("__ArrayMapRank2", typeDefNames); + Assert.DoesNotContain ("__ArrayMapRank3", typeDefNames); + + var typeRefNames = reader.TypeReferences + .Select (h => reader.GetString (reader.GetTypeReference (h).Name)) + .ToHashSet (StringComparer.Ordinal); + Assert.DoesNotContain ("__ArrayMapRank1", typeRefNames); + Assert.DoesNotContain ("__ArrayMapRank2", typeRefNames); + Assert.DoesNotContain ("__ArrayMapRank3", typeRefNames); + }); + } + + [Fact] + public void FullPipeline_ArrayEntries_AttributeBlobsRoundTrip () + { + var peer = MakeMcwPeer ("foo/Bar", "Foo.Bar", "App"); + var outputPath = Path.Combine (Path.GetTempPath (), "ArrBlobs.dll"); + var model = ModelBuilder.Build (new [] { peer }, outputPath, "ArrBlobs", maxArrayRank: 3); + + EmitAndVerify (model, "ArrBlobs", (pe, reader) => { + var attrs = ReadAllTypeMapAttributeBlobs (reader); + + // Three array entries should round-trip with the same JNI key + array trim targets. + Assert.Contains (attrs, a => a.jniName == "foo/Bar" && a.targetRef == "Foo.Bar[], App"); + Assert.Contains (attrs, a => a.jniName == "foo/Bar" && a.targetRef == "Foo.Bar[][], App"); + Assert.Contains (attrs, a => a.jniName == "foo/Bar" && a.targetRef == "Foo.Bar[][][], App"); + }); + } + } + static void EmitAndVerify (TypeMapAssemblyData model, string assemblyName, Action verify) { var stream = new MemoryStream (); diff --git a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/JavaPeerScannerTests.cs b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/JavaPeerScannerTests.cs index 4864ff291cd..4db2452d637 100644 --- a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/JavaPeerScannerTests.cs +++ b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/JavaPeerScannerTests.cs @@ -99,12 +99,13 @@ public void Scan_RegisterAttribute_DotFormat_NormalizedToSlashes () } [Theory] - [InlineData ("MyApp.PlainActivitySubclass", "crc64eb3df85c64aa1af6/PlainActivitySubclass")] - [InlineData ("MyApp.UnregisteredClickListener", "crc64eb3df85c64aa1af6/UnregisteredClickListener")] - [InlineData ("MyApp.UnregisteredExporter", "crc64eb3df85c64aa1af6/UnregisteredExporter")] - public void Scan_UnregisteredType_UsesCrc64PackageName (string managedName, string expectedJavaName) + [InlineData ("MyApp.PlainActivitySubclass", "PlainActivitySubclass")] + [InlineData ("MyApp.UnregisteredClickListener", "UnregisteredClickListener")] + [InlineData ("MyApp.UnregisteredExporter", "UnregisteredExporter")] + public void Scan_UnregisteredType_UsesHashedPackageName (string managedName, string expectedJavaName) { - Assert.Equal (expectedJavaName, FindFixtureByManagedName (managedName).JavaName); + Assert.Equal ($"crc64{ScannerHashingHelper.ToCrc64 ("MyApp", "TestFixtures")}/{expectedJavaName}", + FindFixtureByManagedName (managedName).JavaName); } [Fact] @@ -156,4 +157,17 @@ public void Scan_JniTypeSignature_ArrayRank_IsExcluded () // Non-keyword array (e.g., JavaObjectArray with "java/lang/Object", ArrayRank=1) Assert.DoesNotContain (peers, p => p.ManagedTypeName == "Java.Interop.TestTypes.NonKeywordArrayType"); } + + [Fact] + public void Scan_UnregisteredType_Crc64Default_DiffersFromLegacyLowercaseCrc64Policy () + { + const string managedName = "MyApp.PlainActivitySubclass"; + var withCrc64 = FindFixtureByManagedName (managedName).JavaName; + var withLowercaseCrc64 = FindFixtureByManagedName (managedName, "LowercaseCrc64").JavaName; + + Assert.Equal ($"crc64{ScannerHashingHelper.ToCrc64 ("MyApp", "TestFixtures")}/PlainActivitySubclass", withCrc64); + Assert.Equal ("crc64ec59e927bc71f4d8/PlainActivitySubclass", withLowercaseCrc64); + Assert.NotEqual (withCrc64, withLowercaseCrc64); + } + } diff --git a/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/ScannerHashingHelperTests.cs b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/ScannerHashingHelperTests.cs new file mode 100644 index 00000000000..c3031aac384 --- /dev/null +++ b/tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Scanner/ScannerHashingHelperTests.cs @@ -0,0 +1,32 @@ +using Xunit; + +namespace Microsoft.Android.Sdk.TrimmableTypeMap.Tests; + +public class ScannerHashingHelperTests +{ + [Theory] + [InlineData ("MyApp", "TestFixtures", "ec59e927bc71f4d8")] + [InlineData ("System.Collections.Generic", "My.Assembly", "9ff866e93b19f500")] + [InlineData ("Hello", "World", "f6bdbfa73a558c54")] + public void ToLegacyCrc64_KnownInputs_HaveStableOutput (string ns, string assemblyName, string expected) + { + Assert.Equal (expected, ScannerHashingHelper.ToLegacyCrc64 (ns, assemblyName)); + } + + [Theory] + [InlineData ("MyApp", "TestFixtures", "f93df85c64aa1af6")] + [InlineData ("System.Collections.Generic", "My.Assembly", "663b37c9b3a5014d")] + [InlineData ("Hello", "World", "442a517f331e7a2c")] + public void ToCrc64_KnownInputs_HaveStableOutput (string ns, string assemblyName, string expected) + { + Assert.Equal (expected, ScannerHashingHelper.ToCrc64 (ns, assemblyName)); + } + + [Fact] + public void ToCrc64_DifferentLengthsOfZeroBytes_HaveDifferentOutput () + { + Assert.NotEqual ( + ScannerHashingHelper.ToCrc64 ("\0", ""), + ScannerHashingHelper.ToCrc64 ("\0\0\0\0", "")); + } +} diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs index 148c7dc9383..0eacc4eddad 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs @@ -121,7 +121,6 @@ public void InvokingNullInstanceDoesNotCrashDalvik () } } - // TODO: https://github.com/dotnet/android/issues/11170 — open generic creation should throw but succeeds under trimmable typemap [Test] public void NewOpenGenericTypeThrows () { diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/TrimmableTypeMapTypeManagerTests.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/TrimmableTypeMapTypeManagerTests.cs index 54459642bd7..44671758e54 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/TrimmableTypeMapTypeManagerTests.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/TrimmableTypeMapTypeManagerTests.cs @@ -179,6 +179,18 @@ public void RegisteredPeer_CanCreateGenericHolder () Assert.AreEqual (42, holder.Value); } + [Test] + public void TryGetArrayType_PrimitiveLeaf_DoesNotRequireRankMapEntry () + { + AssumeTrimmableTypeMapEnabled (); + + Assert.IsTrue (TrimmableTypeMap.Instance.TryGetArrayType (typeof (byte), out var byteArrayType)); + Assert.AreEqual (typeof (byte[]), byteArrayType); + + Assert.IsTrue (TrimmableTypeMap.Instance.TryGetArrayType (typeof (byte[]), out var jaggedByteArrayType)); + Assert.AreEqual (typeof (byte[][]), jaggedByteArrayType); + } + static ConcurrentDictionary GetProxyCache (TrimmableTypeMap instance) { var field = typeof (TrimmableTypeMap).GetField ("_proxyCache", BindingFlags.Instance | BindingFlags.NonPublic); diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj b/tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj index 6b686ecb8a6..f1575d1e45d 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj @@ -76,8 +76,8 @@ + - <_AndroidRemapMembers Include="Remaps.xml" /> <_AndroidRemapMembers Include="IsAssignableFromRemaps.xml" Condition=" '$(_AndroidIsAssignableFromCheck)' == 'false' " /> diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/StartupHookRoots.xml b/tests/Mono.Android-Tests/Mono.Android-Tests/StartupHookRoots.xml deleted file mode 100644 index 59a0ba9e565..00000000000 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/StartupHookRoots.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/System.Net/ProxyTest.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/System.Net/ProxyTest.cs index a46f56f70f0..10fb4158ed8 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/System.Net/ProxyTest.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/System.Net/ProxyTest.cs @@ -13,20 +13,27 @@ public class ProxyTest { [Test] public void QuoteInvalidQuoteUrlsShouldWork () { - string url = "http://www.msftconnecttest.com/connecttest.txt?query&foo|bar"; - var request = (HttpWebRequest) WebRequest.Create (url); - request.Method = "GET"; - var response = (HttpWebResponse) request.GetResponse (); - int len = 0; - using (var _r = new StreamReader (response.GetResponseStream ())) { - char[] buf = new char [4096]; - int n; - while ((n = _r.Read (buf, 0, buf.Length)) > 0) { - /* ignore; we just want to make sure we can read */ - len += n; + try { + string url = "http://www.msftconnecttest.com/connecttest.txt?query&foo|bar"; + var request = (HttpWebRequest) WebRequest.Create (url); + request.Method = "GET"; + var response = (HttpWebResponse) request.GetResponse (); + int len = 0; + using (var _r = new StreamReader (response.GetResponseStream ())) { + char[] buf = new char [4096]; + int n; + while ((n = _r.Read (buf, 0, buf.Length)) > 0) { + /* ignore; we just want to make sure we can read */ + len += n; + } } + Assert.IsTrue (len > 0); + } catch (WebException ex) when ( + ex.Status == WebExceptionStatus.ConnectFailure || + ex.Status == WebExceptionStatus.NameResolutionFailure || + ex.Status == WebExceptionStatus.Timeout) { + Assert.Ignore ($"Ignoring network failure: {ex.Message}"); } - Assert.IsTrue (len > 0); } } } diff --git a/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs b/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs index b2a9ecabeeb..d69013f4063 100644 --- a/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs +++ b/tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs @@ -53,10 +53,6 @@ protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer) "Java.InteropTests.JniValueMarshaler_object_ContractTests.JniValueMarshalerContractTests`1.CreateValue", "Java.InteropTests.JniValueMarshaler_object_ContractTests.SpecificTypesAreUsed", - // net.dot.jni.test.GetThis static init — same JavaProxy* - // root cause as the JavaProxyObject exclusions above. - "Java.InteropTests.JavaObjectTest.DisposeAccessesThis", - // net.dot.jni.internal.JavaProxyThrowable static init — same JavaProxy* // root cause as the JavaProxyObject exclusions above. "Java.InteropTests.JavaExceptionTests.InnerExceptionIsNotAProxy", @@ -67,12 +63,6 @@ protected NUnitInstrumentation(IntPtr handle, JniHandleOwnership transfer) "Java.InteropTests.JniPeerMembersTests.ReplacementTypeUsedForMethodLookup", "Java.InteropTests.JniPeerMembersTests.ReplaceStaticMethodName", - // net.dot.jni.test.GenericHolder Java class not in APK - "Java.InteropTests.JniTypeManagerTests.CannotCreateGenericHolderFromJava", - - // Open generic type handling differs from non-trimmable - "Java.InteropTests.JnienvTest.NewOpenGenericTypeThrows", - // Throwable subclass registration "Java.InteropTests.JnienvTest.ActivatedDirectThrowableSubclassesShouldBeRegistered", diff --git a/tests/api-compatibility/acceptable-breakages-v17.0.txt b/tests/api-compatibility/acceptable-breakages-v17.0.txt new file mode 100644 index 00000000000..2e25ba6dbf5 --- /dev/null +++ b/tests/api-compatibility/acceptable-breakages-v17.0.txt @@ -0,0 +1,13 @@ +Compat issues with assembly Mono.Android: +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothAdapter.StartLeScan(Android.Bluetooth.BluetoothAdapter.ILeScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothAdapter.StartLeScan(Java.Util.UUID[], Android.Bluetooth.BluetoothAdapter.ILeScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothDevice.SetPin(System.Byte[])' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(Android.Bluetooth.LE.ScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(System.Collections.Generic.IList, Android.Bluetooth.LE.ScanSettings, Android.App.PendingIntent)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(System.Collections.Generic.IList, Android.Bluetooth.LE.ScanSettings, Android.Bluetooth.LE.ScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Hardware.Fingerprints.FingerprintManager.HasEnrolledFingerprints.get()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Hardware.Fingerprints.FingerprintManager.IsHardwareDetected.get()' in the contract but not the implementation. +MembersMustExist : Member 'public void Android.Telecom.CallControl.Answer(Android.Telecom.CallType, Java.Util.Concurrent.IExecutor, Android.OS.IOutcomeReceiver)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public void Android.Telecom.CallControl.RequestVideoState(Android.Telecom.CallType, Java.Util.Concurrent.IExecutor, Android.OS.IOutcomeReceiver)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'Android.Text.IInputType' does not exist in the implementation but it does exist in the contract. +CannotRemoveBaseTypeOrInterface : Type 'Android.Views.InputMethods.EditorInfo' does not implement interface 'Android.Text.IInputType' in the implementation but it does in the contract. diff --git a/tests/api-compatibility/acceptable-breakages-vReference-net11.0.txt b/tests/api-compatibility/acceptable-breakages-vReference-net11.0.txt index 3d4428380e5..2b2518ec5e3 100644 --- a/tests/api-compatibility/acceptable-breakages-vReference-net11.0.txt +++ b/tests/api-compatibility/acceptable-breakages-vReference-net11.0.txt @@ -35,3 +35,15 @@ CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.ObsoletedOSPlatform CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.ObsoletedOSPlatformAttribute' exists on 'Android.Net.Wifi.WifiConfiguration.Status' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Telephony.TelephonyManager.IsMultiSimSupported()' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Telephony.TelephonyManager.UiccCardsInfo.get()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothAdapter.StartLeScan(Android.Bluetooth.BluetoothAdapter.ILeScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothAdapter.StartLeScan(Java.Util.UUID[], Android.Bluetooth.BluetoothAdapter.ILeScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.BluetoothDevice.SetPin(System.Byte[])' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(Android.Bluetooth.LE.ScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(System.Collections.Generic.IList, Android.Bluetooth.LE.ScanSettings, Android.App.PendingIntent)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Bluetooth.LE.BluetoothLeScanner.StartScan(System.Collections.Generic.IList, Android.Bluetooth.LE.ScanSettings, Android.Bluetooth.LE.ScanCallback)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Hardware.Fingerprints.FingerprintManager.HasEnrolledFingerprints.get()' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'Android.Runtime.RequiresPermissionAttribute' exists on 'Android.Hardware.Fingerprints.FingerprintManager.IsHardwareDetected.get()' in the contract but not the implementation. +MembersMustExist : Member 'public void Android.Telecom.CallControl.Answer(Android.Telecom.CallType, Java.Util.Concurrent.IExecutor, Android.OS.IOutcomeReceiver)' does not exist in the implementation but it does exist in the contract. +MembersMustExist : Member 'public void Android.Telecom.CallControl.RequestVideoState(Android.Telecom.CallType, Java.Util.Concurrent.IExecutor, Android.OS.IOutcomeReceiver)' does not exist in the implementation but it does exist in the contract. +TypesMustExist : Type 'Android.Text.IInputType' does not exist in the implementation but it does exist in the contract. +CannotRemoveBaseTypeOrInterface : Type 'Android.Views.InputMethods.EditorInfo' does not implement interface 'Android.Text.IInputType' in the implementation but it does in the contract.