diff --git a/make.dart b/make.dart index a5ed4777..7b360e39 100755 --- a/make.dart +++ b/make.dart @@ -5,17 +5,15 @@ import 'dart:convert'; 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'; -const appleXCConfigPath = '/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, @@ -62,7 +60,8 @@ Future getGitModificationCount() async { Future getFlutterVersion() async { final result = await fvmRun(['flutter', '--version']); - return (result.stdout as String); + final stdout = result.stdout as String; + return stdout.split('\n')[0].split('•')[0].split(' ')[1].trim(); } Future> getBuildData() async { @@ -109,8 +108,7 @@ Future flutterBuild( 'build', buildType, ]; - // No sksl cache for macos - final skslPath = '$buildType$skslFileSuffix'; + final skslPath = '$buildType.sksl.json'; if (await File(skslPath).exists()) { args.add('--bundle-sksl-path=$skslPath'); } @@ -164,7 +162,7 @@ Future flutterBuildAndroid() async { Future changeAppleVersion() async { for (final path in ['ios', 'macos']) { - final file = File(path + appleXCConfigPath); + final file = File('$path/$appleXCConfigPath'); final contents = await file.readAsString(); final newContents = contents .replaceAll(regAppleMarketVer, 'MARKETING_VERSION = 1.0.$build;')