throwing_pub.dart 1.36 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'package:flutter_tools/src/base/io.dart';
6 7 8 9 10
import 'package:flutter_tools/src/dart/pub.dart';

class ThrowingPub implements Pub {
  @override
  Future<void> batch(List<String> arguments, {
11 12 13 14 15 16
    PubContext? context,
    String? directory,
    MessageFilter? filter,
    String? failureMessage = 'pub failed',
    bool? retry,
    bool? showTraceForErrors,
17
  }) {
18
    throw UnsupportedError('Attempted to invoke pub during test.');
19 20 21 22
  }

  @override
  Future<void> get({
23 24
    PubContext? context,
    String? directory,
25 26 27 28 29
    bool skipIfAbsent = false,
    bool upgrade = false,
    bool offline = false,
    bool checkLastModified = true,
    bool skipPubspecYamlCheck = false,
30
    bool generateSyntheticPackage = false,
31
    String? flutterRootOverride,
32
    bool checkUpToDate = false,
33
    bool shouldSkipThirdPartyGenerator = true,
34
    bool printProgress = true,
35
  }) {
36
    throw UnsupportedError('Attempted to invoke pub during test.');
37 38 39
  }

  @override
40 41
  Future<void> interactively(
    List<String> arguments, {
42 43
    String? directory,
    required Stdio stdio,
44 45 46
    bool touchesPackageConfig = false,
    bool generateSyntheticPackage = false,
  }) {
47
    throw UnsupportedError('Attempted to invoke pub during test.');
48 49
  }
}