Skip to content

Commit e3a8842

Browse files
committed
Try out workspaces for dartdoc tooling
1 parent 24c2a96 commit e3a8842

29 files changed

+131
-63
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ lib/src/html/resources.g.dart linguist-generated=false
99

1010
# Don't force devs to manually resolve conflicts in generated files.
1111
# At the end of a rebase or a merge, the dev may still need to regenerate
12-
# these files with `dart run tool/task.dart build`.
12+
# these files with `dart run task build`.
1313
lib/resources/docs.dart.js merge=theirs
1414
lib/resources/docs.dart.js.map merge=theirs
1515
lib/resources/styles.css merge=theirs
1616
lib/src/generator/templates.aot_renderers_for_html.dart merge=theirs
1717
lib/src/generator/templates.aot_renderers_for_md.dart merge=theirs
1818
lib/src/generator/templates.runtime_renderers.dart merge=theirs
19-
web/sig.txt merge=theirs
19+
tool/dartdoc_web/sig.txt merge=theirs

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ jobs:
8181
DARTDOC_BOT: ${{ matrix.job }}
8282
- name: ${{ matrix.job }}
8383
if: runner.os == 'Windows' && matrix.job == 'main'
84-
run: dart run tool\task.dart buildbot
84+
run: dart run task buildbot
8585
env:
8686
DARTDOC_BOT: ${{ matrix.job }}

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@
8989
* Combine the two implementations of "library canonicalization." This should be
9090
a no-op. (#3781)
9191
* Simplify `Library.allModelElements`, but should be a no-op. (#3793)
92-
* Support the `--stats` flag for the 'doc sdk' task
93-
(`dart tools/task.dart doc sdk --stats`). (#3791)
9492
* Make `CommentReferenceParser.codeRef` private. (#3771)
9593
* Make `PackageGraph.allLibraries` private. (#3792)
9694
* Remove the unnecessary Privacy mixin. (#3794)

CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ start by opening an issue. Thanks!
2525
to the [changelog][] under the current `-wip` version.
2626
2. Please include a test for your change. `dartdoc` has both
2727
`package:test`-style unit tests as well as integration tests.
28-
To run the tests, use `dart run tool/task.dart test`.
29-
3. For major changes, run both `dart run tool/task.dart compare sdk-warnings`
30-
and `dart run tool/task.dart compare flutter-warnings`, and
28+
To run the tests, use `dart run task test`.
29+
3. For major changes, run both `dart run task compare sdk-warnings`
30+
and `dart run task compare flutter-warnings`, and
3131
include the summary results in your pull request.
3232
4. Be sure to format your Dart code using `dart format`,
3333
otherwise our CI will complain.
34-
5. Use `dart run tool/task.dart buildbot` before creating a pull request
34+
5. Use `dart run task buildbot` before creating a pull request
3535
to quickly check for common problems.
3636
Follow any instructions it outputs, then run again.
3737
6. Post your change via a pull request for review and integration!
@@ -43,21 +43,21 @@ check for behavior changes or try out your change on arbitrary packages.
4343

4444
```bash
4545
# Serve the latest version of the given package locally on port 9000.
46-
dart run tool/task.dart serve package --name=intl
46+
dart run task serve package --name=intl
4747

4848
# Build the SDK docs with the head version and compare its warning
4949
# output and (rough) performance to the main version.
50-
dart run tool/task.dart compare sdk-warnings
50+
dart run task compare sdk-warnings
5151

5252
# Serve the flutter docs built with the head version on port 8001.
53-
dart run tool/task.dart serve flutter
53+
dart run task serve flutter
5454

5555
# Serve the test package (testing/test_package) on port 8002
56-
dart run tool/task.dart serve testing-package
56+
dart run task serve testing-package
5757
```
5858

5959
There are more commands added all the time,
60-
check out `tool/task.dart` to find each command or
60+
check out `tool/task/bin/task.dart` to find each command or
6161
learn how they are implemented.
6262

6363
## License

lib/resources/docs.dart.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/mustachio/annotations.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ class Context<T> {
7171
/// The specification of a renderer, as derived from a @Renderer annotation.
7272
///
7373
/// This is only meant to be used by dartdoc's builders.
74-
@internal
7574
class RendererSpec {
7675
/// The name of the render function.
7776
final String name;

pubspec.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
name: dartdoc
22
version: 8.3.1-wip
3-
description: A non-interactive HTML documentation generator for Dart source code.
3+
description: >-
4+
A non-interactive HTML documentation generator for Dart source code.
45
repository: https://github.com/dart-lang/dartdoc
56

67
environment:
78
sdk: ^3.5.0
89

10+
workspace:
11+
- tool/mustachio
12+
- tool/task
13+
- tool/dartdoc_web
14+
915
dependencies:
1016
analyzer: ^6.10.0
1117
args: ^2.4.1
@@ -24,15 +30,14 @@ dependencies:
2430

2531
dev_dependencies:
2632
async: ^2.11.0
27-
dart_style: ^2.3.7
2833
lints: ^5.0.0
2934
matcher: ^0.12.15
30-
sass: ^1.80.4
35+
mustachio:
36+
path: tool/mustachio
3137
test: ^1.24.2
3238
test_descriptor: ^2.0.1
3339
test_process: ^2.0.3
3440
test_reflective_loader: ^0.2.2
35-
web: ^1.1.0
3641

3742
executables:
3843
dartdoc: null

test/mustachio/builder_test_base.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import 'package:analyzer/file_system/physical_file_system.dart';
88
import 'package:analyzer/src/dart/analysis/analysis_context_collection.dart'
99
show AnalysisContextCollectionImpl;
1010
import 'package:collection/collection.dart';
11+
import 'package:mustachio/mustachio.dart' as mustachio;
1112
import 'package:path/path.dart' as path;
1213
import 'package:test_descriptor/test_descriptor.dart' as d;
1314

14-
import '../../tool/mustachio/builder.dart';
1515
import '../src/test_descriptor_utils.dart';
1616

17-
export '../../tool/mustachio/builder.dart';
18-
1917
/// The build package Asset for a copy of the Renderer annotation for tests.
2018
///
2119
/// In testing builders, the builder cannot access both in-line assets specified
@@ -76,7 +74,7 @@ $sourceLibraryContent
7674
]),
7775
]).create();
7876
await d.dir('foo_package', [...additionalAssets()]).create();
79-
await build(path.join(d.sandbox, 'foo_package', 'lib/foo.dart'),
77+
await mustachio.build(path.join(d.sandbox, 'foo_package', 'lib/foo.dart'),
8078
root: path.join(d.sandbox, 'foo_package'));
8179
}
8280

@@ -86,7 +84,7 @@ Future<LibraryElement> resolveGeneratedLibrary(String libraryPath) async {
8684
// TODO(jcollins-g): should we pass excluded directories here instead of
8785
// handling it ourselves?
8886
resourceProvider: PhysicalResourceProvider.INSTANCE,
89-
sdkPath: sdkPath,
87+
sdkPath: mustachio.sdkPath,
9088
);
9189
var analysisContext = contextCollection.contextFor(d.sandbox);
9290
final libraryResult =

tool/ci.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ if [ "$DARTDOC_BOT" = "sdk-docs" ]; then
1414
# silence stdout but echo stderr
1515
echo ""
1616
echo "Building and validating SDK docs..."
17-
dart run tool/task.dart validate sdk-docs
17+
dart run task validate sdk-docs
1818
echo "SDK docs process finished"
1919
elif [ "$DARTDOC_BOT" = "flutter" ]; then
2020
echo "Running flutter dartdoc bot"
21-
dart run tool/task.dart doc flutter
21+
dart run task doc flutter
2222
elif [ "$DARTDOC_BOT" = "packages" ]; then
2323
echo "Running packages dartdoc bot"
24-
dart run tool/task.dart doc package --name=access --version=">=3.0.0"
24+
dart run task doc package --name=access --version=">=3.0.0"
2525
# Negative test for flutter_plugin_tools, make sure right error message is displayed.
26-
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"
26+
dart run task doc package --name=flutter_plugin_tools --version=">=0.0.14+1" 2>&1 | grep "warning: package:flutter_plugin_tools has no documentable libraries"
2727
else
2828
echo "Running main dartdoc bot"
29-
dart run tool/task.dart buildbot
29+
dart run task buildbot
3030
fi
File renamed without changes.

0 commit comments

Comments
 (0)