Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.2

* Fixed NDK path resolution on Windows by using `USERPROFILE` and normalizing path separators.

## 0.1.1

* Updated `native_toolchain_c` to `0.18.0`.
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.0"
version: "0.1.1"
archive:
dependency: transitive
description:
Expand Down
11 changes: 7 additions & 4 deletions lib/src/locate_ndk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,13 @@ class NDKLocator {

/// Expands a path template with environment variables and glob patterns.
static List<FileSystemEntity> expandPath(String pathTemplate) {
final path = pathTemplate.replaceAll(
'\$HOME',
Platform.environment['HOME']!,
);
// Use platform-dependent environment variables for the user's home directory
final homeDir = Platform.isWindows
? Platform.environment['USERPROFILE'] ?? ''
: Platform.environment['HOME'] ?? '';
// Glob requires forward slashes, and USERPROFILE uses backslashes
final normalizedHomeDir = homeDir.replaceAll('\\', '/');
final path = pathTemplate.replaceAll('\$HOME', normalizedHomeDir);
final glob = Glob(path);
final matches = glob.listSync();
return matches;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: android_libcpp_shared
description: "Dart / flutter package for Android to add the libc++_shared.so STL C++ shared runtime library to your app"
version: 0.1.1
version: 0.1.2
homepage: https://zeyus.com/
repository: https://github.com/NexusDynamic/android_libcpp_shared
issue_tracker: https://github.com/NexusDynamic/android_libcpp_shared/issues
Expand Down