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

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

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

  @override
  Future<void> get({
21
    PubContext? context,
22
    required FlutterProject project,
23 24 25 26
    bool upgrade = false,
    bool offline = false,
    bool checkLastModified = true,
    bool skipPubspecYamlCheck = false,
27
    bool generateSyntheticPackage = false,
28
    bool generateSyntheticPackageForExample = false,
29
    String? flutterRootOverride,
30
    bool checkUpToDate = false,
31
    bool shouldSkipThirdPartyGenerator = true,
32
    PubOutputMode outputMode = PubOutputMode.all,
33
  }) {
34
    throw UnsupportedError('Attempted to invoke pub during test.');
35 36 37
  }

  @override
38 39
  Future<void> interactively(
    List<String> arguments, {
40 41 42
    FlutterProject? project,
    required PubContext context,
    required String command,
43 44
    bool touchesPackageConfig = false,
    bool generateSyntheticPackage = false,
45
    PubOutputMode outputMode = PubOutputMode.all,
46
  }) {
47
    throw UnsupportedError('Attempted to invoke pub during test.');
48 49
  }
}