Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Brian O'Connor
2016-04-25 11:55:51 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b3cc6047f4d92a0879ff277e3a1197c6ce4870e2
b3cc6047
1 parent
bd6305a1
Moving checkstyle run to buck test
Change-Id: Ib8d2e2fbb71585d90ac5df44d08a186f22fe0425
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
bucklets/onos.bucklet
bucklets/onos.bucklet
View file @
b3cc604
...
...
@@ -91,8 +91,6 @@ def osgi_jar(
if debug:
bash = stage_jar + DEBUG_ARG + ' ' + wrap_jar
print bash
# TODO this is a hack to add checkstyle as dependency before generating jar
bash = 'ls $(location :' + name + '-checkstyle) > /dev/null; ' + bash
genrule(
name = osgi_jar_name,
...
...
@@ -111,21 +109,36 @@ def osgi_jar(
)
### Checkstyle
chk_cmd = ' '.join(( 'java -jar $(location //lib:checkstyle)',
'-o $OUT',
chk_cmd = '#!/bin/sh\n'
base = get_base_path()
chk_cmd += ' '.join(( 'java -jar $(location //lib:checkstyle)',
'-c $(location //tools/build/conf:checkstyle-xml)',
' '.join(srcs) ))
error_cmd = ' | '.join(( '( touch $OUT; cat $OUT',
'grep -E "^[^: ]*:\d+:\d+: error:"',
'sed "s#^.*__srcs/#%s:#g" ; exit 1)' % name, ))
cmd = ' || '.join((chk_cmd, error_cmd))
' '.join(['%s/%s' % (base, s) for s in srcs]) ))
chk_cmd += ' | grep -E "^[^: ]*:\d+:\d+: error:"'
chk_cmd += ' | sed "s#^.*%s/#%s:#g"\n' % (base, name)
chk_cmd += 'test ${PIPESTATUS[0]} -eq 0\n' # status of java command
genrule(
name = name + '-checkstyle',
bash = cmd,
name = name + '-checkstyle
-sh
',
bash =
"echo '%s' > $OUT && chmod +x $OUT" % chk_
cmd,
srcs = srcs,
out = 'checkstyle.log',
out = 'checkstyle.sh',
)
sh_test(
name = name + '-checkstyle',
test = ':' + name + '-checkstyle-sh',
deps = [ ':'+ bare_jar_name ],
labels = [ 'checkstyle' ],
)
# TODO add project config for intellij
# project_config(
# src_target = ':' + bare_jar_name,
# src_roots = [ 'src/main/java' ],
# test_target = ':' + name + '-tests',
# test_roots = [ 'src/test/java' ],
# )
### .m2 Install
mvn_cmd = ' '.join(( 'mvn install:install-file',
'-Dfile=$(location :%s)' % name,
...
...
Please
register
or
login
to post a comment