@@ -110,7 +110,7 @@ Use checkstyle to lint the `srcs`.
110110## pmd_ruleset
111111
112112<pre >
113- pmd_ruleset(<a href =" #pmd_ruleset-name " >name</a >, <a href =" #pmd_ruleset-format " >format</a >, <a href =" #pmd_ruleset-rulesets " >rulesets</a >, <a href =" #pmd_ruleset-shallow " >shallow</a >)
113+ pmd_ruleset(<a href =" #pmd_ruleset-name " >name</a >, <a href =" #pmd_ruleset-format " >format</a >, <a href =" #pmd_ruleset-pmd_binary " >pmd_binary</ a >, < a href = " #pmd_ruleset- rulesets" >rulesets</a >, <a href =" #pmd_ruleset-shallow " >shallow</a >)
114114</pre >
115115
116116Select a rule set for PMD tests.
@@ -122,6 +122,7 @@ Select a rule set for PMD tests.
122122| :------------- | :------------- | :------------- | :------------- | :------------- |
123123| <a id =" pmd_ruleset-name " ></a >name | A unique name for this target. | <a href =" https://bazel.build/docs/build-ref.html#name " >Name</a > | required | |
124124| <a id =" pmd_ruleset-format " ></a >format | Generate report in the given format. One of html, text, or xml (default is xml) | String | optional | "xml" |
125+ | <a id =" pmd_ruleset-pmd_binary " ></a >pmd_binary | PMD binary to use. | <a href =" https://bazel.build/docs/build-ref.html#labels " >Label</a > | optional | //java: pmd |
125126| <a id =" pmd_ruleset-rulesets " ></a >rulesets | Use these rulesets. | <a href =" https://bazel.build/docs/build-ref.html#labels " >List of labels</a > | optional | [ ] |
126127| <a id =" pmd_ruleset-shallow " ></a >shallow | Use the targetted output to increase PMD's depth of processing | Boolean | optional | True |
127128
@@ -394,6 +395,48 @@ attribute to allow all the tests to be run in one go.
394395| <a id =" java_test_suite-kwargs " ></a >kwargs | <p align =" center " > - </p > | none |
395396
396397
398+ <a id =" #pmd_binary " ></a >
399+
400+ ## pmd_binary
401+
402+ <pre >
403+ pmd_binary(<a href =" #pmd_binary-name " >name</a >, <a href =" #pmd_binary-main_class " >main_class</a >, <a href =" #pmd_binary-deps " >deps</a >, <a href =" #pmd_binary-runtime_deps " >runtime_deps</a >, <a href =" #pmd_binary-srcs " >srcs</a >, <a href =" #pmd_binary-visibility " >visibility</a >, <a href =" #pmd_binary-kwargs " >kwargs</a >)
404+ </pre >
405+
406+ Macro for quickly generating a ` java_binary ` target for use with ` pmd_ruleset ` .
407+
408+ By default, this will set the ` main_class ` to point to the default one used by PMD
409+ but it's ultimately a drop-replacement for a regular ` java_binary ` target.
410+
411+ At least one of ` runtime_deps ` , ` deps ` , and ` srcs ` must be specified so that the
412+ ` java_binary ` target will be valid.
413+
414+ An example would be:
415+
416+ ``` starlark
417+ pmd_binary(
418+ name = " pmd" ,
419+ runtime_deps = [
420+ artifact(" net.sourceforge.pmd:pmd-dist" ),
421+ ],
422+ )
423+ ```
424+
425+
426+ ** PARAMETERS**
427+
428+
429+ | Name | Description | Default Value |
430+ | :------------- | :------------- | :------------- |
431+ | <a id =" pmd_binary-name " ></a >name | The name of the target | none |
432+ | <a id =" pmd_binary-main_class " ></a >main_class | The main class to use for PMD. | <code >"net.sourceforge.pmd.PMD"</code > |
433+ | <a id =" pmd_binary-deps " ></a >deps | The deps required for compiling this binary. May be omitted. | <code >None</code > |
434+ | <a id =" pmd_binary-runtime_deps " ></a >runtime_deps | The deps required by PMD at runtime. May be omitted. | <code >None</code > |
435+ | <a id =" pmd_binary-srcs " ></a >srcs | If you're compiling your own PMD binary, the sources to use. | <code >None</code > |
436+ | <a id =" pmd_binary-visibility " ></a >visibility | <p align =" center " > - </p > | <code >[ "//visibility: public "] </code > |
437+ | <a id =" pmd_binary-kwargs " ></a >kwargs | <p align =" center " > - </p > | none |
438+
439+
397440<a id =" #spotbugs_binary " ></a >
398441
399442## spotbugs_binary
0 commit comments