[RCAR] disable a default config in kernel
[AGL/meta-agl.git] / meta-agl-profile-core / 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 needs to be installed on the host
9 # FIXME: create a cloc-native
10 HOSTTOOLS += "cloc"
11
12 CLOC_DIRECTORY ??= "${DEPLOY_DIR}/cloc/"
13 CLOCSTATEDIR = "${WORKDIR}/cloc-destdir/"
14
15 python do_cloc() {
16
17     import subprocess
18
19     source_dir = d.getVar('S', True)
20     pn = d.getVar('PN', True)
21
22     destdir = d.expand('${CLOCSTATEDIR}')
23     bb.utils.mkdirhier(destdir)
24
25     cloc_cmd = 'cloc %s -q --out=%s/%s.clocreport' % (source_dir, destdir, pn )
26     subprocess.call(cloc_cmd, shell=True)
27
28 }
29
30
31 addtask cloc before do_configure after do_patch
32
33 EXPORT_FUNCTIONS do_cloc