throwing_pub.dart 1.18 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
import 'package:flutter_tools/src/dart/pub.dart';
7
import 'package:meta/meta.dart';
8 9 10 11 12 13 14 15 16 17 18

class ThrowingPub implements Pub {
  @override
  Future<void> batch(List<String> arguments, {
    PubContext context,
    String directory,
    MessageFilter filter,
    String failureMessage = 'pub failed',
    bool retry,
    bool showTraceForErrors,
  }) {
19
    throw UnsupportedError('Attempted to invoke pub during test.');
20 21 22 23 24 25 26 27 28 29 30
  }

  @override
  Future<void> get({
    PubContext context,
    String directory,
    bool skipIfAbsent = false,
    bool upgrade = false,
    bool offline = false,
    bool checkLastModified = true,
    bool skipPubspecYamlCheck = false,
31
    bool generateSyntheticPackage = false,
32
    String flutterRootOverride,
33
  }) {
34
    throw UnsupportedError('Attempted to invoke pub during test.');
35 36 37
  }

  @override
38
  Future<void> interactively(List<String> arguments, {String directory, @required Stdio stdio,}) {
39
    throw UnsupportedError('Attempted to invoke pub during test.');
40 41
  }
}