What are you trying to achieve?

Try the following snippet to create a text box:

  <f:entry title="${%Checkstyle results}" field="myProjectFile">
    <f:textbox/>
  </f:entry>

This will read and write to the field 'pattern' in your builder. (I'm not sure 
if the method is allowed to throw an exception).

Ulli 

Am 17.10.2013 um 01:07 schrieb moto_timo <[email protected]>:

> My confusion/misunderstanding is with the syntax in jelly to access 
> ${Workspace} (tried the following):
>     <f:entry title="Some Workspace" field="someWorkspace" >
>        <j:set var="someWorkspace" value="${build.getWorkspace()}" />
>        <f:textbox  name="myBuilder.someWorkspace" 
> default="${instance.someWorkspace}" value="${instance.someWorkspace}" />
>     </f:entry>
> 
> or in my MyBuilder.java:
>     public String getMyProjectFile() throws InterruptedException,IOException{
>         if (myProjectFile == null) {
>             /* TODO: get file(s) with .proj extension from workspace */
>             myProjectFile = findProjectFile(new FilePath(new 
> File(someWorkspace)));
>         }
>         return myProjectFile;
>     }
> 
> which calls a method in MyProjectFile.java:
>     public File findProjectFile(FilePath whichPath)
>             throws InterruptedException,IOException {
>         File projectFile = whichPath.act(new FileCallable<File>() {
>         private static final long serialVersionUID = 1L;
>         static final String extension = ".proj";
> 
>             public File invoke(File dir, VirtualChannel channel) throws 
> InterruptedException, IOException{
>                  for (File file : dir.listFiles())
>                  {
>                      if 
> (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(extension)) {
>                          return file;
>                      } else { return null; }
>                   }
>                  return null;
>             }
>         });
>         return projectFile;
>     }
> 
> 
> On Wednesday, October 16, 2013 12:33:23 AM UTC-7, Robert Sandell wrote:
> Take a look at FilePath [1] which the reference of the workspace it a type 
> of. The list method [2] is probably what you are after.
> 
>  
> [1] http://javadoc.jenkins-ci.org/hudson/FilePath.html
> 
> [2] http://javadoc.jenkins-ci.org/hudson/FilePath.html#list(java.lang.String)
> 
>  
>  
> 
> Robert Sandell
> 
> Software Tools Engineer - SW Environment and Product Configuration
> 
> Sony Mobile Communications
> 
>  
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of moto_timo
> Sent: den 15 oktober 2013 22:58
> To: [email protected]
> Subject: custom builder plugin, populate jelly with filenames from workspace?
> 
>  
> I have written a custom builder plugin which calls a proprietary windows 
> command line compiler. This compiler takes as arguments several files which 
> are pulled into the workspace from subversion. I would like to be able to 
> automatically populate the build step configuration with files detected in 
> the workspace. It would also be acceptable to populate the configuration with 
> files detected in the subversion repository.
> 
>  
> I'm a bit stumped as to how to achieve this. Any suggestions? 
> 
> -- 
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> -- 
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to