dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
115 stars 39 forks source link

[native_assets_cli] Add `JarAsset`s #1350

Open dcharkes opened 1 month ago

dcharkes commented 1 month ago

This would solve:

We didn't have a tracking bug for this yet, just some loose references in various places (for example https://github.com/dart-lang/native/issues/878#issuecomment-2222506593).

dcharkes commented 1 month ago

We also need a BuildConfig.targetJavaVersion that can be passed to javac as -target $version. (Note this should be a Version or String in the API, as versions such as 1.6 occur.)

HosseinYousefi commented 1 month ago

We also need a BuildConfig.targetJavaVersion that can be passed to javac as -target $version. (Note this should be a Version or String in the API, as versions such as 1.6 occur.)

And a minimumAndroidSdk.

This also allows us to evaluate android sdk version comparisons at compile time and tree shake unused code away similar to how Platform.isFoo does it. We had this discussion with @mkustermann before. One question is where to put "Android.sdkVersion". For now it's only accessible from Flutter but we could decide to have a specific android target in mind when compiling Dart standalone as well which we can pass in pubspec.yaml.

dcharkes commented 1 month ago

minimumAndroidSdk

https://pub.dev/documentation/native_assets_cli/latest/native_assets_cli/HookConfig/targetAndroidNdkApi.html

HosseinYousefi commented 1 month ago

minimumAndroidSdk

https://pub.dev/documentation/native_assets_cli/latest/native_assets_cli/HookConfig/targetAndroidNdkApi.html

That seems like a confusing name though because we also have a targetSdkVersion.

dcharkes commented 1 month ago

minimumAndroidSdk

https://pub.dev/documentation/native_assets_cli/latest/native_assets_cli/HookConfig/targetAndroidNdkApi.html

That seems like a confusing name though because we also have a targetSdkVersion.

It seems that the reviewer on https://github.com/dart-lang/native/pull/49 should have done more bike shedding! 🤔

(Note: I have never seen someone use target SDK and max SDK versions. The NDK compiler doesn't even take take them as options. Only min SDK is implemented there. And it's not called min. It's just the target tripple.)

HosseinYousefi commented 1 month ago

It seems that the reviewer on #49 should have done more bike shedding! 🤔

Always-Has-Been