[GRADLE-1347] announce growl plugin broken in 0.9.2 Created: 24/Jan/11  Updated: 04/Jan/13  Resolved: 25/Jan/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.9.2
Fix Version/s: 1.0-milestone-1

Type: Bug
Reporter: Gianni Bruno Assignee: Peter Niederwieser
Resolution: Fixed Votes: 0


 Description   

After upgrading to 0.9.2 the announce plugin gives the following exception:

war.doLast {
announce("WAR complete", "growl") // line 141
}

[org.gradle.BuildExceptionReporter] * What went wrong:
[org.gradle.BuildExceptionReporter] Execution failed for task ':war'.
[org.gradle.BuildExceptionReporter] Cause: Cannot convert relative path . to an absolute file.
[org.gradle.BuildExceptionReporter]
[org.gradle.BuildExceptionReporter] * Exception is:
[org.gradle.BuildExceptionReporter] org.gradle.api.tasks.LocationAwareTaskExecutionException: Build file '/Volumes/Storage/Projects/AProj/build.gradle' line: 141
[org.gradle.BuildExceptionReporter] Execution failed for task ':war'.



 Comments   
Comment by Peter Niederwieser [ 25/Jan/11 ]

The underlying problem is the following: The Growl class uses JavaExec to run "growlnotify", but doesn't specify a working directory. However, not specifying a working dir for JavaExec no longer works since the following code change was made (could be a bug):

git diff 5320040 305e06f – subprojects/gradle-core/src/main/groovy/org/gradle/process/internal/DefaultProcessForkOptions.java

                          
diff --git a/subprojects/gradle-core/src/main/groovy/org/gradle/process/internal/DefaultProcessForkOptions.java b/subprojects/gradle-core/src/main/groovy/org/gradle/process/internal/DefaultProcessForkOptions.java
index 9129f69..b3b3544 100755
--- a/subprojects/gradle-core/src/main/groovy/org/gradle/process/internal/DefaultProcessForkOptions.java
+++ b/subprojects/gradle-core/src/main/groovy/org/gradle/process/internal/DefaultProcessForkOptions.java
@@ -32,7 +32,7 @@ public class DefaultProcessForkOptions implements ProcessForkOptions {
 
     public DefaultProcessForkOptions(FileResolver resolver) {
         this.resolver = resolver;
-        workingDir = resolver.resolveLater(new File(".").getAbsoluteFile());
+        workingDir = resolver.resolveLater(".");
     }
Comment by Peter Niederwieser [ 25/Jan/11 ]

Now using project.exec() to run growlnotify.

Generated at Wed Jun 30 11:53:15 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.