Hi

I just took the following exec task :

        <exec>
            <environment>
                <variable name="LibDir" value="C:\CruiseControl\Release\" />
            </environment>
            <executable>in.bat</executable>
            <baseDirectory>D:\</baseDirectory>
            <buildTimeoutSeconds>4000</buildTimeoutSeconds>
        </exec>

the in.bat file is just the following :
set >d:\info.txt


and when I build this project, I see the libdir variable in info.txt :
libdir=C:\CruiseControl\Release\

What I do notice is that it is lower cased, so maybe you should adjust
echo LibDir is $(LibDir)
       to
echo LibDir is $(libdir)


with kind regards
Ruben Willems


On 26 January 2012 12:58, Paul Omta <[email protected]> wrote:

> Hello everyone,
> I have the following problem. I need to set an environment variable to
> set a library path and I would like to do this from the
> cruisecontrol.net configuration file to have all configuration in one
> file. This did not work, so I created a test project. Here is the
> ccnet.config file:
>
> <cruisecontrol xmlns:cb="urn:ccnet.config.builder" xmlns="http://
> thoughtworks.org/ccnet/1/6">
>        <project name="Environment Test">
>                <category>Test</category>
>                <artifactDirectory>C:\CruiseControl\Artifacts\EnvTest\</
> artifactDirectory>
>
>  <workingDirectory>C:\CruiseControl\EnvTest\</workingDirectory>
>                <tasks>
>                        <devenv>
>                                <environment>
>                                        <variable name="LibDir"
> value="C:\CruiseControl\Release\" />
>                                </environment>
>                                <solutionfile>EnvTest.vcxproj</solutionfile>
>                                <buildtype>Rebuild</buildtype>
>                                <configuration>Release|Win32</configuration>
>                        </devenv>
>                </tasks>
>                <publishers>
>                        <xmllogger />
>                </publishers>
>        </project>
> </cruisecontrol>
>
> The EnvTest.vcxproj only has a post-build step which echoes
> environment variables. A snippet:
>    <PostBuildEvent>
>      <Command>echo Environment variables:
> echo LibDir is $(LibDir)
> echo USERNAME is $(USERNAME)
> </Command>
>
> I guess I need to either:
> - set the environment variable before starting the ccnet server, or
> - make a separate user for the ccnet server which has the environment
> variables set.
>
> Both options work, but we would much rather have all build
> configuration in the ccnet.config file and not need to make other
> settings. Plus, the documentation mentions the environment variable
> option, so I guess this is a bug.
>
> Can anyone confirm?
>

Reply via email to