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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/RunPubAction.java

Issue 779223005: fix for pub build dartbug.com/21781 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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 | « editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/pub/RunPubJobTest.java ('k') | 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/actions/RunPubAction.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/RunPubAction.java (revision 42132)
+++ editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/actions/RunPubAction.java (working copy)
@@ -140,6 +140,7 @@
if (object instanceof IFile) {
object = ((IFile) object).getParent();
}
+ IContainer sourceFolder = (IContainer) object;
while (object != null && ((IContainer) object).findMember(DartCore.PUBSPEC_FILE_NAME) == null) {
object = ((IContainer) object).getParent();
}
@@ -147,7 +148,7 @@
IContainer container = (IContainer) object;
instrumentation.data("name", container.getName());
savePubspecFile(container);
- runPubJob(container);
+ runPubJob(container, sourceFolder);
return;
} else {
instrumentation.metric("Problem", "Object was null").log();
@@ -199,15 +200,7 @@
}
protected void runPubJob(IContainer container) {
- if (container.findMember(DartCore.PUBSPEC_FILE_NAME) != null) {
- RunPubJob runPubJob = new RunPubJob(container, command, false);
- runPubJob.schedule();
- } else {
- MessageDialog.openError(
- getShell(),
- ActionMessages.RunPubAction_fail,
- ActionMessages.RunPubAction_fileNotFound);
- }
+ runPubJob(container, null);
}
private void copy(InputStream in, MessageConsole console) throws IOException {
@@ -222,6 +215,23 @@
}
}
+ private void runPubJob(IContainer container, IContainer sourceFolder) {
+ if (container.findMember(DartCore.PUBSPEC_FILE_NAME) != null) {
+ RunPubJob runPubJob;
+ if (command.equals(RunPubJob.BUILD_COMMAND) && container != sourceFolder) {
+ runPubJob = new RunPubJob(container, command, false, sourceFolder);
+ } else {
+ runPubJob = new RunPubJob(container, command, false);
+ }
+ runPubJob.schedule();
+ } else {
+ MessageDialog.openError(
+ getShell(),
+ ActionMessages.RunPubAction_fail,
+ ActionMessages.RunPubAction_fileNotFound);
+ }
+ }
+
private void savePubspecFile(IContainer container) {
IResource resource = container.findMember(DartCore.PUBSPEC_FILE_NAME);
if (resource != null) {
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/pub/RunPubJobTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698