Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/bazel.dart |
| diff --git a/pkg/analyzer/lib/src/generated/bazel.dart b/pkg/analyzer/lib/src/generated/bazel.dart |
| index f3d8dd59acea315b64bdfb03763a26433fa51669..55d3c3df630a4f7a0a7e6afbfd7cc288dada074a 100644 |
| --- a/pkg/analyzer/lib/src/generated/bazel.dart |
| +++ b/pkg/analyzer/lib/src/generated/bazel.dart |
| @@ -106,8 +106,8 @@ class BazelWorkspace { |
| final String root; |
| /** |
| - * The absolute path to the optional `READONLY` folder if a git-based |
| - * workspace, or `null`. |
| + * The absolute path to the optional read only workspace root, in the |
| + * `READONLY` folder if a git-based workspace, or `null`. |
| */ |
| final String readonly; |
| @@ -179,9 +179,12 @@ class BazelWorkspace { |
| * |
| * Return `null` if the workspace does not have `bazel-genfiles` or |
| * `blaze-genfiles` folders, so we don't know where to search generated files. |
| + * |
| + * Return `null` if there is a folder 'foo' with the sibling `READONLY` |
| + * folder, but there is corresponding folder 'foo' in `READONLY`, i.e. the |
| + * corresponding readonly workspace root. |
| */ |
| - static BazelWorkspace find(ResourceProvider provider, String path, |
| - {String readonlySuffix}) { |
| + static BazelWorkspace find(ResourceProvider provider, String path) { |
| Context context = provider.pathContext; |
| // Ensure that the path is absolute and normalized. |
| @@ -198,22 +201,27 @@ class BazelWorkspace { |
| } |
| // Found the READONLY folder, must be a git-based workspace. |
| - if (readonlySuffix != null) { |
| - Folder readonlyFolder = parent.getChildAssumingFolder(_READONLY); |
| - if (readonlyFolder.exists) { |
| - String root = folder.path; |
| - String readonly = readonlyFolder.path; |
| - String symlinkPrefix = _findSymlinkPrefix(provider, root); |
| - if (symlinkPrefix == null) { |
| - return null; |
| - } |
| - return new BazelWorkspace._( |
| - provider, |
| - root, |
| - context.join(readonly, readonlySuffix), |
| - context.join(root, '$symlinkPrefix-bin'), |
| - context.join(root, '$symlinkPrefix-genfiles')); |
| + Folder readonlyFolder = parent.getChildAssumingFolder(_READONLY); |
| + if (readonlyFolder.exists) { |
| + String root = folder.path; |
| + // Prepare the readonly root. |
| + String readonlyRoot = |
| + context.join(readonlyFolder.path, folder.shortName); |
| + if (!provider.getFolder(readonlyRoot).exists) { |
| + return null; |
|
Paul Berry
2016/10/07 20:44:38
Do we really want to return `null` at this point?
scheglov
2016/10/07 21:02:50
Done.
|
| + } |
| + // Find the build system symlink. |
| + String symlinkPrefix = _findSymlinkPrefix(provider, root); |
| + if (symlinkPrefix == null) { |
| + return null; |
|
Paul Berry
2016/10/07 20:44:38
Similar issue here.
|
| } |
| + // OK |
| + return new BazelWorkspace._( |
| + provider, |
| + root, |
| + readonlyRoot, |
| + context.join(root, '$symlinkPrefix-bin'), |
| + context.join(root, '$symlinkPrefix-genfiles')); |
| } |
| // Found the WORKSPACE file, must be a non-git workspace. |