Skip to content

Commit

Permalink
fix: Sometimes VC libraries are not copied
Browse files Browse the repository at this point in the history
  • Loading branch information
YehudaKremer committed Mar 14, 2021
1 parent dfbabd5 commit b288438
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.1.17
## 0.1.18

- fix: Sometimes VC libraries are not copied - https://github.com/YehudaKremer/msix/issues/30

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In your `pubspec.yaml`, add `msix` as a new dependency.
dev_dependencies:
flutter_test:
sdk: flutter
msix: ^0.1.17
msix: ^0.1.18
```
## Create Msix
Expand Down
2 changes: 1 addition & 1 deletion lib/msix.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Msix {
await _msixFiles.createIconsFolder();
await _msixFiles.copyIcons();
await _msixFiles.generateAppxManifest();
await _msixFiles.copyVCLibsFiles();
_msixFiles.copyVCLibsFiles();

if (!isNullOrStringNull(_configuration.vsGeneratedImagesFolderPath)) {
stdout.write(white('generate PRI file.. '));
Expand Down
6 changes: 3 additions & 3 deletions lib/src/msixFiles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class MsixFiles {
File('${_configuration.defaultsIconsFolderPath()}/150_150.png').path);
} else {
final vsImages =
await allDirectoryFiles(_configuration.vsGeneratedImagesFolderPath);
allDirectoryFiles(_configuration.vsGeneratedImagesFolderPath);

await Directory('${_configuration.buildFilesFolder}/Images')
.create(recursive: true);
Expand Down Expand Up @@ -206,10 +206,10 @@ class MsixFiles {
print(green('[√]'));
}

Future<void> copyVCLibsFiles() async {
void copyVCLibsFiles() {
stdout.write(white('copy VCLibs files.. '));

_vCLibsFiles = await allDirectoryFiles(
_vCLibsFiles = allDirectoryFiles(
'${_configuration.vcLibsFolderPath()}/${_configuration.architecture}');

for (var file in _vCLibsFiles) {
Expand Down
15 changes: 7 additions & 8 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import 'dart:async';
import 'dart:io';
import 'constants.dart';

bool isNullOrStringNull(String value) => value == null || value == 'null';

Future<List<File>> allDirectoryFiles(String directory) async {
List<File> allDirectoryFiles(String directory) {
List<File> frameworkFilePaths = [];

await Directory(directory)
.list(recursive: true, followLinks: false)
.listen((FileSystemEntity entity) async {
var file = File(entity.path);
var files =
Directory(directory).listSync(recursive: true, followLinks: false);

if (await file.exists()) frameworkFilePaths.add(file);
}).asFuture();
for (var file in files) {
var currnetFile = File(file.path);
if (currnetFile.existsSync()) frameworkFilePaths.add(currnetFile);
}

return frameworkFilePaths;
}
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: msix
description: Create and sign Msix installer for flutter windows-build files.
version: 0.1.17
version: 0.1.18
maintainer: Yehuda Kremer ([email protected])
homepage: https://github.com/YehudaKremer/msix

Expand Down

0 comments on commit b288438

Please sign in to comment.