blob: 11ab27916f80b8f1cd7378048e80fcfda58adfa3 [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'
Ray Milkey85267002016-11-16 11:06:35 -08003header_source = 'src/main/resources/onos/onos-java.header'
Brian O'Connor42c38cf2016-04-05 17:05:57 -07004
Brian O'Connorbe95f682016-05-18 15:40:19 -07005export_file (
Brian O'Connor42c38cf2016-04-05 17:05:57 -07006 name = 'checkstyle-xml',
Brian O'Connorbe95f682016-05-18 15:40:19 -07007 src = checkstyle_source,
8 visibility = [ 'PUBLIC' ],
Brian O'Connor42c38cf2016-04-05 17:05:57 -07009)
10
Brian O'Connorbe95f682016-05-18 15:40:19 -070011export_file (
Brian O'Connor4847ea32016-04-29 16:33:06 -070012 name = 'suppressions-xml',
Brian O'Connor42c38cf2016-04-05 17:05:57 -070013 src = suppression_source,
Brian O'Connorbe95f682016-05-18 15:40:19 -070014 visibility = [ 'PUBLIC' ],
Brian O'Connor42c38cf2016-04-05 17:05:57 -070015)
Brian O'Connorbe95f682016-05-18 15:40:19 -070016
17export_file (
Ray Milkey85267002016-11-16 11:06:35 -080018 name = 'onos-java-header',
19 src = header_source,
20 visibility = [ 'PUBLIC' ],
21)
22
23export_file (
Thomas Vachuska275d2e82016-07-14 17:41:34 -070024 name = 'start-buck-daemon',
Brian O'Connorbe95f682016-05-18 15:40:19 -070025 visibility = [ 'PUBLIC' ],
26)
27
28COMPILE = [
Carmelo Cascone72893b72018-08-09 00:59:06 -070029 '//lib:com_google_guava_guava',
Brian O'Connorbe95f682016-05-18 15:40:19 -070030 '//lib:checkstyle',
31]
32
33RUN = [
34 '//lib:commons-logging',
35 '//lib:commons-beanutils',
36 '//lib:commons-lang3',
37 '//lib:commons-collections',
38 '//lib:antlr',
39]
40
41java_library (
42 name = 'checkstyle',
43 srcs = glob([ 'src/main/java/**/*.java' ]),
44 deps = COMPILE,
45)
46
47java_binary (
Thomas Vachuska275d2e82016-07-14 17:41:34 -070048 name = 'buck-daemon-jar',
Brian O'Connorbe95f682016-05-18 15:40:19 -070049 deps = [ ':checkstyle' ] + RUN,
Thomas Vachuska275d2e82016-07-14 17:41:34 -070050 main_class = 'org.onosproject.buckdaemon.BuckDaemon',
Brian O'Connorbe95f682016-05-18 15:40:19 -070051 blacklist = [ 'META-INF/.*' ],
52 visibility = [ 'PUBLIC' ],
53)
54
Ray Milkey2d572dd2017-04-14 10:01:24 -070055osgi_jar (
56 name = 'onos-build-conf',
57 srcs = [],
58 deps = [ ':checkstyle' ] + RUN,
59)
60
Brian O'Connorbe95f682016-05-18 15:40:19 -070061# cmd = '#!/bin/bash\n'
62# cmd += '$1 &>/dev/null < /dev/null &'
63#
64# genrule(
65# name = 'checkstyle-sh',
66# bash = "echo '%s' > $OUT && chmod +x $OUT" % cmd,
67# out = 'checkstyle.sh',
68# )
69#
70# sh_test(
71# name = 'checkstyle-runner',
72# test = ':checkstyle-sh',
73# args = [
74# '$(exe :checkstyle-jar)',
75# '$(location //lib:checkstyle)',
76# '$(location //tools/build/conf:checkstyle-xml)',
77# '`mktemp /tmp/%s-checkstyle-XXXXXX`',
78# ],
79# labels = [ 'checkstyle' ],
80# visibility = [ 'PUBLIC' ],
Ray Milkey85267002016-11-16 11:06:35 -080081# )