dart コードのドキュメントを生成しようとしています。ライブラリ内で外部ライブラリをインポートする必要がある場合があるため、DartDoc を介してドキュメントを生成できないことに気付きました。
以下に、実際の問題を示す小さな例を示します。
listController.dart
part of controllers;
@NgController (
selector: '[list-control]',
publishAs: 'listCtrl'
)
class ListController {
}
controllers.dart
library controllers;
import 'package:angular/angular.dart';
part 'listController.dart';
コンソールの最終結果
Running dartdoc...
Using snapshot /Users/ecomtemarois/Downloads/dart/dart-sdk/bin/snapshots/utils_wrapper.dart.snapshot
Analyzing libraries...
../../../Documents/ecash.dart/ecash/controllers/controllers.dart:3:8: Error: Can't read 'package:angular/angular.dart' (Error reading 'packages/angular/angular.dart' (OS Error: No such file or directory, errno = 2)).
import 'package:angular/angular.dart';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../Documents/ecash.dart/ecash/controllers/listController.dart:3:2: Error: Cannot resolve 'NgController'.
@NgController (
^^^^^^^^^^^^
../../../Documents/ecash.dart/ecash/controllers/listController.dart:3:1: Error: Not a compile-time constant.
@NgController (
^^^^^^^^^^^^^^^^
Error: generation failed: Bad state: Failed to create mirror system.
StackTrace: #0 analyze.<anonymous closure> (file:///Volumes/data/b/build/slave/dart-editor-mac-trunk/build/dart/sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart:232)
#1 _Future._propagateToListeners.<anonymous closure> (dart:async/future_impl.dart:457)
#2 _rootRun (dart:async/zone.dart:720)
#3 _RootZone.run (dart:async/zone.dart:862)
#4 _Future._propagateToListeners (dart:async/future_impl.dart:449)
#5 _Future._complete (dart:async/future_impl.dart:302)
#6 Future.forEach.nextElement (dart:async/future.dart:269)
#7 _Future._propagateToListeners.<anonymous closure> (dart:async/future_impl.dart:457)
#8 _rootRun (dart:async/zone.dart:720)
#9 _RootZone.run (dart:async/zone.dart:862)
#10 _Future._propagateToListeners (dart:async/future_impl.dart:449)
#11 _Future._complete (dart:async/future_impl.dart:302)
#12 Future.forEach.nextElement (dart:async/future.dart:269)
#13 _Future._propagateToListeners.<anonymous closure> (dart:async/future_impl.dart:457)
#14 _rootRun (dart:async/zone.dart:720)
#15 _RootZone.run (dart:async/zone.dart:862)
#16 _Future._propagateToListeners (dart:async/future_impl.dart:449)
#17 _Future._complete (dart:async/future_impl.dart:302)
#18 _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:358)
#19 _asyncRunCallback (dart:async/schedule_microtask.dart:18)
#20 _createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:11)
#21 _Timer._createTimerHandler._handleTimeout (timer_impl.dart:151)
#22 _Timer._createTimerHandler.<anonymous closure> (timer_impl.dart:166)
#23 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:93)
これらのパッケージにアクセスし、ドキュメントを生成できるようにする方法を知りたいです。
ありがとう