Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

What's about to export AngularDriver class to be used outside? #687

Open
guid-empty opened this issue Feb 24, 2019 · 0 comments
Open

What's about to export AngularDriver class to be used outside? #687

guid-empty opened this issue Feb 24, 2019 · 0 comments

Comments

@guid-empty
Copy link

guid-empty commented Feb 24, 2019

Hi!

Is it possible to export AngularDriver class from this package to be used as one of available classes?

One of the cases is ability to check custom angular template in build pipeline, for example:

`
final plugin = AngularAnalyzerPlugin(PhysicalResourceProvider.INSTANCE);

  final versionCheckParams =
      new PluginVersionCheckParams('~/.dartServer/.analysis-driver', '/usr/lib/dart', '2.1.1');
  await plugin.handlePluginVersionCheck(versionCheckParams);

  final root = ContextRoot(rootPath, [], optionsFile: optionsPath);

  plugin.start(PluginCommunicationChannelStub());
  final genericDriver = plugin.createAnalysisDriver(root);
  final angularDriver = genericDriver as AngularDriver;

  genericDriver.addFile(angularTemplatePath);
  //  await genericDriver.performWork();

  final htmlResult = await angularDriver.requestHtmlResult(angularTemplatePath);

  print('angular template has errors -> ${htmlResult.errors.isNotEmpty}, ${dartResult.errors.isNotEmpty}');

  if (htmlResult.errors.isNotEmpty) {
    htmlResult.errors.forEach((AnalysisError error) {
      print(error.message);
      print(error.correction);
    });
  }

`

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant