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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/projects/CreateFolderWizard.java

Issue 15798021: fix for dartbug.com/11145 - run pub install for lib dir creation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/projects/CreateFolderWizard.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/projects/CreateFolderWizard.java (revision 23812)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/projects/CreateFolderWizard.java (working copy)
@@ -98,7 +98,8 @@
}
// if new folder is pub white listed directory/sub-directory, run pub install
// to create the link to packages
- if (pubDirectories.contains(folder.getName()) || isPubDirectoryParent(folder)) {
+ if (pubDirectories.contains(folder.getName()) || isPubDirectoryParent(folder)
+ || isLibDirectory(folder)) {
IContainer pubspecDir = getPubWorkingDir(folder);
if (pubspecDir != null) {
RunPubJob job = new RunPubJob(pubspecDir, RunPubJob.INSTALL_COMMAND);
@@ -121,6 +122,14 @@
return null;
}
+ private boolean isLibDirectory(IFolder folder) {
+ if (folder.getName().equals("lib")
+ && (folder.getParent().findMember(DartCore.PUBSPEC_FILE_NAME) != null)) {
+ return true;
+ }
+ return false;
+ }
+
private boolean isPubDirectoryParent(IFolder folder) {
IContainer parent = folder.getParent();
while (parent != null) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698