0

For running GNAT metric (for Windows, GPL 2017 or CE 2018) I'd like to include the RTL sources as well. There is a "-a" switch but it seems to be ineffective. When I'm forcing visibility of RTL sources, only ada.ads and system.ads are processed. Guessing it is a "crunched name" issue (RTL file names forced to 8 character names) I've tried other tricks without success.

My question is: is there a way to get the RTL source metrics (of the source files actually used) with GNAT Metric?

I'm using the command

gnatmetric -a -xs -nt -j0 -Pmyproj.gpr -U somemain.adb 

TIA

Zerte
  • 1,478
  • 10
  • 9
  • `gnatmetric -a` works OK if you’re in the RTS! but of course then you get all the files. (I tried this with my [`cortex-gnat-rts`](https://github.com/simonjwright/cortex-gnat-rts) & `gnatmetric` threw a constraint error: pursuing) – Simon Wright Jan 11 '19 at 19:24
  • 1
    I reported the CE (which turns out to be down to an ASIS issue) to AdaCore; they won’t be fixing the gnatmetric problem because the new version will be based on [libadalang](https://github.com/AdaCore/libadalang). I still think the ASIS problem needs fixing, of course! – Simon Wright Jan 15 '19 at 22:55

1 Answers1

0

In the meantime I've found a workaround by using the gnathtml.pl script. I've customized the script a bit by removing the H1 headers. The result is a few hundreds of HTML files with the sources of units actually used: the script does find all dependencies, recursively, through the .ali files - including the RTL. Then I group the HTML files together, convert them back to text files, pass them through Adalog's Normalize tool for removing comments and empty lines, count lines with the wc command, and the job is done.

Zerte
  • 1,478
  • 10
  • 9