mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: add buildconfig
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
2
.github/workflows/ios.yml
vendored
2
.github/workflows/ios.yml
vendored
@@ -28,6 +28,8 @@ jobs:
|
||||
|
||||
- name: Build iOS
|
||||
run: |
|
||||
chmod +x lib/scripts/build.sh
|
||||
lib/scripts/build.sh
|
||||
flutter build ios --release --no-codesign
|
||||
ln -sf ./build/ios/iphoneos Payload
|
||||
zip -r9 ios-release-no-sign.ipa Payload/runner.app
|
||||
|
||||
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@@ -45,7 +45,10 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: flutter build apk
|
||||
run: flutter build apk --release --split-per-abi
|
||||
run: |
|
||||
chmod +x lib/scripts/build.sh
|
||||
lib/scripts/build.sh
|
||||
flutter build apk --release --split-per-abi
|
||||
|
||||
- name: 上传
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -133,4 +133,6 @@ app.*.symbols
|
||||
!**/ios/**/default.perspectivev3
|
||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||
!/dev/ci/**/Gemfile.lock
|
||||
!.vscode/settings.json
|
||||
!.vscode/settings.json
|
||||
|
||||
/lib/build_config.dart
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:PiliPalaX/build_config.dart';
|
||||
import 'package:PiliPalaX/utils/cache_manage.dart';
|
||||
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -58,6 +59,9 @@ void main() async {
|
||||
SmartDialog.config.loading =
|
||||
SmartConfigLoading(backType: SmartBackType.normal);
|
||||
// 异常捕获 logo记录
|
||||
final String buildConfig = '''
|
||||
Commit Hash: ${BuildConfig.commitHash}
|
||||
Build Time: ${BuildConfig.buildTime}''';
|
||||
final Catcher2Options debugConfig = Catcher2Options(
|
||||
SilentReportMode(),
|
||||
[
|
||||
@@ -65,13 +69,25 @@ void main() async {
|
||||
ConsoleHandler(
|
||||
enableDeviceParameters: false,
|
||||
enableApplicationParameters: false,
|
||||
enableCustomParameters: true,
|
||||
)
|
||||
],
|
||||
customParameters: {
|
||||
'BuildConfig': buildConfig,
|
||||
},
|
||||
);
|
||||
|
||||
final Catcher2Options releaseConfig = Catcher2Options(
|
||||
SilentReportMode(),
|
||||
[FileHandler(await getLogsPath())],
|
||||
[
|
||||
FileHandler(await getLogsPath()),
|
||||
ConsoleHandler(
|
||||
enableCustomParameters: true,
|
||||
)
|
||||
],
|
||||
customParameters: {
|
||||
'BuildConfig': buildConfig,
|
||||
},
|
||||
);
|
||||
|
||||
Catcher2(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPalaX/build_config.dart';
|
||||
import 'package:PiliPalaX/http/constants.dart';
|
||||
import 'package:PiliPalaX/services/loggeer.dart';
|
||||
import 'package:cookie_jar/cookie_jar.dart';
|
||||
@@ -90,6 +91,17 @@ class _AboutPageState extends State<AboutPage> {
|
||||
style: subTitleStyle),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(
|
||||
'''
|
||||
Commit Hash: ${BuildConfig.commitHash}
|
||||
Build Time: ${BuildConfig.buildTime}''',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
leading: const Icon(Icons.info_outline),
|
||||
onTap: () => Utils.launchURL(
|
||||
'https://github.com/bggRGjQaUbCoE/PiliPalaX/commit/${BuildConfig.commitHash}'),
|
||||
),
|
||||
// Obx(
|
||||
// () => ListTile(
|
||||
// onTap: () => _aboutController.onUpdate(),
|
||||
|
||||
@@ -1 +1,16 @@
|
||||
flutter build apk --target-platform android-arm64 --split-per-abi
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
build_time=$(date -u -v+8H +"%Y-%m-%d %H:%M:%S")
|
||||
else
|
||||
build_time=$(date -u +"%Y-%m-%d %H:%M:%S" -d "+8 hours")
|
||||
fi
|
||||
|
||||
commit_hash=$(git rev-parse HEAD)
|
||||
|
||||
cat <<EOL > lib/build_config.dart
|
||||
class BuildConfig {
|
||||
static const String buildTime = '$build_time';
|
||||
static const String commitHash = '$commit_hash';
|
||||
}
|
||||
EOL
|
||||
|
||||
Reference in New Issue
Block a user