File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
find SDK, for example using ` package:cli_util ` .
5
5
* Fixed ` LintDriver ` for the new way to access ` WorkspacePackage ` .
6
6
* Deprecated ` Scope.lookup() ` , use ` Scope.lookup2() ` instead.
7
+ * Updated implementations of ` ContextBuilder.createContext() ` and
8
+ ` ContextLocator.locateContexts ` to use the current SDK if ` sdkPath `
9
+ is not provided.
7
10
8
11
## 0.39.13
9
12
* Added 'dart/sdk/build_sdk_summary.dart' with ` buildSdkSummary ` .
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import 'package:analyzer/src/dart/analysis/performance_logger.dart'
22
22
show PerformanceLog;
23
23
import 'package:analyzer/src/generated/sdk.dart' show DartSdkManager;
24
24
import 'package:analyzer/src/generated/source.dart' show ContentCache;
25
+ import 'package:cli_util/cli_util.dart' ;
25
26
import 'package:meta/meta.dart' ;
26
27
27
28
/// An implementation of a context builder.
@@ -44,8 +45,10 @@ class ContextBuilderImpl implements ContextBuilder {
44
45
List <String > librarySummaryPaths,
45
46
@deprecated PerformanceLog performanceLog,
46
47
@deprecated AnalysisDriverScheduler scheduler,
47
- @required String sdkPath,
48
+ String sdkPath,
48
49
String sdkSummaryPath}) {
50
+ // TODO(scheglov) Remove this, and make `sdkPath` required.
51
+ sdkPath ?? = getSdkPath ();
49
52
ArgumentError .checkNotNull (sdkPath, 'sdkPath' );
50
53
51
54
var byteStore = MemoryByteStore ();
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import 'package:analyzer/src/dart/analysis/performance_logger.dart'
26
26
import 'package:analyzer/src/generated/sdk.dart' show DartSdkManager;
27
27
import 'package:analyzer/src/task/options.dart' ;
28
28
import 'package:analyzer/src/util/yaml.dart' ;
29
+ import 'package:cli_util/cli_util.dart' ;
29
30
import 'package:glob/glob.dart' ;
30
31
import 'package:meta/meta.dart' ;
31
32
import 'package:path/path.dart' ;
@@ -56,7 +57,9 @@ class ContextLocatorImpl implements ContextLocator {
56
57
List <String > excludedPaths = const < String > [],
57
58
String optionsFile,
58
59
String packagesFile,
59
- @required String sdkPath}) {
60
+ String sdkPath}) {
61
+ // TODO(scheglov) Remove this, and make `sdkPath` required.
62
+ sdkPath ?? = getSdkPath ();
60
63
ArgumentError .checkNotNull (sdkPath, 'sdkPath' );
61
64
62
65
List <ContextRoot > roots = locateRoots (
You can’t perform that action at this time.
0 commit comments