Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: pkg/analyzer/lib/src/generated/bazel.dart

Issue 2506753002: When analyzing a Bazel/Blaze workspace in which no build has been run, assume Bazel. (Closed)
Patch Set: Rework using a static const. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/bazel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b81a0c8aee07dbc0f8023b8548ff91b7b060c722..2db33ff4e16ff736f749b8b6ce7aa2b91fff03a0 100644
--- a/pkg/analyzer/lib/src/generated/bazel.dart
+++ b/pkg/analyzer/lib/src/generated/bazel.dart
@@ -143,6 +143,12 @@ class BazelWorkspace {
static const String _WORKSPACE = 'WORKSPACE';
static const String _READONLY = 'READONLY';
+ /**
+ * Default prefix for "-genfiles" and "-bin" that will be assumed if no build
+ * output symlinks are found.
+ */
+ static const defaultSymlinkPrefix = 'bazel';
+
final ResourceProvider provider;
/**
@@ -281,8 +287,9 @@ class BazelWorkspace {
/**
* Return the symlink prefix for folders `X-bin` or `X-genfiles` by probing
- * the internal `blaze-genfiles` and `bazel-genfiles`. Return `null` if
- * neither of the folders exists.
+ * the internal `blaze-genfiles` and `bazel-genfiles`. Make a default
+ * assumption according to defaultSymlinkPrefix if neither of the folders
+ * exists.
*/
static String _findSymlinkPrefix(ResourceProvider provider, String root) {
Context context = provider.pathContext;
@@ -292,6 +299,7 @@ class BazelWorkspace {
if (provider.getFolder(context.join(root, 'bazel-genfiles')).exists) {
return 'bazel';
}
- return null;
+ // Couldn't find it. Make a default assumption.
+ return defaultSymlinkPrefix;
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/bazel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698