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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/pub/RunPubJob.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 | « no previous file | editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/pub/RunPubJobTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/pub/RunPubJob.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/pub/RunPubJob.java (revision 42132)
+++ editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/pub/RunPubJob.java (working copy)
@@ -60,7 +60,6 @@
/**
* The directory which contains the sources to build, used only for pub build command
*/
- @SuppressWarnings("unused")
private final IContainer sourceFolder;
/**
@@ -127,7 +126,7 @@
File pubFile = sdk.getPubExecutable();
ProcessBuilder builder = new ProcessBuilder();
- builder.directory(container.getLocation().toFile());
+ builder.directory(DartCore.getApplicationDirectory(container).getLocation().toFile());
builder.redirectErrorStream(true);
List<String> args = new ArrayList<String>();
@@ -145,16 +144,13 @@
if (command.equals(BUILD_COMMAND)) {
args.add("--mode");
args.add("debug");
- // TODO(keertip): figure out why build fails when passing in folder name.
- args.add("--all");
-// if (sourceFolder != null) {
-// String folderName = getPubDirectoryParent(sourceFolder);
-// if (folderName != null) {
-// args.add(folderName);
-// }
-// } else {
-// args.add("--all");
-// }
+ if (sourceFolder != null) {
+ String name = sourceFolder.getFullPath().removeFirstSegments(
+ container.getFullPath().segmentCount()).toString();
+ args.add(name);
+ } else {
+ args.add("--all");
+ }
}
builder.command(args);
@@ -227,17 +223,6 @@
return new ProcessRunner(builder);
}
- @SuppressWarnings("unused")
- private String getPubDirectoryParent(IContainer folder) {
- while (folder != null) {
- if (DartCore.pubDirectories.contains(folder.getName())) {
- return folder.getName();
- }
- folder = folder.getParent();
- }
- return null;
- }
-
private void setDerived(IProgressMonitor monitor) {
IFolder buildDir = container.getFolder(new Path("build"));
try {
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/pub/RunPubJobTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698