Commit graph

10 commits

Author SHA1 Message Date
Colin Cross
748b2d829a Support extra checks for ErrorProne in a dedicated property
Previous extra checks for ErrorProne were added using the plugins
proeprty to get them into the -processorpath argument.  This works
fine for java-only modules, but fails for mixed java+kotlin modules
because the processorpath is given to kapt and not javac.

Add a dedicated errorprone.extra_check_modules property (mirroring
the lint.extra_check_modules property), and add that to a separate
processorpath that is used only for errorprone rules and not cleared
when kotlin is used.

Test: TestKapt/errorprone
Change-Id: Id6ef02ce758532d1df8b8d969fad83bb44fe93ab
2020-11-19 14:20:12 -08:00
Colin Cross
405af07859 Revert "Make lots of tests run in parallel"
This reverts commit 323dc60712.

Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests

Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-09 18:34:24 -07:00
Colin Cross
323dc60712 Make lots of tests run in parallel
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.

Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
2020-10-06 15:12:22 -07:00
Colin Cross
5a11686e64 Repeat kapt processor argument for multiple processors
kapt claims to support a comma separated list of annotation
processors, but it errors if multiple annotation processors
are given.  Surrounding the the list with {} does not error,
but it also doesn't even warn if the second element in the
list is garbage, so it may not be running the second
processor.  Repeat the processor argument for each
annotation processor class instead.

Bug: 154736649
Test: TestKapt
Test: m checkbuild
Change-Id: I4c7c161dbf867d7fba1aaf16fd5e502647e3f682
2020-04-22 20:43:37 -07:00
Jaewoong Jung
f9a0443a9c Java test code clean-up
Remove unused parameters and make testJava return the config.

Test: Ran all java tests.
Change-Id: Iaa123f3fd93188e2f55452b887e1d340429cc710
2019-07-17 11:15:09 -07:00
Colin Cross
7788c1283f Remove annotation_processors property
Now that there are no uses left of annotation_processors remove
the property.

If there are no annotation processor classes for javac for a module,
due to an empty "plugins" property or using kapt for annotation
processors, pass -proc:none to javac to ensure it does not try
to run any annotation processors found in the classpath.

Bug: 77284273
Test: plugin_test.go, kotlin_test.go
Change-Id: I3823d9fec8d3d07d2e49b1d97839f7fcbdd35647
2019-01-24 23:48:04 +00:00
Colin Cross
3a3e94c09a Fix kotlin annotation processing after java_plugin
I37c1e80eba71ae2d6a06199fb102194a51994989 broke kotlin annotation
processing with a typo in the processors flag to kapt and by
passing -processor to javac with an empty processorpath.

Bug: 77284273
Bug: 122251693
Test: kotlin_test.go
Test: m checkbuild
Change-Id: I17c45d5b3f9df089231af5d2930646ad0e6bf9be
2019-01-23 16:14:21 -08:00
Colin Cross
be9cdb8d64 Replace annotation_processors with plugins
Follow bazel's modules for annotation processors by introducing
a java_plugin module type that can contain extra metadata about
the annotation processor, the processor class and a flag to
specify if the annotation processor is compatible with the
turbine optimization.  Deprecate the annotation_processors
property, which took a list of java_library_host modules, in
favor of the plugins property, which takes a list of java_plugin
modules.  The annotation_processors property will be removed
once all uses have been replaced with plugins.

Bug: 77284273
Test: plugin_test.go
Test: m caliper
Change-Id: I37c1e80eba71ae2d6a06199fb102194a51994989
2019-01-23 20:17:51 +00:00
Colin Cross
afbb1734f6 Pass annotation processors to kotlinc
Enable the kotlin-annotation-processing plugin and pass annotation
processors to it.

Bug: 122251693
Test: m checkbuild
Test: TestKapt in kotlin_test.go
Change-Id: I841df454beaaa7edd263eea714ca0d958a03c9de
2019-01-22 21:47:19 +00:00
Colin Cross
21fc9bbe19 Move kotlin to it's own file
kapt is going to make kotlin a little more complicated, move the
rules and tests to their own files.

Bug: 122251693
Test: m checkbuild
Change-Id: Ieed78b97995ced210b710bd50c357514cc8e3bc6
2019-01-22 16:32:11 +00:00