Skip to content

Commit

Permalink
Fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Apr 11, 2024
1 parent 11c6893 commit c3fef2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/realm_dart/lib/src/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ String _getLibPathFlutter() {
TargetOsType.android => nativeLibraryName,
TargetOsType.ios => p.join(root, 'Frameworks', 'realm_dart.framework', nativeLibraryName),
TargetOsType.linux => p.join(root, 'lib', nativeLibraryName),
TargetOsType.macos => p.join(root, 'Frameworks', nativeLibraryName),
TargetOsType.macos => p.join(p.dirname(root), 'Frameworks', nativeLibraryName),
TargetOsType.windows => nativeLibraryName,
};
}

String _getLibPathFlutterTest(Package realmPackage) {
assert(realmPackage.name == 'realm');
final root = p.join(realmPackage.root.path, targetOsType.name);
final root = p.join(realmPackage.root.toFilePath(), targetOsType.name);
return switch (targetOsType) {
TargetOsType.linux => p.join(root, 'binary', 'linux', nativeLibraryName),
TargetOsType.macos => p.join(root, nativeLibraryName),
Expand All @@ -43,7 +43,7 @@ String _getLibPathFlutterTest(Package realmPackage) {

String _getLibPathDart(Package realmDartPackage) {
assert(realmDartPackage.name == 'realm_dart');
final root = p.join(realmDartPackage.root.path, 'binary', targetOsType.name);
final root = p.join(realmDartPackage.root.toFilePath(), 'binary', targetOsType.name);
if (targetOsType.isDesktop) {
return p.join(root, nativeLibraryName);
}
Expand Down Expand Up @@ -124,7 +124,7 @@ DynamicLibrary _openRealmLib() {
final candidatePaths = [
nativeLibraryName, // just ask OS..
p.join(_exeDirName, nativeLibraryName), // try finding it next to the executable
_getLibPathDart(realmDartPackage)
_getLibPathDart(realmDartPackage), // try finding it in the package
];
DynamicLibrary? lib;
for (final path in candidatePaths) {
Expand Down

0 comments on commit c3fef2e

Please sign in to comment.