-
Notifications
You must be signed in to change notification settings - Fork 37
add dartfmt support #202
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
add dartfmt support #202
Conversation
@@ -33,6 +33,51 @@ Directory getSdkDir([List<String> cliArgs]) => cli_util.getSdkDir(cliArgs); | |||
|
|||
File get dartVM => joinFile(sdkDir, ['bin', _sdkBin('dart')]); | |||
|
|||
/// Utility tasks for for getting information about the Dart SDK and invoking | |||
/// dart applications. | |||
class Dart { |
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.
Should this class be called Dart
or DartSdk
?
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.
DartVM?
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.
I chose Dart
since it wraps the dart
executable, similar to how Pub
wraps pub
and Dart2js
wraps dart2js
. However we do have Analyzer
for dartanalyzer
, so we could do Dart2js
-> Compiler
and Dart
-> Vm
, but I kind of think the Dart
prefix is nice.
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.
Hmm, it might be interesting to namespace all the sdk stuff, so:
class Sdk {
/// Defaults the path to the current SDK.
Sdk([String path]);
static Directory get dir;
final Vm vm;
final Compiler compiler;
final Analyzer analyzer;
final Formatter formatter;
}
final Sdk sdk = new Sdk();
print('Sdk dir: ${sdk.dir}');
sdk.vm.run(...);
sdk.compiler.compile(...);
sdk.analyzer.analyze(...);
sdk.formatter.format(...);
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.
I left this as Dart
, and removed the location
static field. That would apply to a wrapper around the dartsdk, but not one around the dartvm.
Filed my review comments as #204, let's discuss there. |
Fix #168.
@seaneagan
Write a wrapper around the
dartfmt
SDK tool. This is scoped to just exposing what's in the SDK .The user still has the option of using aPubApp
wrapper around thedart_style
tool.(the
Analyzer
andDart2js
classes are unchanged; they just changed locations within the file)