Ok, I think I got it it by looking at the unit tests:
https://github.com/jenkinsci/envinject-plugin/blob/master/src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java
def buildWrapper = new org.jenkinsci.plugins.envinject.EnvInjectBuildWrapper()
def envInjectInfo = new
org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo(null,"CCRoot=\${WORKSPACE}/JobNightlyDebug",null,null,null,false)
buildWrapper.setInfo(envInjectInfo)
job.getBuildWrappersList().add(buildWrapper )
This is really cool.:-D Sorry for the noise...
BR
Dirk
2012/6/5 Dirk Kuypers <[email protected]>:
> Hi,
>
> there are two problems left writing job configurations
> programmatically via groovy for me. The first is to configure the
> EnvInjectBuildWrapper plugin. I need the following, but I cannot find
> the appropriate constructor, even by browsing the plugin sources. I
> want to achieve the following:
>
> <buildWrappers>
> <EnvInjectBuildWrapper>
> <info>
>
> <propertiesContent>CCRoot=${WORKSPACE}/JobNightlyDebug</propertiesContent>
> <loadFilesFromMaster>false</loadFilesFromMaster>
> </info>
> </EnvInjectBuildWrapper>
> </buildWrappers>
>
> I added something where the sub-types are somehow generated by magic,
> but this is only half of the stuff:
>
> job.getBuildWrappersList().add(new
> org.jenkinsci.plugins.envinject.EnvInjectInfo("","CCRoot=\${WORKSPACE}/JobNightlyDebug"))
>
> <org.jenkinsci.plugins.envinject.EnvInjectInfo>
>
> <propertiesContent>CCRoot=${WORKSPACE}/JobNightlyDebug</propertiesContent>
> </org.jenkinsci.plugins.envinject.EnvInjectInfo>
>
> The same applies to the xunit plugin, I cannot find a constructor to xunit.
>
> <publishers>
> <xunit>
> <types>
> <MSTestJunitHudsonTestType>
> <pattern>TestResults\${JOB_NAME}.trx</pattern>
> <faildedIfNotNew>true</faildedIfNotNew>
> <deleteOutputFiles>true</deleteOutputFiles>
> <stopProcessingIfError>false</stopProcessingIfError>
> </MSTestJunitHudsonTestType>
> </types>
> <thresholds>
> <org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
> <unstableThreshold></unstableThreshold>
> <unstableNewThreshold></unstableNewThreshold>
> <failureThreshold></failureThreshold>
> <failureNewThreshold></failureNewThreshold>
> </org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
> <org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
> <unstableThreshold></unstableThreshold>
> <unstableNewThreshold></unstableNewThreshold>
> <failureThreshold></failureThreshold>
> <failureNewThreshold></failureNewThreshold>
> </org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
> </thresholds>
> </xunit>
> </publishers>
>
> Any help very appreciated.:-)
>
> Thanks
> Dirk
> --
> Never trust a short-haired guru
--
Never trust a short-haired guru