File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 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
152152 /// was not excluded on the command line.
153153 bool get isLocal {
154154 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.
158171 ! packageGraph.config.isPackageExcluded (name);
159172 }
160173 return _isLocal;
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ class PackageBuilder {
5252 return newGraph;
5353 }
5454
55- DartSdk _sdk;
55+ FolderBasedDartSdk _sdk;
5656
57- DartSdk get sdk {
57+ FolderBasedDartSdk get sdk {
5858 if (_sdk == null ) {
5959 _sdk = FolderBasedDartSdk (PhysicalResourceProvider .INSTANCE ,
6060 PhysicalResourceProvider .INSTANCE .getFolder (config.sdkDir));
You can’t perform that action at this time.
0 commit comments