File tree 2 files changed +18
-5
lines changed 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -152,9 +152,22 @@ class Package extends LibraryContainer
152
152
/// was not excluded on the command line.
153
153
bool get isLocal {
154
154
if (_isLocal == null ) {
155
- _isLocal = (packageMeta == packageGraph.packageMeta ||
156
- packageGraph.hasEmbedderSdk && packageMeta.isSdk ||
157
- packageGraph.config.autoIncludeDependencies) &&
155
+ _isLocal = (
156
+ // Document as local if this is the default package.
157
+ packageMeta == packageGraph.packageMeta ||
158
+ // Assume we want to document an embedded SDK as local if
159
+ // it has libraries defined in the default package.
160
+ // TODO(jcollins-g): Handle case where embedder SDKs can be
161
+ // assembled from multiple locations?
162
+ packageGraph.hasEmbedderSdk &&
163
+ packageMeta.isSdk &&
164
+ libraries.any ((l) => path.isWithin (
165
+ packageGraph.packageMeta.dir.path,
166
+ (l.element.source.fullName))) ||
167
+ // autoIncludeDependencies means everything is local.
168
+ packageGraph.config.autoIncludeDependencies) &&
169
+ // Regardless of the above rules, do not document as local if
170
+ // we excluded this package by name.
158
171
! packageGraph.config.isPackageExcluded (name);
159
172
}
160
173
return _isLocal;
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ class PackageBuilder {
52
52
return newGraph;
53
53
}
54
54
55
- DartSdk _sdk;
55
+ FolderBasedDartSdk _sdk;
56
56
57
- DartSdk get sdk {
57
+ FolderBasedDartSdk get sdk {
58
58
if (_sdk == null ) {
59
59
_sdk = FolderBasedDartSdk (PhysicalResourceProvider .INSTANCE ,
60
60
PhysicalResourceProvider .INSTANCE .getFolder (config.sdkDir));
You can’t perform that action at this time.
0 commit comments