Brian O'Connor | 42c38cf | 2016-04-05 17:05:57 -0700 | [diff] [blame] | 1 | checkstyle_source = 'src/main/resources/onos/checkstyle.xml' |
| 2 | suppression_source = 'src/main/resources/onos/suppressions.xml' |
| 3 | |
| 4 | xml = ('<module name="SuppressionFilter">' |
Brian O'Connor | 4847ea3 | 2016-04-29 16:33:06 -0700 | [diff] [blame^] | 5 | '<property name="file" value="$(location :suppressions-xml)"/>' |
Brian O'Connor | 42c38cf | 2016-04-05 17:05:57 -0700 | [diff] [blame] | 6 | '</module>' ) |
| 7 | cmd = "sed 's#<module name=\"Checker\">#<module name=\"Checker\">%s#' %s > $OUT" % ( xml, checkstyle_source ) |
| 8 | |
| 9 | genrule( |
| 10 | name = 'checkstyle-xml', |
| 11 | srcs = [ checkstyle_source ], |
| 12 | out = 'checkstyle.xml', |
| 13 | bash = cmd, |
| 14 | visibility = [ 'PUBLIC' ] |
| 15 | ) |
| 16 | |
Brian O'Connor | e4da59d | 2016-04-08 00:32:18 -0700 | [diff] [blame] | 17 | #FIXME location suppression.xml does not trigger this rule |
Brian O'Connor | 42c38cf | 2016-04-05 17:05:57 -0700 | [diff] [blame] | 18 | export_file( |
Brian O'Connor | 4847ea3 | 2016-04-29 16:33:06 -0700 | [diff] [blame^] | 19 | name = 'suppressions-xml', |
Brian O'Connor | 42c38cf | 2016-04-05 17:05:57 -0700 | [diff] [blame] | 20 | src = suppression_source, |
Brian O'Connor | 4847ea3 | 2016-04-29 16:33:06 -0700 | [diff] [blame^] | 21 | visibility = [ 'PUBLIC' ] |
Brian O'Connor | 42c38cf | 2016-04-05 17:05:57 -0700 | [diff] [blame] | 22 | ) |