native icon indicating copy to clipboard operation
native copied to clipboard

[native_assets_cli] Add `JarAsset`s

Open dcharkes opened this issue 1 year ago • 6 comments
trafficstars

  • [ ] Add a new JarAsset in the API.
  • [ ] Consume that asset type in flutter_tools.
  • [ ] Consume that asset type in Dart standalone. (optional)

This would solve:

  • https://github.com/dart-lang/native/issues/576

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 avatar Jul 17 '24 08:07 dcharkes

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.)

dcharkes avatar Jul 18 '24 08:07 dcharkes

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.

HosseinYousefi avatar Jul 18 '24 08:07 HosseinYousefi

minimumAndroidSdk

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

dcharkes avatar Jul 18 '24 08:07 dcharkes

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.

HosseinYousefi avatar Jul 18 '24 08:07 HosseinYousefi

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.)

dcharkes avatar Jul 18 '24 08:07 dcharkes

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

Always-Has-Been

HosseinYousefi avatar Jul 18 '24 08:07 HosseinYousefi