From e8d00c079d83e9ee465cfeb9702eb2da765070d9 Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Fri, 28 Jul 2023 12:28:56 -0700 Subject: [PATCH] Remove final references to grinder (#3473) --- .github/workflows/test.yaml | 2 +- pubspec.yaml | 2 - tool/ci.sh | 8 +--- tool/grind.dart | 91 ------------------------------------- tool/task.dart | 5 +- 5 files changed, 7 insertions(+), 101 deletions(-) delete mode 100644 tool/grind.dart diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 57aa813a26..b1b9028d77 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,7 +23,7 @@ jobs: matrix: os: [ubuntu-latest] sdk: [dev, stable] - job: [main, flutter, sdk-analyzer, packages, sdk-docs] + job: [main, flutter, packages, sdk-docs] include: - os: macos-latest sdk: dev diff --git a/pubspec.yaml b/pubspec.yaml index ba2c05973b..6dc036edfe 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,4 @@ name: dartdoc -# Run `dart run grinder build` after updating. version: 7.0.0-dev description: A non-interactive HTML documentation generator for Dart source code. repository: https://github.com/dart-lang/dartdoc @@ -27,7 +26,6 @@ dependencies: dev_dependencies: async: ^2.11.0 dart_style: ^2.3.1 - grinder: ^0.9.4 http: ">=0.13.6 <2.0.0" js: ^0.6.7 lints: ^2.1.0 diff --git a/tool/ci.sh b/tool/ci.sh index 6195583580..ee15fc2c1f 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -21,13 +21,9 @@ elif [ "$DARTDOC_BOT" = "flutter" ]; then dart run tool/task.dart doc flutter elif [ "$DARTDOC_BOT" = "packages" ]; then echo "Running packages dartdoc bot" - PACKAGE_NAME=angular PACKAGE_VERSION=">=7.0.0" DARTDOC_PARAMS="--include=angular" dart run grinder build-pub-package - PACKAGE_NAME=access PACKAGE_VERSION=">=1.0.1+2" dart run grinder build-pub-package + dart run tool/task.dart doc package --name=access --version=">=1.0.1+2" # Negative test for flutter_plugin_tools, make sure right error message is displayed. - PACKAGE_NAME=flutter_plugin_tools PACKAGE_VERSION=">=0.0.14+1" dart run grinder build-pub-package 2>&1 | grep "warning: package:flutter_plugin_tools has no documentable libraries" -elif [ "$DARTDOC_BOT" = "sdk-analyzer" ]; then - echo "Running all tests against the SDK analyzer" - dart run grinder test-with-analyzer-sdk + dart run tool/task.dart doc package --name=flutter_plugin_tools --version=">=0.0.14+1" 2>&1 | grep "warning: package:flutter_plugin_tools has no documentable libraries" else echo "Running main dartdoc bot" dart run tool/task.dart buildbot diff --git a/tool/grind.dart b/tool/grind.dart deleted file mode 100644 index 43ef8e81ea..0000000000 --- a/tool/grind.dart +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -// for details. 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 'dart:io' hide ProcessException; - -import 'package:grinder/grinder.dart'; -import 'package:path/path.dart' as p; - -import 'src/subprocess_launcher.dart'; -import 'task.dart' as task; - -void main(List args) => grind(args); - -/// Creates a clean version of dartdoc (based on the current directory, assumed -/// to be a git repository), configured to use packages from the Dart SDK. -/// -/// This copy of dartdoc depends on the HEAD versions of various packages -/// developed within the SDK, such as 'analyzer', '_fe_analyzer_shared', -/// and 'meta'. -Future createSdkDartdoc() async { - var launcher = SubprocessLauncher('create-sdk-dartdoc'); - var dartdocSdk = Directory.systemTemp.createTempSync('dartdoc-sdk'); - await launcher - .runStreamed('git', ['clone', Directory.current.path, dartdocSdk.path]); - await launcher.runStreamed('git', ['checkout'], - workingDirectory: dartdocSdk.path); - - var sdkClone = Directory.systemTemp.createTempSync('sdk-checkout'); - await launcher.runStreamed('git', [ - 'clone', - '--branch', - 'main', - '--depth', - '1', - 'https://dart.googlesource.com/sdk.git', - sdkClone.path - ]); - var dartdocPubspec = File(p.join(dartdocSdk.path, 'pubspec.yaml')); - var pubspecLines = await dartdocPubspec.readAsLines(); - var pubspecLinesFiltered = []; - for (var line in pubspecLines) { - if (line.startsWith('dependency_overrides:')) { - pubspecLinesFiltered.add('#dependency_overrides:'); - } else { - pubspecLinesFiltered.add(line); - } - } - - await dartdocPubspec.writeAsString(pubspecLinesFiltered.join('\n')); - dartdocPubspec.writeAsStringSync(''' - -dependency_overrides: - analyzer: - path: '${sdkClone.path}/pkg/analyzer' - _fe_analyzer_shared: - path: '${sdkClone.path}/pkg/_fe_analyzer_shared' - meta: - path: '${sdkClone.path}/pkg/meta' -''', mode: FileMode.append); - await launcher.runStreamed(Platform.resolvedExecutable, ['pub', 'get'], - workingDirectory: dartdocSdk.path); - return dartdocSdk.path; -} - -@Task('Run grind tasks with the analyzer SDK.') -Future testWithAnalyzerSdk() async { - var launcher = SubprocessLauncher('test-with-analyzer-sdk'); - // Do not override meta on branches outside of stable. - var sdkDartdoc = await createSdkDartdoc(); - var defaultGrindParameter = - Platform.environment['DARTDOC_GRIND_STEP'] ?? 'test'; - // TODO(srawlins): Re-enable sdk-analyzer when dart_style is published using - // analyzer 3.0.0. - try { - await launcher.runStreamed( - Platform.resolvedExecutable, ['run', 'grinder', defaultGrindParameter], - workingDirectory: sdkDartdoc); - } catch (e, st) { - print('Warning: SDK analyzer job threw "$e":\n$st'); - } -} - -@Task( - 'Build an arbitrary pub package based on PACKAGE_NAME and PACKAGE_VERSION ' - 'environment variables') -Future buildPubPackage() async => await task.docPackage( - name: Platform.environment['PACKAGE_NAME']!, - version: Platform.environment['PACKAGE_VERSION'], - ); diff --git a/tool/task.dart b/tool/task.dart index bd77c6143c..87d271a260 100644 --- a/tool/task.dart +++ b/tool/task.dart @@ -26,11 +26,14 @@ void main(List args) async { ..addCommand('buildbot') ..addCommand('clean') ..addCommand('compare') - ..addCommand('doc') ..addCommand('serve') ..addCommand('test') ..addCommand('try-publish') ..addCommand('validate'); + parser.addCommand('doc') + ..addOption('name') + ..addOption('version'); + var results = parser.parse(args); var commandResults = results.command; if (commandResults == null) {