Merge "[RCAR] Update Rcar gen3 BSP to 3.6"
[AGL/meta-agl.git] / meta-agl / classes / cloc.bbclass
1 # (C) 2017 Jan-Simon Möller <dl9pf@gmx.de>
2 #
3 # License: GPLv2
4 #
5 # summary with
6 # cloc --sum-reports `find . -name "*clocreport" | grep -v "\-native" ` --out summary.report
7
8 CLOC_DIRECTORY ??= "${DEPLOY_DIR}/cloc/"
9 CLOCSTATEDIR = "${WORKDIR}/cloc-destdir/"
10
11 python do_cloc() {
12
13     import subprocess
14
15     source_dir = d.getVar('S', True)
16     pn = d.getVar('PN', True)
17
18     destdir = d.expand('${CLOCSTATEDIR}')
19     bb.utils.mkdirhier(destdir)
20
21     cloc_cmd = 'cloc %s -q --out=%s/%s.clocreport' % (source_dir, destdir, pn )
22     subprocess.call(cloc_cmd, shell=True)
23
24 }
25
26
27 addtask cloc before do_configure after do_unpack
28
29 EXPORT_FUNCTIONS do_cloc