Skip to content

Commit

Permalink
Merge 941bbd1 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 10, 2022
2 parents eb9e83b + 941bbd1 commit 4b81e6a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
3 changes: 3 additions & 0 deletions bin/exe2dist.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: (c) 2022 Artsiom iG <github.com/rtmigo>
// SPDX-License-Identifier: MIT

import 'dart:io';

import 'package:glob/glob.dart';
Expand Down
3 changes: 3 additions & 0 deletions bin/source/architecture.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: (c) 2022 Artsiom iG <github.com/rtmigo>
// SPDX-License-Identifier: MIT

import 'dart:io';

import 'expections.dart';
Expand Down
14 changes: 9 additions & 5 deletions bin/source/archive.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: (c) 2022 Artsiom iG <github.com/rtmigo>
// SPDX-License-Identifier: MIT

import 'dart:io';

import 'package:archive/archive_io.dart';
Expand All @@ -11,7 +14,8 @@ Future<void> fileToGzip(File source, File targetGzip) async {
try {
final output = OutputFileStream(targetGzip.path);
try {
GZipEncoder().encode(input, output: output, level: 9);
GZipEncoder()
.encode(input, output: output, level: Deflate.BEST_COMPRESSION);
} finally {
await output.close();
}
Expand Down Expand Up @@ -41,7 +45,8 @@ Future<void> fileToTarGz(File source, String entryName, File targetTgz) async {
}
}

Future<void> toZip(File sourceFile, String entryName, File zipFile) async {
Future<void> zipSingleFile(
File sourceFile, String entryName, File zipFile) async {
if (!zipFile.path.endsWith(".zip")) {
throw ArgumentError(zipFile);
}
Expand All @@ -50,7 +55,7 @@ Future<void> toZip(File sourceFile, String entryName, File zipFile) async {
}

final zip = ZipFileEncoder();
zip.create(zipFile.path);
zip.create(zipFile.path, level: Deflate.BEST_COMPRESSION);
zip.addFile(sourceFile, entryName);
zip.close();
}
Expand All @@ -76,7 +81,6 @@ class TempExeWithPermissions {
}
}


/// Создаёт каталог, если он ещё не существует, но существует родительский.
void createOnNeed(Directory dir) {
if (dir.existsSync()) {
Expand Down Expand Up @@ -109,7 +113,7 @@ Future<void> binaryToDist(
if (arch.isWindows) {
entryName = "$programName.exe";
arcSuffix = ".zip";
arcFunc = toZip;
arcFunc = zipSingleFile;
} else {
entryName = programName;
arcSuffix = ".tgz";
Expand Down
3 changes: 3 additions & 0 deletions bin/source/expections.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: (c) 2022 Artsiom iG <github.com/rtmigo>
// SPDX-License-Identifier: MIT

import 'dart:io';

class ExpectedException extends Error {}
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: exe2dist
description: Binary executable packaging tool.
version: 0.3.2
version: 0.3.3

environment:
sdk: '>=2.18.0 <3.0.0'
Expand Down

0 comments on commit 4b81e6a

Please sign in to comment.