Gitea CI / Check code and tests (pull_request) Failing after 8m56s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
Gitea CI / Gitea CI passed (pull_request) Failing after 4s
Pin Flutter with FVM and share local environment loading across IDE, Python, and Dart entrypoints. Keep CI on the verified preinstalled SDK and skip local overrides. Extract common build presets, process execution, and file hashing. Propagate project roots through SDK selection and release commands, and migrate macOS release, signing, and DMG orchestration to Python. Reuse local check suites in CI, support Android source overrides, and update documentation and regression tests.
57 lines
1.8 KiB
Dart
57 lines
1.8 KiB
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'src/local_environment.dart';
|
|
|
|
Future<void> main(List<String> arguments) async {
|
|
const usage =
|
|
'Usage: project_tools.dart [--directory PATH] flutter|dart|exec <arguments>';
|
|
if (arguments.length == 1 && ['--help', '-h'].contains(arguments.first)) {
|
|
stdout.writeln(usage);
|
|
return;
|
|
}
|
|
try {
|
|
final root = Directory.fromUri(Platform.script.resolve('../'));
|
|
var workingDirectory = root;
|
|
if (arguments.isNotEmpty && arguments.first == '--directory') {
|
|
if (arguments.length < 3) throw const FormatException(usage);
|
|
workingDirectory = Directory(arguments[1]).absolute;
|
|
arguments = arguments.sublist(2);
|
|
}
|
|
if (arguments.isEmpty) throw const FormatException(usage);
|
|
if (arguments.length == 1 && arguments.first == 'environment') {
|
|
// Internal pipe for Python tools. Never log or persist this payload.
|
|
final bin = projectSdkBin(root, allowCiSdk: true);
|
|
stdout.writeln(
|
|
jsonEncode(projectEnvironment(root, Platform.environment, bin)),
|
|
);
|
|
return;
|
|
}
|
|
if (!['flutter', 'dart', 'exec'].contains(arguments.first)) {
|
|
throw const FormatException(usage);
|
|
}
|
|
exitCode = await runProjectTool(
|
|
arguments.first,
|
|
arguments.sublist(1),
|
|
root: root,
|
|
inherited: Platform.environment,
|
|
workingDirectory: workingDirectory,
|
|
allowCiSdk: true,
|
|
);
|
|
} on FormatException catch (error) {
|
|
stderr.writeln(error.message);
|
|
exitCode = 2;
|
|
} on FileSystemException {
|
|
stderr.writeln(
|
|
'Cannot read project configuration; check file permissions.',
|
|
);
|
|
exitCode = 1;
|
|
} on StateError catch (error) {
|
|
stderr.writeln(error.message);
|
|
exitCode = 1;
|
|
} on ProcessException {
|
|
stderr.writeln('Cannot start the project tool; check the SDK and command.');
|
|
exitCode = 1;
|
|
}
|
|
}
|