Sourcetrail - free and open-source interactive source explorer
Sourcetrail
Important Note: This project was archived by the original autors and maintainers of Sourcetrail by the end of 2021. If you want to know more about this decision, read more on our blog.
Sourcetrail is a free and open-source cross-platform source explorer that helps you get productive on unfamiliar source code.
Links
Sourcetrail is:
- free
- working offline
- operating on Windows, macOS and Linux
- supporting C, C++, Java and Python
- offering an SDK (SourcetrailDB) to write custom language extensions
Sourcetrail on Patreon
The open-source development and regular software releases are made possible entirely by the support of these awesome patrons!
Using Sourcetrail
To setup Sourcetrail on your machine, you can either download the respective build for your operating system from our list of Releases and install it on your machine, or use one of the following package managers:
- Use the Chocolatey package with
choco install sourcetrail
How to Report Issues
You can post all your feature requests and bug reports on our issue tracker.
Reporting
Use the following template:
- platform version:
- Sourcetrail version:
- description of the problem:
- steps to reproduce the problem:
Supporting
If you want to support a certain feature request or you have the same bug that another user already reported, please let us know:
- post a comment with "+1" to the issue
- or send an email to support@sourcetrail.com with the issue ID
How to Contribute
- Please read and follow the steps in CONTRIBUTING.md file.
- You may want to look out for issues labeled good first issue to find some initial tasks to tackle.
- If you are looking for more information about Sourcetrail software development, please refer to our wiki.
How to Build
Building Sourcetrail requires several dependencies to be in place on your machine. However, our CMake based setup allows to disable indexing support for specific languages which reduces the number of dependencies to a minimum.
Building the Base Application
Required Tools
- CMake v3.12 (required for Windows, Linux and MacOS)
- Git (required for Windows, Linux and MacOS)
git is added to your PATH environment variable before running CMake
- Visual Studio (required for Windows)
- ccache (optional for Linux and MacOS)
PATH
* Download: https://ccache.dev/download.html
Required dependencies
- Boost 1.67
$ ./bootstrap.sh --with-libraries=filesystem,programoptions,system,datetime
$ ./b2 --link=static --variant=release --threading=multi --runtime-link=static --cxxflags=-fPIC
- Qt 5.12.3
Building
On Windows
- To set up your build environment run:
$ git clone https://github.com/CoatiSoftware/Sourcetrail.git
$ cd Sourcetrail
$ mkdir -p build/win64
$ cd build/win64
$ cmake -G "Visual Studio 15 2017 Win64" -DBOOSTROOT=<path/to/boost1670> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
Hint: If you are using the CMake GUI, we recommend that you activate advanced mode. Also you may be required to add some of the defines via the "Add Entry" button.
- After generating the build configuration, just open the Sourcetrail.sln file that was generated by CMake and build the Sourcetrail project.
On Unix
- To set up your build environment run:
$ cd Sourcetrail
$ mkdir -p build/Release
$ cd build/Release
$ cmake -DCMAKEBUILDTYPE="Release" -DBOOSTROOT=<path/to/boost1670> -DQt5_DIR=<path/to/Qt/version/platform/compiler/lib/cmake/Qt5> ../..
- Now start the build with:
$ make Sourcetrail
Running
- Run Sourcetrail from within the build directory. During execution Sourcetrail needs resources from
bin/app/dataandbin/app/user. CMake creates symlinks within the build directory that make these directories accessible.
Enable C/C++ Language Support
Required dependencies
- LLVM/Clang 11.0.0
git checkout llvmorg-11.0.0
* Building for Windows: Follow these steps to build the project. Run the cmake command exactly as described.
* Building for Unix: Follow this installation guide to build the project. Make sure to build with -DLLVMENABLE_RTTI=ON.
Building
- Run CMake with these additional options:
-DClangDIR=<path/to/llvmbuild>/lib/cmake/clang
-DBUILDCXXLANGUAGE_PACKAGE=ON
- Build Sourcetrail as described above.
Enable Java Language Support
Required dependencies
- JDK 1.8
<jdkroot>/bin is available in your PATH environment variable and that the JAVAHOME environment variable is set:
JAVAHOME=<path/to/Java>/jdk1.x.xxxx
- Maven
.../apache-maven-x.x.x/bin is available in your PATH environment variable and that both M2HOME and MAVENHOME environment variables are set:
M2_HOME=.../apache-maven-x.x.x
MAVEN_HOME=.../apache-maven-x.x.x
Building
- Run CMake with these additional options:
-DBUILDJAVALANGUAGE_PACKAGE=ON
- Build Sourcetrail as described above.
Enable Python Language Support
Required Tools
- 7z (required for Windows)
Building
- Run CMake with these additional options:
-DBUILDPYTHONLANGUAGE_PACKAGE=ON
- Build Sourcetrail as described above.
Creating the deployment Package
Windows
Required Tools
- Visual Studio (required for Windows)
.Net desktop development workload.
* Download: https://visualstudio.microsoft.com/downloads/
- Wix 3.11
sourcetrail.msi Windows installer.
* Remarks: Make sure to add <path/to>/WiX Toolset v3.11/bin to your PATH environment variable.
* Download: https://wixtoolset.org/releases/
- Wix extension for Visual Studio
- JRE
- WinRAR
<path/to>/WinRAR to your PATH environment variable.
Building
- Run
./script/deploy_windows.shfrom your Developer Command Prompt for Visual Studio. The script which will generate a 64bit build and packages it into a portable.zipfile and a Wix-based Windows installer, each.
macOS
After building, run the bundleinstall.sh script within the build directory which will create a Sourcetrail.app bundle and generate a Sourcetrail<version>.dmg container.
Linux
Run ./setup/Linux/createPackages.sh from the main directory, which creates both a .tar.gz and a .AppImage package in the main directory. Packaging depends on linuxdeployqt.
How to Run the Tests
The automated test suite of Sourcetrail is powered by Catch2. To run the tests, simply execute the Sourcetrailtest binary. Before executing, please make sure to set the working directory to ./bin/test.
License
Sourcetrail is licensed under the GNU General Public License Version 3.
Trademark
The "Sourcetrail" name is a trademark owned by Coati Software and is not included within the assets licensed under the GNU GPLv3.