Is there a way to determine which environment the build script is
being run from and set these params automatically?
Chris
One "old trick" is to use the "available" task and then set a property
based on the result. So probably your test environment has access to
"10.0.X.Y" (or whatever), but local doesn't. So you'd have something
like:
<condition property="hostname" value="whatever" else="somethingelse"
<available file="\10.0.X.Y\C$" type="dir" property="inTest"/>
</condition>
My preferred solution for this is to have host-specific properties
files that get sucked in prior to the main build.properties file:
<echo message="Attempting to include
properties/${user.name}.properties for any property overrides. Then
including properties/build.properties for default props"/>
<property file="properties/${user.name}.properties" />
<property file="properties/build.properties" />
And so on the test server, probably the build runs under a specific
account, like "app_admin" or whatever. so I'd have an
app_admin.properties file, with stuff like:
test.host=TestServerHost
test.port=TestServerPort
etc.
I also like this approach because it's team-friendly... each person on
the team (assuming they have different user.name values) can have
their own properties file, and so the build becomes much less
dependent on a specific server setup with respect to host names, path
locations, etc.
Marc
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups "mxunit" group.
> To post to this group, send email to mxu...@googlegroups.com.
> To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.
>
Another fine approach.