Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ tweaks and legacy code cleanup #8638

Merged
merged 20 commits into from
Feb 9, 2024
Merged

C++ tweaks and legacy code cleanup #8638

merged 20 commits into from
Feb 9, 2024

Conversation

grendello
Copy link
Contributor

@grendello grendello commented Jan 15, 2024

Remove old and unused code for classic Xamarin.Android, Windows and Apple.
While at this, remove a collection of platform and compiler compatibility
macros, typedefs and wrapper functions.

Additionally, migrate from char arrays to std::string_view, for
more strongly typed code.

Also use collection iterator `for`
Use `std::span` and `std::array` for application library directories in
a way that allows us to avoid memory allocation in the most common
scenario (where shared libraries aren't extraced to the filesystem but
reside in one of the split apks)
* main:
  [Xamarin.Android.Build.Tasks] fix warning when missing `proguard-android.txt` (#8641)
  LEGO: Merge pull request 8642
  Fix ServerCertificateCustomValidator on API 21-23 (#8637)
* main:
  [Xamarin.Android.Build.Tasks] Add check for aapt2 invalid data path error (#8640)
* main:
  Bump com.android.tools:r8 from 8.2.33 to 8.2.42 (#8634)
* main:
  Localized file check-in by OneLocBuild Task (#8643)
* main:
  Localized file check-in by OneLocBuild Task (#8668)
  [Xamarin.Android.build.Tasks] `<CheckDuplicateJavaLibraries/>` ignores `repackaged.jar` (#8664)
  LEGO: Merge pull request 8665
  [Xamarin.Android.Build.Tasks] parse JDK `release` file directly (#8663)
  Bump to dotnet/installer@f91d4ca399 9.0.100-alpha.1.24070.3 (#8635)
  [.github] Re-enable locking issues after 30 days of inactivity (#8655)
  Localized file check-in by OneLocBuild Task (#8657)
  LEGO: Merge pull request 8656
  Localized file check-in by OneLocBuild Task (#8652)
  Bump to xamarin/xamarin-android-tools/main@b175674 (#8644)
  [Xamarin.Android.Build.Tasks] remove checks for `$(UsingAndroidNETSdk)` (#8647)
  [Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629)
* main:
  Bump external/xamarin-android-tools from `b175674` to `ed102fc` (#8667)
  Bump external/android-api-docs from `3f64bdd` to `9b7ea12` (#8672)
  [ci] Only install Android SDK API-34 on test agents. (#8670)
* main:
  [Xamarin.Android.Build.Tasks] fix net7.0 "out of support" message (#8660)
  [ci] Use NuGetAuthenticate@1 (#8676)
* main:
  Bump to dotnet/installer@5680e93cb2 9.0.100-preview.2.24073.12 (#8666)
  $(AndroidPackVersionSuffix)=preview.2; net9 is 34.99.0.preview.2 (#8678)
* main:
  Bump to dotnet/installer@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
  [Mono.Android] Cache `Profiles/api-34.xml` contents (#8679)
  [monodroid] typemaps may need to load assemblies (#8625)
  Bump $(AndroidNetPreviousVersion) to 34.0.79 (#8693)
  Bump to xamarin/java.interop/main@07c73009 (#8681)
  Bump to dotnet/installer@1c496970b7 9.0.100-preview.2.24078.1 (#8685)
  [GetAndroidDependencies] Add Jdk dependency info (#8651)
  [xaprepare] Add support for newer SparkyLinux (#8684)
* main:
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
@grendello grendello changed the title C++ tweaks C++ tweaks and legacy code cleanup Feb 7, 2024
@grendello grendello marked this pull request as ready for review February 7, 2024 21:14
@jonpryor
Copy link
Member

jonpryor commented Feb 9, 2024

Remove old and unused code originally written for:

  * Classic Xamarin.Android
  * [Xamarin.Android Designer][0] on Windows
  * Xamarin.Android Designer on macOS

Remove a collection of platform and compiler compatibility macros,
typedefs and wrapper functions.

Migrate from `char` arrays to `std::string_view` for more strongly
typed code.

Move `-fstack-clash-protection` from `LOCAL_COMMON_COMPILER_ARGS` to
`LOCAL_COMMON_LINKER_ARGS`; it's a linker flag.

Use `#pragma clang diagnostic ignored "-Warray-bounds"` around
certain "MonoVM-isms" in the GC bridge to silence array bounds
checking warnings.

Refactor to use new(er) C++ types such as `std::span`, `std::array`,
and `std::string_view`.  This helps reduce memory allocations in some
scenarios, allows usage of the newer `for (e : collection)` syntax,
and increases type safety.

[0]: https://github.com/MicrosoftDocs/xamarin-docs/blob/ff833dc5af413e10802afca108212c0a7b2d6fa2/docs/android/user-interface/android-designer/designer-basics.md

@jonpryor jonpryor merged commit 3212213 into main Feb 9, 2024
47 checks passed
@jonpryor jonpryor deleted the dev/grendel/cpp-tweaks branch February 9, 2024 20:12
grendello added a commit that referenced this pull request Feb 9, 2024
* main:
  Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
  [monodroid] C++ tweaks and legacy code cleanup (#8638)
  Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
grendello added a commit that referenced this pull request Feb 13, 2024
* main:
  [Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
  [Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
  Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
  [monodroid] C++ tweaks and legacy code cleanup (#8638)
  Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
  [readme] Add `d17-8` download links. (#8709)
  Bump external/Java.Interop from `07c7300` to `7f08b77` (#8702)
  Bump to xamarin/monodroid@848d1277b7 (#8691)
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
  Bump to dotnet/installer@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
grendello added a commit that referenced this pull request Feb 14, 2024
* main: (116 commits)
  [tmt] Update to work with current `libxamarin-app.so` (#8694)
  [Xamarin.Android.Build.Tasks] remove `$(AndroidSupportedAbis)` from `build.props` (#8717)
  [Xamarin.Android.Build.Tasks] BannedApiAnalyzers for Resolve() (#8715)
  Bump to xamarin/Java.Interop/main@dfcbd670 (#8714)
  [monodroid] C++ tweaks and legacy code cleanup (#8638)
  Bump to xamarin/xamarin-android-tools/main@a698a33 (#8710)
  [readme] Add `d17-8` download links. (#8709)
  Bump external/Java.Interop from `07c7300` to `7f08b77` (#8702)
  Bump to xamarin/monodroid@848d1277b7 (#8691)
  [Xamarin.Android.Build.Tasks] `FixAbstractMethodsStep` performance (#8650)
  Bump to dotnet/installer@fb7b9a4b9e 9.0.100-preview.2.24106.6 (#8700)
  [Mono.Android] Cache `Profiles/api-34.xml` contents (#8679)
  [monodroid] typemaps may need to load assemblies (#8625)
  Bump $(AndroidNetPreviousVersion) to 34.0.79 (#8693)
  Bump to xamarin/java.interop/main@07c73009 (#8681)
  Bump to dotnet/installer@1c496970b7 9.0.100-preview.2.24078.1 (#8685)
  [GetAndroidDependencies] Add Jdk dependency info (#8651)
  [xaprepare] Add support for newer SparkyLinux (#8684)
  Bump to dotnet/installer@5680e93cb2 9.0.100-preview.2.24073.12 (#8666)
  $(AndroidPackVersionSuffix)=preview.2; net9 is 34.99.0.preview.2 (#8678)
  ...
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants