mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

Allow configuring the flutter_manifest to support a synthetic package, this is done through flutter: generate: true. When running pub get, insert a flutter_gen entry into the packages if it does not already exist. This points to .dart_tool/flutter_gen, which can be updated to contain the generated intl sources (But doesn't currently) Adds an integration test that verifies this code can be run and imported when enabled. Part of #60914
44 lines
1.2 KiB
Dart
44 lines
1.2 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'dart:async';
|
|
|
|
import 'package:flutter_tools/src/base/io.dart';
|
|
import 'package:flutter_tools/src/dart/pub.dart';
|
|
import 'package:meta/meta.dart';
|
|
|
|
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,
|
|
}) {
|
|
throw UnsupportedError('Attempted to invoke pub during test.');
|
|
}
|
|
|
|
@override
|
|
Future<void> get({
|
|
PubContext context,
|
|
String directory,
|
|
bool skipIfAbsent = false,
|
|
bool upgrade = false,
|
|
bool offline = false,
|
|
bool checkLastModified = true,
|
|
bool skipPubspecYamlCheck = false,
|
|
bool generateSyntheticPackage = false,
|
|
String flutterRootOverride,
|
|
}) {
|
|
throw UnsupportedError('Attempted to invoke pub during test.');
|
|
}
|
|
|
|
@override
|
|
Future<void> interactively(List<String> arguments, {String directory, @required Stdio stdio,}) {
|
|
throw UnsupportedError('Attempted to invoke pub during test.');
|
|
}
|
|
}
|