Skip to content

Refactor DartdocConfig option usage, part 4 of 4 #1676

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 4 commits into from
Apr 19, 2018

Conversation

jcollins-g
Copy link
Contributor

@jcollins-g jcollins-g commented Apr 19, 2018

Fixes #1609. And finally, the payoff. Eliminate the old dartdoc config classes, seriously clean up bin/dartdoc.dart, define options a little more closely to where they are used, and make it at least not completely arcane to build your own generators in dartdoc extensions.

This implements, but doesn't finalize #1674. I'm going to write a series of integration tests for each new option and promote them to supported once I'm convinced they work reliably from config files, but that's an awful lot to throw into this PR, too.

Copy link
Member

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!


Map<String, Map<String, dynamic>> __crossdartJson;
// TODO(jcollins-g): move to [Package]
Map<String, Map<String, dynamic>> get crossdartJson {
if (__crossdartJson == null) {
// TODO(jcollins-g): allow crossdart.json location to be configurable
var crossdartFile =
new File(pathLib.join(config.inputDir.path, "crossdart.json"));
new File(pathLib.join(config.inputDir, "crossdart.json"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> 'crossdart.json'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -5000,7 +5007,7 @@ abstract class SourceCodeMixin implements Documentable {
}
} else if (uri.startsWith("dart:")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single quotes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -5000,7 +5007,7 @@ abstract class SourceCodeMixin implements Documentable {
}
} else if (uri.startsWith("dart:")) {
var packageName = "sdk";
var packageVersion = config.sdkVersion;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
return _sdk;
}

EmbedderSdk _embedderSdk;
EmbedderSdk get embedderSdk {
if (_embedderSdk == null && packageMeta.isSdk == false) {
if (_embedderSdk == null && config.packageMeta.isSdk == false) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!config.packageMeta.isSdk ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jcollins-g jcollins-g merged commit 9904835 into master Apr 19, 2018
@jcollins-g jcollins-g deleted the new-dartdoc-option-class+integration+link branch April 19, 2018 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow running from Dart code.
3 participants