mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
2
.github/workflows/android.yml
vendored
2
.github/workflows/android.yml
vendored
@@ -67,7 +67,7 @@ jobs:
|
|||||||
- name: flutter build apk
|
- name: flutter build apk
|
||||||
run: |
|
run: |
|
||||||
chmod +x lib/scripts/build.dart
|
chmod +x lib/scripts/build.dart
|
||||||
dart lib/scripts/build.dart "true"
|
dart lib/scripts/build.dart "android"
|
||||||
flutter build apk --release --split-per-abi
|
flutter build apk --release --split-per-abi
|
||||||
|
|
||||||
- name: 上传
|
- name: 上传
|
||||||
|
|||||||
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
@@ -3,7 +3,7 @@
|
|||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "Update build_config",
|
"label": "Update build_config",
|
||||||
"command": "dart lib/scripts/build.dart",
|
"command": "dart lib/scripts/build.dart dev",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"presentation": {
|
"presentation": {
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Update build_config (FVM)",
|
"label": "Update build_config (FVM)",
|
||||||
"command": "fvm dart lib/scripts/build.dart",
|
"command": "fvm dart lib/scripts/build.dart dev",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"presentation": {
|
"presentation": {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
void main(Iterable<String> args) async {
|
void main(Iterable<String> args) async {
|
||||||
|
final arg = args.firstOrNull;
|
||||||
final pubspecFile = File('pubspec.yaml');
|
final pubspecFile = File('pubspec.yaml');
|
||||||
final lines = await pubspecFile.readAsLines();
|
final lines = await pubspecFile.readAsLines();
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ void main(Iterable<String> args) async {
|
|||||||
'HEAD',
|
'HEAD',
|
||||||
])).stdout.toString().trim();
|
])).stdout.toString().trim();
|
||||||
|
|
||||||
if (args.isNotEmpty) {
|
if (arg == 'android') {
|
||||||
versionName += '-${commitHash.substring(0, 9)}';
|
versionName += '-${commitHash.substring(0, 9)}';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,6 +44,8 @@ class BuildConfig {
|
|||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
|
|
||||||
|
if (arg != 'dev') {
|
||||||
pubspecFile.writeAsString(lines.join('\n'));
|
pubspecFile.writeAsString(lines.join('\n'));
|
||||||
|
}
|
||||||
File('lib/build_config.dart').writeAsString(content);
|
File('lib/build_config.dart').writeAsString(content);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user