blob: 35f9b8501b79bb3f3c6d752e0fb3ca7bfb5d96d6 [file] [log] [blame]
Brian O'Connor42c38cf2016-04-05 17:05:57 -07001checkstyle_source = 'src/main/resources/onos/checkstyle.xml'
2suppression_source = 'src/main/resources/onos/suppressions.xml'
3
4xml = ('<module name="SuppressionFilter">'
Brian O'Connor4847ea32016-04-29 16:33:06 -07005 '<property name="file" value="$(location :suppressions-xml)"/>'
Brian O'Connor42c38cf2016-04-05 17:05:57 -07006 '</module>' )
7cmd = "sed 's#<module name=\"Checker\">#<module name=\"Checker\">%s#' %s > $OUT" % ( xml, checkstyle_source )
8
9genrule(
10 name = 'checkstyle-xml',
11 srcs = [ checkstyle_source ],
12 out = 'checkstyle.xml',
13 bash = cmd,
14 visibility = [ 'PUBLIC' ]
15)
16
Brian O'Connore4da59d2016-04-08 00:32:18 -070017#FIXME location suppression.xml does not trigger this rule
Brian O'Connor42c38cf2016-04-05 17:05:57 -070018export_file(
Brian O'Connor4847ea32016-04-29 16:33:06 -070019 name = 'suppressions-xml',
Brian O'Connor42c38cf2016-04-05 17:05:57 -070020 src = suppression_source,
Brian O'Connor4847ea32016-04-29 16:33:06 -070021 visibility = [ 'PUBLIC' ]
Brian O'Connor42c38cf2016-04-05 17:05:57 -070022)