Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
builder: stream build output to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
proppy committed Sep 4, 2015
1 parent 2ae6b9c commit e0bd449
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions builder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ dependencies {
test {
testLogging {
exceptionFormat 'full'
showStandardStreams = true
}
}
12 changes: 3 additions & 9 deletions builder/src/test/java/GradleBuildTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,9 @@ public void test() {
GradleConnector connector = GradleConnector.newConnector();
connector.forProjectDirectory(gradleProject);
ProjectConnection connection = connector.connect();
GradleProject project = connection.getModel(GradleProject.class);
for(GradleTask task : project.getChildren().getAt(0).getTasks()) {
System.err.println("task: " + task.getName());
}
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
ByteArrayOutputStream stderr = new ByteArrayOutputStream();
BuildLauncher launcher = connection.newBuild();
launcher.setStandardOutput(stdout);
launcher.setStandardError(stderr);
launcher.setStandardOutput(System.out);
launcher.setStandardError(System.err);
try {
launcher.forTasks("app:lint");
launcher.run();
Expand All @@ -102,7 +96,7 @@ public void test() {
launcher.forTasks("assembleRelease");
launcher.run();
} catch (BuildException e) {
fail(String.format("BUILD FAILED: %s\nSTDOUT: %s\nSTDERR: %s", e, stdout, stderr));
fail(String.format("BUILD FAILED: %s", e));
} finally {
connection.close();
}
Expand Down

0 comments on commit e0bd449

Please sign in to comment.