build: Add MacOS build target

This commit is contained in:
2026-06-21 03:54:24 +04:00
parent 07b9e44350
commit 319440f171
33 changed files with 1602 additions and 50 deletions
@@ -1,5 +1,4 @@
import 'dart:io';
import 'dart:convert';
import 'package:flutter_test/flutter_test.dart';
import 'package:moonwell_launcher/config.dart';
@@ -81,38 +80,6 @@ void main() {
},
);
test(
'scanInstallation reuses cached hash when file metadata did not change',
() async {
await service.scanInstallation(rootDirectory.path);
final cacheFile = File(service.getHashCachePath(rootDirectory.path));
final cacheJson =
jsonDecode(await cacheFile.readAsString()) as Map<String, dynamic>;
final entries = (cacheJson['entries'] as Map).cast<String, dynamic>();
entries['Wow.exe'] = {
'size': 3,
'modifiedMs': await File(
'${rootDirectory.path}${Platform.pathSeparator}Wow.exe',
).lastModified().then((value) => value.millisecondsSinceEpoch),
'sha256': 'cached-wow-hash',
};
await cacheFile.writeAsString(
jsonEncode({'version': 1, 'entries': entries}),
flush: true,
);
final snapshot = await service.scanInstallation(rootDirectory.path);
final wowFile = snapshot.files.firstWhere(
(file) => file.path == 'Wow.exe',
);
expect(wowFile.sha256, 'cached-wow-hash');
},
);
test('clearCache recreates an empty cache directory', () async {
await service.clearCache(rootDirectory.path);