-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathHowMuchCode.sh
More file actions
executable file
·95 lines (90 loc) · 3.49 KB
/
Copy pathHowMuchCode.sh
File metadata and controls
executable file
·95 lines (90 loc) · 3.49 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
# Remove backup files created by emacs
rm *~ */*~ */*/*~ */*/*/*~
if [ -e "lines of code" ] ; then
rm "lines of code"
fi
if [ -e "total lines of code" ] ; then
rm "total lines of code"
fi
for DIR in src test ; do
touch ${DIR}/UnitTesting/nothing_anyone_wants.h
touch ${DIR}/UnitTesting/nothing_anyone_wants.cpp
touch ${DIR}/UnitTesting/nothing_anyone_wants.tpp
touch ${DIR}/UnitTesting/nothing_anyone_wants.cu
touch ${DIR}/UnitTesting/nothing_anyone_wants.cuh
touch ${DIR}/UnitTesting/nothing_anyone_wants.cui
for EXT in h cpp tpp cu cuh cui ; do
cat ${DIR}/*/*.${EXT} >> "lines of code"
cat ${DIR}/*/*.${EXT} >> "total lines of code"
done
rm ${DIR}/UnitTesting/nothing_anyone_wants.h
rm ${DIR}/UnitTesting/nothing_anyone_wants.cpp
rm ${DIR}/UnitTesting/nothing_anyone_wants.tpp
rm ${DIR}/UnitTesting/nothing_anyone_wants.cu
rm ${DIR}/UnitTesting/nothing_anyone_wants.cuh
rm ${DIR}/UnitTesting/nothing_anyone_wants.cui
grep -v "//" "lines of code" > code_dump_file.tmp
grep ";.*//" "lines of code" >> code_dump_file.tmp
mv code_dump_file.tmp "lines of code"
TT=`wc -l "lines of code"`
echo "${TT} in ${DIR}"
rm "lines of code"
done
for DIR in benchmark ; do
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.h
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.cpp
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.tpp
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.cu
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.cuh
touch ${DIR}/ForceAccumulation/nothing_anyone_wants.cui
for EXT in h cpp tpp cu cuh cui ; do
cat ${DIR}/*/*.${EXT} >> "lines of code"
cat ${DIR}/*/*.${EXT} >> "total lines of code"
done
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.h
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.cpp
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.tpp
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.cu
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.cuh
rm ${DIR}/ForceAccumulation/nothing_anyone_wants.cui
grep -v "//" "lines of code" > code_dump_file.tmp
grep ";.*//" "lines of code" >> code_dump_file.tmp
mv code_dump_file.tmp "lines of code"
TT=`wc -l "lines of code"`
echo "${TT} in ${DIR}"
rm "lines of code"
done
for DIR in apps ; do
touch ${DIR}/Conf/src/nothing_anyone_wants.h
touch ${DIR}/Conf/src/nothing_anyone_wants.cpp
touch ${DIR}/Conf/src/nothing_anyone_wants.tpp
touch ${DIR}/Conf/src/nothing_anyone_wants.cu
touch ${DIR}/Conf/src/nothing_anyone_wants.cuh
touch ${DIR}/Conf/src/nothing_anyone_wants.cui
for EXT in h cpp tpp cu cuh cui ; do
cat ${DIR}/*/*/*.${EXT} >> "lines of code"
cat ${DIR}/*/*/*.${EXT} >> "total lines of code"
done
rm ${DIR}/Conf/src/nothing_anyone_wants.h
rm ${DIR}/Conf/src/nothing_anyone_wants.cpp
rm ${DIR}/Conf/src/nothing_anyone_wants.tpp
rm ${DIR}/Conf/src/nothing_anyone_wants.cu
rm ${DIR}/Conf/src/nothing_anyone_wants.cuh
rm ${DIR}/Conf/src/nothing_anyone_wants.cui
grep -v "//" "lines of code" > code_dump_file.tmp
grep ";.*//" "lines of code" >> code_dump_file.tmp
mv code_dump_file.tmp "lines of code"
TT=`wc -l "lines of code"`
echo "${TT} in ${DIR}"
rm "lines of code"
done
TT=`wc -l "total lines of code"`
echo "${TT}"
grep -v "//" "total lines of code" > code_dump_file.tmp
grep ";.*//" "total lines of code" >> code_dump_file.tmp
mv code_dump_file.tmp "lines of code excluding documentation"
TT=`wc -l "lines of code excluding documentation"`
echo "${TT}"
rm "total lines of code"
rm "lines of code excluding documentation"