On 28.08.2015, at 06:20, Vinodhini Vijay <vinodhini.vi...@gmail.com> wrote:

> I  had overridden the method :
> 
> public void setUp(Context context, Run<?, ?> run, FilePath workspace, 
> Launcher launcher, TaskListener listener, EnvVars initialEnvironment)
>             throws IOException, InterruptedException 
> 
> But, how to get the workspace directory location from the Run object? (As I 
> have to read some file within workspace)

The point of SimpleBuildWrapper and similar other interfaces is that it tells 
you e.g. the relevant workspace as a parameter. This way your Workflow job/run 
can have any number of workspaces in parallel.

---

On 28.08.2015, at 08:37, Mads Nielsen <m...@praqma.net> wrote:

> You can get the Workspace from the run object by doing 
> run.getExecutor().getCurrentWorkspace(). 

>From Javadoc of Executor#getCurrentWorkspace():

> If current executable is AbstractBuild, return the workspace that this 
> executor is using, or null if the build hasn't gotten to that point yet.

So that won't work for Workflow, which isn't based on AbstractBuild.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/DAB9D791-D55D-498C-8BB6-AFD300A15964%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to