srctool is a command line tool to manage source code parsers. It is able to
download parsers from a web server, install them and run them. In short, it is a
manager for source code parsers.
Assuming you have Go installed and your $GOPATH correctly set, you can
simply issue the following command:
go get github.com/DevMine/srctool
Make sure that $GOPATH/bin is in the $PATH.
Binary for the latest version can be found here.
The command srctool help provides a short description of all available
options.
Before doing anything, you must first create a configuration file. To do so, issue:
srctool config
This will create a default configuration file located in
$XDG_CONFIG_HOME/srctool/srctool.conf
If the $XDG_CONFIG_HOME environment variable is not set, it will use the
$HOME/.config directory.
By default, the download server URL is http://dl.devmine.ch/parsers. You can
change this value with the config command:
srctool config --server-url "http://my-server.com"
The command srctool list -r lists all compatible parsers available on the
download server. For installing them, just issue the following command:
srctool install [language]
The main purpose of srctool is to parse source code. After installing at least
one parser, issue the following command:
srctool parse [project path]
This will parse the whole project with each installed parser and merge all the output to produce a final JSON.
Running your own download server requires nothing more than a HTTP server (nginx, apache, lighttpd, ...). The only requirement is to keep the following structure for the files organization:
.
βββ MD5SUMS
βββ darwin
β βββ amd64
β βββ parser-go.zip
β βββ parser-java.zip
βββ dragonfly
β βββ amd64
β βββ parser-go.zip
β βββ parser-java.zip
βββ freebsd
β βββ 386
β β βββ parser-go.zip
β β βββ parser-java.zip
β βββ amd64
β βββ parser-go.zip
β βββ parser-java.zip
βββ linux
β βββ 386
β β βββ parser-go.zip
β β βββ parser-java.zip
β βββ amd64
β βββ parser-go.zip
β βββ parser-java.zip
βββ netbsd
β βββ 386
β β βββ parser-go.zip
β β βββ parser-java.zip
β βββ amd64
β βββ parser-go.zip
β βββ parser-java.zip
βββ opendbsd
βββ 386
β βββ parser-go.zip
β βββ parser-java.zip
βββ amd64
βββ parser-go.zip
βββ parser-java.zip
The folder tools/ of the project contains several useful scripts for managing
the MD5SUMS file, cross compiling the Go parser, etc. See
tools/README.md
for more information.
