Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require FLUTTER_ROOT any longer, even for flutter packages #3688

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/src/model/package_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,6 @@ class PubPackageBuilder implements PackageBuilder {

@override
Future<PackageGraph> buildPackageGraph() async {
if (!_config.sdkDocs) {
if (_config.topLevelPackageMeta.requiresFlutter &&
_config.flutterRoot == null) {
// TODO(devoncarew): We may no longer need to emit this error.
throw DartdocOptionError(
'Top level package requires Flutter but FLUTTER_ROOT environment variable not set');
}
}

runtimeStats.resetAccumulators([
'elementTypeInstantiation',
'modelElementCacheInsertion',
Expand Down
30 changes: 0 additions & 30 deletions test/end2end/dartdoc_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ library;

import 'dart:async';
import 'dart:io';
import 'dart:mirrors';

import 'package:dartdoc/src/package_meta.dart';
import 'package:path/path.dart' as path;
Expand All @@ -17,11 +16,6 @@ import 'package:test_process/test_process.dart';
import '../src/test_descriptor_utils.dart' as d;
import '../src/utils.dart';

Uri get _currentFileUri =>
(reflect(main) as ClosureMirror).function.location!.sourceUri;
String get _testPackageFlutterPluginPath => path.fromUri(_currentFileUri
.resolve('../../testing/flutter_packages/test_package_flutter_plugin'));

var _dartdocPath = path.canonicalize(path.join('bin', 'dartdoc.dart'));

/// Runs dartdoc via [TestProcess.start].
Expand Down Expand Up @@ -103,28 +97,4 @@ void main() {
);
await process.shouldExit(1);
});

test('with missing FLUTTER_ROOT exception reports an error', () async {
// TODO(srawlins): Remove test_package_flutter_plugin and generate afresh.
var dartTool =
Directory(path.join(_testPackageFlutterPluginPath, '.dart_tool'));
if (dartTool.existsSync()) dartTool.deleteSync(recursive: true);
var process = await runDartdoc(
[],
workingDirectory: _testPackageFlutterPluginPath,
environment: {...Platform.environment}..remove('FLUTTER_ROOT'),
includeParentEnvironment: false,
);
await expectLater(
process.stderr,
emitsThrough(
matches(
'Top level package requires Flutter but FLUTTER_ROOT environment '
'variable not set|test_package_flutter_plugin requires the Flutter '
'SDK, version solving failed',
),
),
);
await process.shouldExit(1);
});
}

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions testing/flutter_packages/test_package_flutter_plugin/pubspec.yaml

This file was deleted.