Files
sdk/pkg/analyzer/lib/plugin/task.dart
T
Konstantin Shcheglov 597f189eb4 Extension point for WorkManagerFactory(s).
I'm not quite happy that internal classes get into the extension point declaration.
But I guess that because of the nature of the work WorkManager(s) are doing, we have to have significant exposure to internals.

Also, onAnalysisOptionsChanged() and onSourceFactoryChanged()... these probably are better to implement as streams in InternalAnalysisContext.
Thoughts?

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//1311773005 .
2015-08-26 09:45:19 -07:00

37 lines
1.3 KiB
Dart

// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* Support for client code that extends the analysis engine by adding new
* analysis tasks.
*/
library analyzer.plugin.task;
import 'package:analyzer/src/generated/engine.dart' hide WorkManager;
import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/task/model.dart';
import 'package:plugin/plugin.dart';
/**
* The identifier of the extension point that allows plugins to register new
* analysis tasks with the analysis engine. The object used as an extension must
* be a [TaskDescriptor].
*/
final String TASK_EXTENSION_POINT_ID = Plugin.join(
EnginePlugin.UNIQUE_IDENTIFIER, EnginePlugin.TASK_EXTENSION_POINT);
/**
* The identifier of the extension point that allows plugins to register new
* work managers with the analysis engine. The object used as an extension must
* be a [WorkManagerFactory].
*/
final String WORK_MANAGER_EXTENSION_POINT_ID = Plugin.join(
EnginePlugin.UNIQUE_IDENTIFIER,
EnginePlugin.WORK_MANAGER_FACTORY_EXTENSION_POINT);
/**
* A function that will create a new [WorkManager] for the given [context].
*/
typedef WorkManager WorkManagerFactory(InternalAnalysisContext context);