1// Copyright 2014 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'dart:io' hide Platform;
6
7const String gobMirror = 'https://flutter.googlesource.com/mirrors/flutter';
8const String githubRepo = 'https://github.com/flutter/flutter.git';
9const String mingitForWindowsUrl =
10 'https://storage.googleapis.com/flutter_infra_release/mingit/'
11 '603511c649b00bbef0a6122a827ac419b656bc19/mingit.zip';
12const String releaseFolder = '/releases';
13const String gsBase = 'gs://flutter_infra_release';
14const String gsReleaseFolder = '$gsBase$releaseFolder';
15const String baseUrl = 'https://storage.googleapis.com/flutter_infra_release';
16const int shortCacheSeconds = 60;
17const String frameworkVersionTag = 'frameworkVersionFromGit';
18const String dartVersionTag = 'dartSdkVersion';
19const String dartTargetArchTag = 'dartTargetArch';
20
21enum Branch { beta, stable, master, main }
22
23/// Exception class for when a process fails to run, so we can catch
24/// it and provide something more readable than a stack trace.
25class PreparePackageException implements Exception {
26 PreparePackageException(this.message, [this.result]);
27
28 final String message;
29 final ProcessResult? result;
30 int get exitCode => result?.exitCode ?? -1;
31
32 @override
33 String toString() {
34 String output = runtimeType.toString();
35 output += ': $message';
36 final String stderr = result?.stderr as String? ?? '';
37 if (stderr.isNotEmpty) {
38 output += ':\n$stderr';
39 }
40 return output;
41 }
42}
43