That was exactly what we needed... thanks a bunch!

On Thu, Jun 23, 2011 at 2:22 PM, Adam Murdoch
<[email protected]> wrote:
>
> On 24/06/2011, at 12:04 AM, James Carr wrote:
>
> Hi All,
>
> I want to parameterize our tests to run against different environments
> based on properties passed from the commandline.
>
> I tried doing the following: -Denvironment=dev
>
> But I can't seem to access this within a test via the
> System.getProperties() map. Any ideas?
>
>
> The test task uses an empty map of system properties by default. If you want
> to copy the system properties from the build process (and hence from the
> command-line), you can do something like:
> test {
>     systemProperties = System.properties
> }
> Alternatively, you might copy across just the properties you need:
> test {
>     systemProperties environment: System.properties['environment']
> }
>
> --
> Adam Murdoch
> Gradle Co-founder
> http://www.gradle.org
> VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
> http://www.gradleware.com
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to