mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
rm: fvm
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -48,7 +48,6 @@ app.*.map.json
|
||||
/android/app/fjy.androidstudio.key
|
||||
/release
|
||||
test.dart
|
||||
.fvm
|
||||
|
||||
# Keep generated l10n files
|
||||
/.dart_tool/*
|
||||
|
||||
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"dart.flutterSdkPath": ".fvm",
|
||||
"files.watcherExclude": {
|
||||
"**/.fvm": true
|
||||
},
|
||||
"git.ignoredRepositories": [
|
||||
".fvm"
|
||||
],
|
||||
"search.exclude": {
|
||||
"**/.fvm": true
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,6 @@
|
||||
|
||||
|
||||
## 🆘 帮助
|
||||
**可能**更适合大陆地区的 [QQ](https://qm.qq.com/q/cpcFYXixgs) 或 [邮箱](mailto:lollipopkit@qq.com) 反馈。
|
||||
如果你有任何问题或者功能请求,请在 [讨论](https://github.com/lollipopkit/flutter_server_box/discussions/new/choose) 中交流。
|
||||
如果 ServerBox app 有任何 bug,请在 [问题](https://github.com/lollipopkit/flutter_server_box/issues/new) 中反馈。
|
||||
|
||||
|
||||
25
make.dart
25
make.dart
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env fvm dart
|
||||
#!/usr/bin/env dart
|
||||
// ignore_for_file: avoid_print
|
||||
|
||||
import 'dart:convert';
|
||||
@@ -21,10 +21,6 @@ const buildFuncs = {
|
||||
|
||||
int? build;
|
||||
|
||||
Future<ProcessResult> fvmRun(List<String> args) async {
|
||||
return await Process.run('fvm', args, runInShell: true);
|
||||
}
|
||||
|
||||
Future<void> getGitCommitCount() async {
|
||||
final result = await Process.run('git', ['log', '--oneline']);
|
||||
build = (result.stdout as String)
|
||||
@@ -58,7 +54,7 @@ Future<int> getGitModificationCount() async {
|
||||
}
|
||||
|
||||
Future<String> getFlutterVersion() async {
|
||||
final result = await fvmRun(['flutter', '--version']);
|
||||
final result = await Process.run('flutter', ['--version']);
|
||||
final stdout = result.stdout as String;
|
||||
return stdout.split('\n')[0].split('•')[0].split(' ')[1].trim();
|
||||
}
|
||||
@@ -87,7 +83,7 @@ Future<void> updateBuildData() async {
|
||||
}
|
||||
|
||||
Future<void> dartFormat() async {
|
||||
final result = await fvmRun(['dart', 'format', '.']);
|
||||
final result = await Process.run('dart', ['format', '.']);
|
||||
print(result.stdout);
|
||||
if (result.exitCode != 0) {
|
||||
print(result.stderr);
|
||||
@@ -95,10 +91,10 @@ Future<void> dartFormat() async {
|
||||
}
|
||||
}
|
||||
|
||||
void flutterRun(String? mode) {
|
||||
Process.start(
|
||||
'fvm', mode == null ? ['flutter', 'run'] : ['flutter', 'run', '--$mode'],
|
||||
mode: ProcessStartMode.inheritStdio, runInShell: true);
|
||||
Future<String> getFileSha1(String path) async {
|
||||
final result = await Process.run('shasum', ['-a', '1', path]);
|
||||
final stdout = result.stdout as String;
|
||||
return stdout.split(' ')[0];
|
||||
}
|
||||
|
||||
Future<void> flutterBuild(String buildType) async {
|
||||
@@ -120,7 +116,7 @@ Future<void> flutterBuild(String buildType) async {
|
||||
]);
|
||||
}
|
||||
print('\n[$buildType]\nBuilding with args: ${args.join(' ')}');
|
||||
final buildResult = await fvmRun(['flutter', ...args]);
|
||||
final buildResult = await Process.run('flutter', args);
|
||||
final exitCode = buildResult.exitCode;
|
||||
|
||||
if (exitCode != 0) {
|
||||
@@ -146,12 +142,13 @@ Future<void> flutterBuildAndroid() async {
|
||||
}
|
||||
|
||||
Future<void> scp2CDN() async {
|
||||
final sha1 = await getFileSha1(apkPath);
|
||||
print('SHA1: $sha1');
|
||||
final result = await Process.run(
|
||||
'scp',
|
||||
[apkPath, 'hk:/var/www/res/serverbox/apks/$build.apk'],
|
||||
[apkPath, 'hk:/var/www/res/serverbox/apks/$sha1.apk'],
|
||||
runInShell: true,
|
||||
);
|
||||
print(result.stdout);
|
||||
if (result.exitCode != 0) {
|
||||
print(result.stderr);
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user