'source code 보기'에 해당되는 글 1건

  1. 2019.11.22 opengrok에서 확장자 추가하기

opengrok에서 확장자 추가하기

Personal Computer/Linux 2019. 11. 22. 12:52 posted by tolkien

source browser로 opengrok을 쓰고 있습니다.

java, asm, c/c++ 등의 파일을 parsing해서 source code 돌아다니기 편하게 해줍니다.

 

그런데, 가끔 custom한 확장자를 사용하는 code들이 있습니다.

예를 들어 source 일부를 .inc file로 만들어서 include하는...

이런 경우, opengrok는 그냥 text file로 처리합니다.

 

오늘 code를 보다가 drvInit() 함수의 definition이 없어서 찾아보니

그런 파일에 있었네요. 그래서, 조금 googling했습니다. 그랬더니

opengrok.jar내 -A option이 있다고 합니다. 사용법이 조금 까다로운데

 

-A sln:org.opensolaris.opengrok.analysis.plain.PlainAnalyzerFactory

 

C file로 인식하는 것은 아래와 같지 않을까 생각하고, option을 넣어서 다시 indexing합니다.

-A inc:org.opensolaris.opengrok.analysis.c.CAnalyzerFactory 

뒤에 있는 명칭은 opengrok source code를 보면 대충 짐작이 됩니다.

https://github.com/oracle/opengrok/tree/master/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis

 

참고 자료 :

- opengrok wiki

- opengrok github

- Re: [opengrok] How to add more file extensions (file types)

- stackoverflow에서 찾은 글

.