We actually had a discussion about this recently.
The tooling api doesn't allow you to set the working dir so it's not
possible.

Your build script really shouldn't make any assumption regarding the
working directory.


On Tue, Feb 11, 2014 at 8:45 AM, Scott Barta <sba...@google.com> wrote:

> Is there some issue with your paths that it now can't find the command?
> Perhaps you should give it a fully-qualified path to the grunt executable.
> Also, do you have the same problems on all platforms?
>
> When you execute Gradle tasks from Android Studio, it doesn't make an
> attempt to set the working directory, though I don't know that it's changed
> in recent versions -- that might also be something to investigate.
>
>
> On Tue, Feb 11, 2014 at 8:00 AM, Matt Gaunt <matt.t.ga...@gmail.com>wrote:
>
>> Hey everyone,
>>
>> Since updating to 0.4, I've been able to run command line tools from
>> gradle.
>>
>> I used to have the following gradle build task:
>>
>>
>> task buildWebApp(type: Exec) {
>>     executable = Os.isFamily(Os.FAMILY_WINDOWS) ? "grunt.cmd" : "grunt"
>>
>>     args = ["build"]}
>>
>> This would pick the appropriate grunt command and run it with the
>> argument "build".
>>
>> This worked without any kind of issue
>>
>> In Android Studio 0.4, using Gradle 1.9 and it's no longer working.
>> Instead I get the following error:
>>
>> Execution failed for task ':BrowserPages:buildWebApp'. A problem occurred
>> starting process 'command 'grunt''
>>
>> Normally at this point I would debug with gradlew, but running the
>> following command, throws no errors:
>>
>> $ ./gradlew buildWebApp
>>
>> I've also tried running the full task list to still not find any problems.
>>
>> The way this is executed is from my main build.gradle file with this
>> dependency
>>
>> copyWebApplication.dependsOn ':BrowserPages:buildWebApp'
>>
>> Anyone have any ideas?
>>
>> I've tried to run executable = "node" with arg = ["-v"] and get the same
>> error where it can't find node. Node is globally accessible on my terminal,
>> so I can only assume that the command is being run in a different
>> environment to the terminal. There is the option for setting the
>> environment on the task but I can't find any examples of how it should be
>> used.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to adt-dev+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to adt-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to