Skip to content

rbm setup

inazaruk edited this page Jan 19, 2012 · 36 revisions

rbm-setup

Go to home | documentation | ant tasks

This task should be called before any other task from robomorphine-testrunner is called. This task makes some configurations and stores them to a context object. This configuration object is then stored as reference with either default or custom name.

Note that if rbm-setup is used as top-level task (i.e. outside of any target), the actual setup will happen just before first target is run. This doesn't require any extra steps from users of the library, just a fact that might help when debugging build scripts.


Prototype

<rbm-setup sdkdir="${sdk.dir}" 
           reference="${ref.name}"  
           lazy="${lazy}" 
           force="${force}" 
           verbose="${verbose}" />

Attributes

  • sdkdir - required, path to Android SDK location.
  • reference - optional, name of reference which is used to point to configured context.
  • lazy - optional, default: false, weather initialization should be deferred to first actual use of the context. If this attribute is set to false, context is initialized and configured immediately. If this attribute is true, then context will be initialized and configured when used for the first time.
  • force - optional, default: false, weather re-configuration should be forced. If context with such reference name exists and force is true, then old context is discarded and new one is created. If force is set to false, then this task does nothing (note that sdk.dir, lazy and verbose attributes have no effect in this case).
  • verbose - optional, default: false, weather all logs should be printed at info level. By default all logs are printed on relevant levels. Like debug messages are printed on ant's debug level, and verbose level logs are printed on ant's verbose level. Usually this is sufficient and user can see logs starting ant with -d for debug or -v for verbose log levels. However in both debug and verbose modes ant produces many other logs. Which might be inconvinient if user tries to debug issues with robomorphine-testrunner library. If this attribute is set to true, all verbose and debug logs are now printed at info level and are visible on normal ant run.

Examples

The simplest case is when only Android SDK directory is supplied:

<rbm-setup sdkdir="${sdk.dir}" />

This code can usually be copied as is, as sdk.dir property is usually required to be set in local.properties file that is used by Android's default build system.


If you want to defer some long-running parts of configurations to first actual use of robomorphine-testrunner you can use next example:

<rbm-setup sdkdir="${sdk.dir}" lazy="true" />
<rbm-restart-adb /> <!-- configuration happens here, and then the task is executed -->

In a rare case when you need to have several configured context, you can use custom reference names:

<rbm-setup sdkdir="${sdk.dir}" reference="setup.context" />
<rbm-restart-adb contextref="setup.context" />

All tasks support contextref attribute. So all tasks can run with custom conexts.

Go to home | documentation | ant tasks

Clone this wiki locally