| 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 | |
| 5 | import 'dart:io' hide Platform; |
| 6 | |
| 7 | const String gobMirror = 'https://flutter.googlesource.com/mirrors/flutter'; |
| 8 | const String githubRepo = 'https://github.com/flutter/flutter.git'; |
| 9 | const String mingitForWindowsUrl =
|
| 10 | 'https://storage.googleapis.com/flutter_infra_release/mingit/'
|
| 11 | '603511c649b00bbef0a6122a827ac419b656bc19/mingit.zip' ;
|
| 12 | const String releaseFolder = '/releases' ;
|
| 13 | const String gsBase = 'gs://flutter_infra_release';
|
| 14 | const String gsReleaseFolder = ' $gsBase$releaseFolder' ;
|
| 15 | const String baseUrl = 'https://storage.googleapis.com/flutter_infra_release';
|
| 16 | const int shortCacheSeconds = 60;
|
| 17 | const String frameworkVersionTag = 'frameworkVersionFromGit' ;
|
| 18 | const String dartVersionTag = 'dartSdkVersion' ;
|
| 19 | const String dartTargetArchTag = 'dartTargetArch' ;
|
| 20 |
|
| 21 | enum 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.
|
| 25 | class 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 |
|