Commit graph

14 commits

Author SHA1 Message Date
Colin Cross
330b1fef31 Package jacoco and proguard files out of a PACKAGING directory
Package jacoco-report-classes.jar, proguard_usage.zip and
proguard_dictionary out of directories in $OUT/obj/PACKAGING
so that they get cleared by m installclean.  This will make
incremental builds that package these files accurate as long
as installclean was run, which is much faster than a full clean
build.

Bug: 184583915
Test: m TARGET_BUILD_APPS=DeskClock EMMA_INSTRUMENT=true dist
Change-Id: I60c6a0fec1fbce26eab8d5adab25a2231b48e251
2021-04-07 18:52:02 -07:00
Colin Cross
c27d795b63 Use unzip -DD
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build.  Use
unzip -DD when unzipping to update the timestamps.

Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I6f08ba8695d90a8225cfc04e679755e6296deed0
2020-07-12 05:38:03 +00:00
Elliott Hughes
37ab4e2b2e Use find(1)'s -exec directly.
toybox xargs doesnt have --no-run-if-empty:

  xargs: Unknown option no-run-if-empty (see "xargs --help")

But we shouldn't need it anyway.

Test: make -j32 showcommands dist TARGET_BUILD_APPS='Launcher3 Launcher3Tests' EMMA_INSTRUMENT_STATIC=true TARGET_BUILD_VARIANT=userdebug
Change-Id: I72f680c27b58a42b9fb9de1a0bc4187cabcfb516
2019-01-14 12:56:07 -08:00
Colin Cross
f8b06a4e61 Update jacoco command line flags for latest version
jacoco_cli wants --quiet and --dest instead of -quiet and -dest.

Bug: 69669951
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Change-Id: I126a702fbb1538ba5f99a7abf70c1f025160db21
2017-12-21 14:09:51 -08:00
Colin Cross
3fec81d978 Add support for jacoco in soong
Use jacoco values exported from soong and copy
jacoco-report-classes.jar to where the jacoco-report-classes-all.jar
rule can find it.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: If05381f415fb52a575746b8be0bfcd03d55b2153
2017-11-24 20:23:36 -08:00
Colin Cross
3c8d30ce60 Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER
Jack supported '?' and '*' wildcards anywhere in a filter. Tighten
the restrictions to only support '*' at the end of a filter, and
to disallow '?'.  This will allow jacoco support to be built on
top of the existing zip2zip tools.

Add checks that all filters meet the new requirements, and run
the checks outside the LOCAL_EMMA_INSTRUMENT==true check so that
mistakes can be caught without having to run a build with
coverage enabled.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true
Test: m in internal master
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L67200000122054710&nodeType=Trybot
Change-Id: Ib78bd3c8685fbc6bdcdb517df874186efd1cff33
2017-11-22 01:49:47 +00:00
Jeff Gaston
07d390204c Validate args passed by jacoco.mk to rm -rf
Test: m -j showcommands dist ANDROID_COMPILE_WITH_JACK=false EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false tests
Bug: 68056327
Change-Id: I30a83721b8cab91445bde9d3608266942f6d0997
2017-10-26 14:10:19 -07:00
Jeff Gaston
6fdbdc86f6 Skip instrumenting non-class files
Jacoco normally recurses into .jar files, but we don't want it to.
Some .jar files may be intentionally corrupt test files.

Test: m -j showcommands dist EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false cts google-tradefed-all general-tests tests
Bug: 68056327
Change-Id: I1550e3acafd7cd9a65164742370e051d3eb3bf69
2017-10-25 16:36:05 -07:00
Jeff Gaston
e84fdb7b2d Consider empty LOCAL_JACK_COVERAGE_INCLUDE_FILTER to match everything
Test: m EMMA_INSTRUMENT=true
Bug: 68056327

Change-Id: I4af136490e572ba603d2a77f70e49d1feec1eb00
2017-10-25 20:16:43 +00:00
Jeff Gaston
8fcf6a4846 Make Jacoco exclusions relative to the current directory
Test: m EMMA_INSTRUMENT=true
Bug: 68056327
Change-Id: Ia6bf1cf78920107404fed4cbd8259d4442b04755
2017-10-24 12:34:38 -07:00
Jeff Gaston
b64f70557a Remove quoting of Jacoco exclusions
So that "*" works again

Test: m EMMA_INSTRUMENT=true
Bug: 68056327

Change-Id: Ieaad8bfbdeb0562910e6027682663049b0187c5e
2017-10-24 12:34:38 -07:00
Colin Cross
a6bc3a8a4c Delete jack support
Remove all support for running jack.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
Merged-In: I1ef87c88af3f2689f8b0dcf1a01c958b16159631
(cherry picked from commit 5db5d31d73)
2017-10-02 18:06:56 +00:00
Colin Cross
128800f2c8 Sort files in directories passed to jar
jar -C <dir> . produces a jar containing files in filesystem order,
which can vary between builds.  Manually find and sort the list of
files, and convert them into a list of -C <dir> <file> pairs.

Fixes: 64634025
Test: m -j checkbuild
Test: m -j out/target/product/sailfish/system/framework/ext.jar, check
      that entries are sorted
Test: m -j out/target/product/generic_arm64/system/framework/ext.jar on mac
Change-Id: I7dced6acbe621a60cd49daf17872941485602732
2017-08-16 13:37:00 -07:00
Jeff Gaston
aaae43cd24 Update to latest jacoco usage
Bug: 36792868
Test: EMMA_INSTRUMENT_STATIC=true m -j

Change-Id: I419b543283b52be9a72f5c6b10e4cbea68782174
2017-07-14 13:04:05 -07:00