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

Simplify Android and iOS packages #561

Open
bricelam opened this issue Nov 6, 2023 · 7 comments
Open

Simplify Android and iOS packages #561

bricelam opened this issue Nov 6, 2023 · 7 comments

Comments

@bricelam
Copy link
Contributor

bricelam commented Nov 6, 2023

While creating a new provider, I noticed that a few things could be simplified in the current iOS and Android library packages.


SQLitePCLRaw.lib.e_sqlite3.ios (before)

  • build\
    • SQLitePCLRaw.lib.e_sqlite3.ios.targets
  • static\
    • device\e_sqlite3.a (arm64, armv7, armv7s)
    • simulator\e_sqlite3.a (arm64, i386, x86_64)

SQLitePCLRaw.lib.e_sqlite3.ios (after)

  • build\
    • xamarinios10\
      • SQLitePCLRaw.lib.e_sqlite3.ios.targets
  • runtimes\
    • ios-arm\native\e_sqlite3.a (armv7, armv7s)
    • ios-arm64\native\e_sqlite3.a (arm64)
    • iossimulator-arm64\native\e_sqlite3.a (arm64)
    • iossimulator-x64\native\e_sqlite3.a (x86_64)
    • iossimulator-x86\native\e_sqlite3.a (i386)

The .a files can be more fine-grained and put in a directory where they'll automatically be picked up by net6.0-ios. The .targets file will only be needed for Xamarin.


SQLitePCLRaw.lib.e_sqlite3.android (before)

  • lib\
    • net6.0-android\
      • SQLitePCLRaw.lib.e_sqlite3.android.aar (armeabi-v7a, arm64-v8a, x86, x86_64)

SQLitePCLRaw.lib.e_sqlite3.android (after)

  • build\
    • monoandroid90\
      • SQLitePCLRaw.lib.e_sqlite3.android.targets
  • runtimes\
    • android-arm\native\libe_sqlite3.so (armeabi-v7a)
    • android-arm64\native\libe_sqlite3.so (arm64-v8a)
    • android-x64\native\libe_sqlite3.so (x86_64)
    • android-x86\native\libe_sqlite3.so (x86)

Similar to iOS, the .so files can be placed directly in the package where they'll be picked up by net6.0-android. A new .targets file could be used for Xamarin to include the .so files as EmbeddedNativeLibrary items directly inside the user's project.

@ericsink
Copy link
Owner

ericsink commented Nov 7, 2023

This looks like a candidate to try in my new no-xamarin branch. :-)

@ericsink
Copy link
Owner

ericsink commented Nov 29, 2023

Looking at the setup you had over in the SQLite3MultipleCiphers-NuGet repo...

If I'm dropping support for classic Xamarin, it looks like I don't even really need separate lib packages for android and iOS anymore?

You've got all the binaries in one simple nupkg.

It doesn't seem like you even needed the android workload to do a build.

@bricelam
Copy link
Contributor Author

Yep, I tested it all on iOS and Android and it worked great

@bricelam
Copy link
Contributor Author

bricelam commented Nov 29, 2023

I was very proud of how much I was able to simplify things. I'm glad you took the time to look at it.

@ericsink
Copy link
Owner

ericsink commented Dec 7, 2023

Update: I am making progress, but I'm taking the slow way, moving toward the simplified approach incrementally, making sure I understand each step.

@ericsink
Copy link
Owner

ericsink commented Dec 19, 2023

Hmmm. @bricelam I just noticed that you generated the sqlite3 provider with FEATURE_FUNCPTRS/false, using old style MonoPInvokeCallback instead of the more modern C# function pointers with UnmanagedCallersOnly. That's a bit surprising. In a post-classic-Xamarin world, I'm assuming I can just dump the old way.

(Followup later: Ah, it's because of netstandard2.0)

Given your job transition, if I should stop tagging you on things, let me know. :-)

@bricelam
Copy link
Contributor Author

lol, never stop tagging me! I'll catch up on GitHub as time permits. Yes, it was for netstandard2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants