尋常でないもふもふ

a software engineer blog

WebStrom で Dart

インストール

Mac なので brew でインストール。

$ brew install dart
==> Downloading http://storage.googleapis.com/dart-archive/channels/stable/release/30798/sdk/dartsdk
######################################################################## 100.0%
==> Caveats
To use with IntelliJ, set the Dart home to:
  /usr/local/opt/dart/libexec
==> Summary
  /usr/local/Cellar/dart/30798: 386 files, 26M, built in 9 seconds

WebStrom 設定

上記のインストールで親切なことに「Dart home」が "/usr/local/opt/dart/libexec" にあると記述されてるので、WebStrom で設定。

f:id:jnst:20131222181654p:plain

実行

プロジェクト作って hello.dart ファイル作ってハローワールドを書く。

void main() {
  print('hello, world');
}

メニューの Run から EditConfigurations を選択。+マークを押して「Dart Command Line Application」を選択。
Dart File」のところに hello.dart を指定すれば完了。そして実行。