mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix: #8
This commit is contained in:
@@ -356,7 +356,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 215;
|
||||
CURRENT_PROJECT_VERSION = 216;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -364,7 +364,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.215;
|
||||
MARKETING_VERSION = 1.0.216;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -486,7 +486,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 215;
|
||||
CURRENT_PROJECT_VERSION = 216;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -494,7 +494,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.215;
|
||||
MARKETING_VERSION = 1.0.216;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
@@ -510,7 +510,7 @@
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 215;
|
||||
CURRENT_PROJECT_VERSION = 216;
|
||||
DEVELOPMENT_TEAM = BA88US33G6;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
@@ -518,7 +518,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0.215;
|
||||
MARKETING_VERSION = 1.0.216;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
|
||||
@@ -112,9 +112,9 @@ class ServerProvider extends BusyProvider {
|
||||
throw RangeError.index(idx, _servers);
|
||||
}
|
||||
_servers[idx].spi = newSpi;
|
||||
locator<ServerStore>().update(old, newSpi);
|
||||
_servers[idx].client = await genClient(newSpi);
|
||||
notifyListeners();
|
||||
locator<ServerStore>().update(old, newSpi);
|
||||
refreshData(spi: newSpi);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 215;
|
||||
static const int build = 216;
|
||||
static const String engine =
|
||||
"Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b06b8b2710 (13 days ago) • 2023-01-23 16:55:55 -0800\nEngine • revision b24591ed32\nTools • Dart 2.19.0 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-02-05 22:11:13.992594";
|
||||
static const int modifications = 9;
|
||||
"Flutter 3.7.1 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 7048ed95a5 (5 days ago) • 2023-02-01 09:07:31 -0800\nEngine • revision 800594f1f4\nTools • Dart 2.19.1 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-02-06 18:02:57.320716";
|
||||
static const int modifications = 1;
|
||||
}
|
||||
|
||||
32
make.dart
32
make.dart
@@ -6,16 +6,20 @@ import 'dart:io';
|
||||
|
||||
const appName = 'ServerBox';
|
||||
const buildDataFilePath = 'lib/data/res/build_data.dart';
|
||||
|
||||
const apkPath = 'build/app/outputs/flutter-apk/app-release.apk';
|
||||
|
||||
const xcarchivePath = 'build/ios/archive/Runner.xcarchive';
|
||||
var regiOSProjectVer = RegExp(r'CURRENT_PROJECT_VERSION = .+;');
|
||||
var regiOSMarketVer = RegExp(r'MARKETING_VERSION = .+');
|
||||
const iOSInfoPlistPath = 'ios/Runner.xcodeproj/project.pbxproj';
|
||||
const appleXCConfigPath = '/Runner.xcodeproj/project.pbxproj';
|
||||
var regAppleProjectVer = RegExp(r'CURRENT_PROJECT_VERSION = .+;');
|
||||
var regAppleMarketVer = RegExp(r'MARKETING_VERSION = .+');
|
||||
|
||||
const skslFileSuffix = '.sksl.json';
|
||||
|
||||
const buildFuncs = {
|
||||
'ios': flutterBuildIOS,
|
||||
'android': flutterBuildAndroid,
|
||||
'macos': flutterBuildMacOS,
|
||||
};
|
||||
|
||||
int? build;
|
||||
@@ -146,22 +150,26 @@ Future<void> flutterBuild(
|
||||
}
|
||||
|
||||
Future<void> flutterBuildIOS() async {
|
||||
await changeInfoPlistVersion();
|
||||
await flutterBuild(
|
||||
xcarchivePath, './release/${appName}_ios_build.xcarchive', 'ipa');
|
||||
}
|
||||
|
||||
Future<void> flutterBuildMacOS() async {
|
||||
await flutterBuild(
|
||||
xcarchivePath, './release/${appName}_macos_build.xcarchive', 'macos');
|
||||
}
|
||||
|
||||
Future<void> flutterBuildAndroid() async {
|
||||
await flutterBuild(apkPath, './release/${appName}_build_Arm64.apk', 'apk');
|
||||
}
|
||||
|
||||
Future<void> changeInfoPlistVersion() async {
|
||||
for (final path in [iOSInfoPlistPath]) {
|
||||
final file = File(path);
|
||||
Future<void> changeAppleVersion() async {
|
||||
for (final path in ['ios', 'macos']) {
|
||||
final file = File(path + appleXCConfigPath);
|
||||
final contents = await file.readAsString();
|
||||
final newContents = contents
|
||||
.replaceAll(regiOSMarketVer, 'MARKETING_VERSION = 1.0.$build;')
|
||||
.replaceAll(regiOSProjectVer, 'CURRENT_PROJECT_VERSION = $build;');
|
||||
.replaceAll(regAppleMarketVer, 'MARKETING_VERSION = 1.0.$build;')
|
||||
.replaceAll(regAppleProjectVer, 'CURRENT_PROJECT_VERSION = $build;');
|
||||
await file.writeAsString(newContents);
|
||||
}
|
||||
}
|
||||
@@ -175,17 +183,19 @@ void main(List<String> args) async {
|
||||
final command = args[0];
|
||||
|
||||
switch (command) {
|
||||
case 'run':
|
||||
return flutterRun(args.length == 2 ? args[1] : null);
|
||||
case 'build':
|
||||
final stopwatch = Stopwatch()..start();
|
||||
build = await getGitCommitCount();
|
||||
await updateBuildData();
|
||||
await dartFormat();
|
||||
await changeAppleVersion();
|
||||
if (args.length > 1) {
|
||||
final platform = args[1];
|
||||
if (buildFuncs.keys.contains(platform)) {
|
||||
await buildFuncs[platform]!();
|
||||
print('Build finished in ${stopwatch.elapsed}');
|
||||
stopwatch.reset();
|
||||
stopwatch.start();
|
||||
} else {
|
||||
print('Unknown platform: $platform');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user