summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-core/classes/cloc.bbclass
blob: 9b73704e80cf31bc06d1adbc6535563dc898bdda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# (C) 2017 Jan-Simon Möller <dl9pf@gmx.de>
#
# License: GPLv2
#
# summary with
# cloc --sum-reports `find . -name "*clocreport" | grep -v "\-native" ` --out summary.report

# cloc needs to be installed on the host
# FIXME: create a cloc-native
HOSTTOOLS += "cloc"

CLOC_DIRECTORY ??= "${DEPLOY_DIR}/cloc/"
CLOCSTATEDIR = "${WORKDIR}/cloc-destdir/"

python do_cloc() {

    import subprocess

    source_dir = d.getVar('S', True)
    pn = d.getVar('PN', True)

    destdir = d.expand('${CLOCSTATEDIR}')
    bb.utils.mkdirhier(destdir)

    cloc_cmd = 'cloc %s -q --out=%s/%s.clocreport' % (source_dir, destdir, pn )
    subprocess.call(cloc_cmd, shell=True)

}


addtask cloc before do_configure after do_patch

EXPORT_FUNCTIONS do_cloc
args_video} ${bootargs_root} ${bootargs_extra}; run bootkload_sd; run bootiload_sd; bootm ${bootkaddr} ${bootiaddr}' ################ Netboot through TFTP+NBD ################## # replace <IP> addresses by appropriate addresses setenv 'ipaddr' '<board_IP>' setenv 'serverip' '<server_IP>' setenv 'bootargs_root' 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp' setenv 'bootkload_net' 'tftp ${bootkaddr} porter/${bootkfile}' setenv 'bootiload_net' 'tftp ${bootiaddr} porter/${bootifile}' setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run bootkload_net; run bootiload_net; bootm ${bootkaddr} ${bootiaddr}'