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

Unified Diff: sdk/lib/_internal/pub/lib/src/package.dart

Issue 482053002: Precompile dependencies' executables for use with "pub run". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make our SDK version file match the SDK's. Created 6 years, 4 months 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 | « sdk/lib/_internal/pub/lib/src/executable.dart ('k') | sdk/lib/_internal/pub/lib/src/package_graph.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/package.dart
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart
index 4333648476f95e2bf1a6853bc821506b023dc905..b826016af0ec4b3e50f1a6d630b057ecabdf8273 100644
--- a/sdk/lib/_internal/pub/lib/src/package.dart
+++ b/sdk/lib/_internal/pub/lib/src/package.dart
@@ -124,8 +124,10 @@ class Package {
/// If this is a Git repository, this will respect .gitignore; otherwise, it
/// will return all non-hidden, non-blacklisted files.
///
- /// If [beneath] is passed, this will only return files beneath that path.
- List<String> listFiles({String beneath}) {
+ /// If [beneath] is passed, this will only return files beneath that path. If
+ /// [recursive] is true, this will return all files beneath that path;
+ /// otherwise, it will only return files one level beneath it.
+ List<String> listFiles({String beneath, recursive: true}) {
if (beneath == null) beneath = dir;
// This is used in some performance-sensitive paths and can list many, many
@@ -145,6 +147,12 @@ class Package {
["ls-files", "--cached", "--others", "--exclude-standard",
relativeBeneath],
workingDir: dir);
+
+ // If we're not listing recursively, strip out paths that contain
+ // separators. Since git always prints forward slashes, we always detect
+ // them.
+ if (recursive) files = files.where((file) => !file.contains('/'));
+
// Git always prints files relative to the repository root, but we want
// them relative to the working directory. It also prints forward slashes
// on Windows which we normalize away for easier testing.
@@ -156,7 +164,7 @@ class Package {
return fileExists(file);
});
} else {
- files = listDir(beneath, recursive: true, includeDirs: false,
+ files = listDir(beneath, recursive: recursive, includeDirs: false,
whitelist: _WHITELISTED_FILES);
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/executable.dart ('k') | sdk/lib/_internal/pub/lib/src/package_graph.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698