fix: add dummy asset to build.dart on Linux builds so we can use the package on a Linux host
This commit is contained in:
@@ -25,8 +25,26 @@ void main(List<String> args) async {
|
|||||||
// We don't support Linux (yet), so the native/Filament libraries won't be
|
// We don't support Linux (yet), so the native/Filament libraries won't be
|
||||||
// compiled/available. However, we still want to be able to run the Dart
|
// compiled/available. However, we still want to be able to run the Dart
|
||||||
// package itself on a Linux host(e.g. for dart_services backed), so if
|
// package itself on a Linux host(e.g. for dart_services backed), so if
|
||||||
// we detect that we're running on Linux, just exit here.
|
// we detect that we're running on Linux, add some dummy native code
|
||||||
|
// assets and exit early.
|
||||||
if (platform == "linux") {
|
if (platform == "linux") {
|
||||||
|
final linkMode = DynamicLoadingBundled();
|
||||||
|
final name = "thermion_dart.dart";
|
||||||
|
final libUri = config.outputDirectory
|
||||||
|
.resolve(config.targetOS.libraryFileName(name, linkMode));
|
||||||
|
output.addAssets(
|
||||||
|
[
|
||||||
|
NativeCodeAsset(
|
||||||
|
package: config.packageName,
|
||||||
|
name: name,
|
||||||
|
file: libUri,
|
||||||
|
linkMode: linkMode,
|
||||||
|
os: config.targetOS,
|
||||||
|
architecture: config.dryRun ? null : config.targetArchitecture,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
linkInPackage: null,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user