-
Notifications
You must be signed in to change notification settings - Fork 131
generate docs for dart sdk #110
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3d5ff5e
generate docs for sdk
keertip 10540a4
fix lib name
keertip 56d440d
get sdk version info
keertip 4975efa
fix message
keertip 16e105d
Merge branch 'master' into sdk
keertip e032b1d
add tests
keertip b7d83ab
fix formating
keertip File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,6 @@ library dartdoc.model_test; | |
|
|
||
| import 'dart:io'; | ||
|
|
||
| import 'package:dartdoc/src/model.dart'; | ||
| import 'package:grinder/grinder.dart' as grinder; | ||
| import 'package:unittest/unittest.dart'; | ||
|
|
||
|
|
@@ -18,6 +17,9 @@ import 'package:analyzer/src/generated/sdk.dart'; | |
| import 'package:analyzer/src/generated/sdk_io.dart'; | ||
| import 'package:analyzer/src/generated/source_io.dart'; | ||
|
|
||
| import '../lib/src/model.dart'; | ||
| import '../lib/src/model_utils.dart'; | ||
|
|
||
| const SOURCE1 = r''' | ||
| library ex; | ||
|
|
||
|
|
@@ -67,6 +69,20 @@ tests() { | |
| test('is documented', () { | ||
| expect(p.isDocumented(l), true); | ||
| }); | ||
|
|
||
| var p2 = new Package([e], Directory.current.path, '1.9.0-dev.3.0', true); | ||
|
|
||
| test('sdk name', () { | ||
| expect(p2.name, 'Dart API Reference'); | ||
| }); | ||
|
|
||
| test('sdk version', () { | ||
| expect(p2.version, '1.9.0-dev.3.0'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will this change over time? will that make it hard to keep updated?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is just a test and does not need to be updated. |
||
| }); | ||
|
|
||
| test('sdk description', () { | ||
| expect(p2.description, 'Dart API Libraries'); | ||
| }); | ||
| }); | ||
|
|
||
|
|
||
|
|
@@ -75,6 +91,13 @@ tests() { | |
| test('name', () { | ||
| expect(l.name, 'ex'); | ||
| }); | ||
|
|
||
| Library sdkLib = new Library(getSdkLibrariesToDocument(helper.sdk, helper.context)[0]); | ||
|
|
||
| test('sdk library name', () { | ||
| expect(sdkLib.name, 'dart:async'); | ||
| }); | ||
|
|
||
| }); | ||
|
|
||
| group('Class', () { | ||
|
|
@@ -273,14 +296,15 @@ tests() { | |
|
|
||
| class AnalyzerHelper { | ||
| AnalysisContext context; | ||
| DartSdk sdk; | ||
|
|
||
| AnalyzerHelper() { | ||
| _initAnalyzer(); | ||
| } | ||
|
|
||
| void _initAnalyzer() { | ||
| Directory sdkDir = grinder.getSdkDir(['']); | ||
| DartSdk sdk = new DirectoryBasedDartSdk(new JavaFile(sdkDir.path)); | ||
| sdk = new DirectoryBasedDartSdk(new JavaFile(sdkDir.path)); | ||
| List<UriResolver> resolvers = [new DartUriResolver(sdk), new FileUriResolver()]; | ||
|
|
||
| SourceFactory sourceFactory = new SourceFactory(resolvers); | ||
|
|
@@ -304,4 +328,5 @@ class AnalyzerHelper { | |
| } | ||
|
|
||
| LibraryElement resolve(Source librarySource) => context.computeLibraryElement(librarySource); | ||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always confuses me. When can we rename JavaFile? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will talk to the analyzer folks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://code.google.com/p/dart/issues/detail?id=22075 :)