Now buildfile recognizes whether targets 'debug' or 'install' are being run for
an ordinary or test project and for the test projects classpath is extended
to enclose the tested project. Tested project is being compiled if necessary.
application.package in android_rules.xml and android_test_rules.xml has been
replaced by manifest.package which value is taken from AndroidManifest.xml.
This is because old versions of build.properties contain already
application.package property which has precedence over the extracted one
and overrides it.
Change-Id: I909e145926169922ec6ec0e179ad88c413aa85b2
Automatic extraction of the application.package property has been added
leveradging xpath ant task. This reduces redundancy, removes hardcoded
application.package and solves bug with uninstalling test application
package. In order to function properly needs removing application.package
from build.properties file.
The user-configurable property 'verbose' has been introduced. It is set by
default to 'false' and switching in on enables verbose mode for all the
intermediate steps for a given target.
This is to avoid using default location for the emma dump file (coverage.ec)
which is generated on the device. Pointing out the custom location (which
for now is the same as the default one) is more straightforward and
will be important if the default location changes in the future.
After generating coverage report instrumentation.dir and files coverage.ec
and coverage.em are being deleted. As Emma treats both files incrementally,
running 'ant coverage' in the project with these files already existing
may produce unexpected results.
Instrumentation-related targets have been moved from android_test_rules to
android_rules for better consistency. Chain of target dependencies has
been modified in order to make it more natural.
Target 'run-tests' launches all the unit tests against the tested project.
Target 'coverage' emma-instruments the tested project's classes,
runs the tests against instrumented classes, collects code coverage data
and extracts it to human-readable form as report.html.
android_test_rules.xml contain additional rules for test projects.
Test projects are auto-recognized by presence of the tested.project.dir
property, which will be auto-generated for tests projects. Temporarily,
please add this property manually to the build.properties file.
Current version is mainly tested with default, android generated test projects.
This version includes also fixing relative to absolute paths for
properties which are most likely to be changed by user in external
property file.