Skip to content

Commit

Permalink
all: remove Java support
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrocas committed Dec 20, 2024
1 parent f10d21d commit a22e76c
Show file tree
Hide file tree
Showing 666 changed files with 24 additions and 119,894 deletions.
4 changes: 0 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,3 @@ TabWidth: 4
UseTab: Always
---
Language: Cpp
---
Language: Java
#BasedOnStyle: Google
#BreakAfterJavaFieldAnnotations: true
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build-*
/deps/

/bin/app/data/cxx
/bin/app/data/java/lib/
/bin/app/data/projects/ignored/
/bin/app/data/python/
/bin/app/user/log/
Expand All @@ -16,10 +15,6 @@ build-*
/bin/test/data/TestSettings.xml
/bin/test/data/CommandlineTestSuite/settings.xml
/bin/test/data/ConfigManagerTestSuite/temp.xml
/bin/test/data/UtilityMavenTestSuite/effective-pom.xml
/bin/test/data/SourceGroupTestSuite/java_maven/input/sourcetrail_dependencies

/java_indexer/target/

/setup/Linux/lib/

Expand Down
58 changes: 1 addition & 57 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ if (WIN32 AND (CMAKE_GENERATOR STREQUAL "Ninja"))
set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
endif()
set(BUILD_CXX_LANGUAGE_PACKAGE OFF CACHE BOOL "Add C and C++ support to the Sourcetrail indexer.")
set(BUILD_JAVA_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Java support to the Sourcetrail indexer.")
set(BUILD_PYTHON_LANGUAGE_PACKAGE OFF CACHE BOOL "Add Python support to the Sourcetrail indexer.")
set(DOCKER_BUILD OFF CACHE BOOL "Build runs in Docker")
set(TREAT_WARNINGS_AS_ERRORS ON CACHE BOOL "Treat compiler warnings as errors")
Expand Down Expand Up @@ -43,7 +42,6 @@ set(APP_INDEXER_NAME "${PROJECT_NAME}_indexer")
set(LIB_UTILITY_PROJECT_NAME "${PROJECT_NAME}_lib_utility")
set(LIB_GUI_PROJECT_NAME "${PROJECT_NAME}_lib_gui")
set(LIB_CXX_PROJECT_NAME "${PROJECT_NAME}_lib_cxx")
set(LIB_JAVA_PROJECT_NAME "${PROJECT_NAME}_lib_java")
set(LIB_PYTHON_PROJECT_NAME "${PROJECT_NAME}_lib_python")
set(LIB_PROJECT_NAME "${PROJECT_NAME}_lib")
set(TEST_PROJECT_NAME "${PROJECT_NAME}_test")
Expand Down Expand Up @@ -293,7 +291,6 @@ add_subdirectory(src/indexer)
add_subdirectory(src/lib)
add_subdirectory(src/lib_cxx)
add_subdirectory(src/lib_gui)
add_subdirectory(src/lib_java)
add_subdirectory(src/lib_python)
add_subdirectory(src/lib_utility)
add_subdirectory(src/test)
Expand Down Expand Up @@ -345,7 +342,6 @@ set_property(
"${LIB_GUI_INCLUDE_PATHS}"
"${LIB_UTILITY_INCLUDE_PATHS}"
"${LIB_CXX_INCLUDE_PATHS}"
"${LIB_JAVA_INCLUDE_PATHS}"
"${CMAKE_BINARY_DIR}/src/lib"
)

Expand All @@ -370,7 +366,7 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)

set(CAPTURED_CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
set(CMAKE_CXX_STANDARD 17)

add_library(${LIB_CXX_PROJECT_NAME} ${LIB_CXX_FILES})

create_source_groups(${LIB_CXX_FILES})
Expand Down Expand Up @@ -449,50 +445,6 @@ else()

endif()


# Lib Java ---------------------------------------------------------------------

if (BUILD_JAVA_LANGUAGE_PACKAGE)

find_package(JNI)

add_library(${LIB_JAVA_PROJECT_NAME} ${LIB_JAVA_FILES})

create_source_groups(${LIB_JAVA_FILES})

set_property(
TARGET ${LIB_JAVA_PROJECT_NAME}
PROPERTY INCLUDE_DIRECTORIES
"${LIB_JAVA_INCLUDE_PATHS}"
"${LIB_UTILITY_INCLUDE_PATHS}"
"${LIB_INCLUDE_PATHS}"
"${LIB_GUI_INCLUDE_PATHS}"
"${CMAKE_BINARY_DIR}/src/lib"
)

target_include_directories(${LIB_JAVA_PROJECT_NAME} SYSTEM
PUBLIC ${JNI_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

link_directories(${Boost_LIBRARY_DIRS})

target_link_libraries(${LIB_JAVA_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME})

add_custom_command(
TARGET ${LIB_JAVA_PROJECT_NAME}
PRE_BUILD
COMMAND ${BASH} ${PROJECT_SOURCE_DIR}/script/update_java_indexer.sh
COMMENT "updating java indexer jars"
)

else()

message(STATUS "Building the Java indexer will be skipped. You can enable building this target by setting 'BUILD_JAVA_LANGUAGE_PACKAGE' to 'ON'.")

endif()


# Lib Python ---------------------------------------------------------------------

if (BUILD_PYTHON_LANGUAGE_PACKAGE)
Expand Down Expand Up @@ -572,7 +524,6 @@ set_property(
"${CMAKE_BINARY_DIR}/src/lib_gui"
"${CMAKE_BINARY_DIR}/src/lib"
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_INCLUDE_PATHS}>
)

Expand Down Expand Up @@ -643,7 +594,6 @@ target_link_libraries(
${APP_INDEXER_NAME}
${LIB_GUI_PROJECT_NAME}
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_PROJECT_NAME}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_PROJECT_NAME}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_PROJECT_NAME}>
${LIB_PROJECT_NAME}
)
Expand All @@ -663,7 +613,6 @@ set_property(
"${CMAKE_BINARY_DIR}/src/lib_gui"
"${CMAKE_BINARY_DIR}/src/lib"
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_INCLUDE_PATHS}>
)

Expand Down Expand Up @@ -719,7 +668,6 @@ target_link_libraries(
${APP_PROJECT_NAME}
${LIB_GUI_PROJECT_NAME}
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_PROJECT_NAME}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_PROJECT_NAME}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_PROJECT_NAME}>
${LIB_PROJECT_NAME}
)
Expand All @@ -734,7 +682,6 @@ set_property(
"${CMAKE_BINARY_DIR}/src/lib_gui"
"${CMAKE_BINARY_DIR}/src/lib"
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_INCLUDE_PATHS}>
)

Expand Down Expand Up @@ -824,12 +771,10 @@ target_link_libraries(
${TEST_PROJECT_NAME}
${LIB_GUI_PROJECT_NAME}
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_PROJECT_NAME}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_PROJECT_NAME}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_PROJECT_NAME}>
${LIB_PROJECT_NAME}
${LIB_GUI_PROJECT_NAME}
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_PROJECT_NAME}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_PROJECT_NAME}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_PROJECT_NAME}>
)

Expand All @@ -845,7 +790,6 @@ set_property(
"${Boost_INCLUDE_DIRS}"
"${CMAKE_BINARY_DIR}/src/lib"
$<$<BOOL:${BUILD_CXX_LANGUAGE_PACKAGE}>:${LIB_CXX_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_JAVA_LANGUAGE_PACKAGE}>:${LIB_JAVA_INCLUDE_PATHS}>
$<$<BOOL:${BUILD_PYTHON_LANGUAGE_PACKAGE}>:${LIB_PYTHON_INCLUDE_PATHS}>
)

Expand Down
98 changes: 1 addition & 97 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Sourcetrail is an interactive source explorer that simplifies navigation in exis
* **Graph:** The graph displays the structure of your source code. It focuses on the currently selected symbol and directly shows all incoming and outgoing dependencies to other symbols.
* **Code:** The Code view displays all source locations of the currently selected symbol in a list of code snippets. Clicking on a different source location allows you to change the selection and dig deeper.

Note: Sourcetrail currently supports the languages C/C++, Java and Python. Much of the UI design is therefore based on these languages and might change as soon as other languages are supported. For more information have a look at [supported languages](#supported-languages).
Note: Sourcetrail currently supports the languages C/C++ and Python. Much of the UI design is therefore based on these languages and might change as soon as other languages are supported. For more information have a look at [supported languages](#supported-languages).

## Supported Languages

Expand All @@ -28,10 +28,6 @@ C support is powered by [Clang 11.0.0](https://clang.llvm.org/). For issues load

C++ support is powered by [Clang 11.0.0](https://clang.llvm.org/). For more Information please visit [Clang C++ Status](https://clang.llvm.org/cxx_status.html). For issues loading C++ code, please have a look at [Clang language compatibility](https://clang.llvm.org/compatibility.html) or report a bug in our [bug tracker](https://github.com/CoatiSoftware/SourcetrailBugTracker).

### Java

Sourcetrail includes support for Java 12 and lower which is powered by [Eclipse JDT](https://github.com/eclipse/eclipse.jdt.core). If you encounter any issues while using Sourcetrail on a Java project, please let us know by providing a minimal example in our [bug tracker](https://github.com/CoatiSoftware/SourcetrailBugTracker).

### Python

Sourcetrail includes support for Python 2 and Python 3 which is powered by our open-source [SourcetrailPythonIndexer](https://github.com/CoatiSoftware/SourcetrailPythonIndexer). If you encounter any issues while using Sourcetrail on a Python project, please let us know by providing a minimal example in our [bug tracker](https://github.com/CoatiSoftware/SourcetrailPythonIndexer/issues).
Expand Down Expand Up @@ -106,26 +102,6 @@ If neither of the above options apply to your project, please continue at [creat

<img src="docs/documentation/project_setup_wizard_source_group_type.png" height="600" alt="Project Setup Wizard Source Group Type">

#### Source Group Setup for Java

**Are you using Gradle?**

If you are using Gradle you can continue at [Source Group creation from Gradle](#create-a-project-from-gradle-configuration) to automatically setup your Source Group using your Gradle build configuration.

<img src="docs/documentation/project_setup_wizard_start_java_gradle.png" height="600" alt="Project Setup Wizard Start Java Gradle">

**Are you using Maven?**

If you are using Maven please continue at [Source Group creation from Maven](#create-a-project-from-maven-configuration) to automatically setup your Source Group using your Maven build configuration.

<img src="docs/documentation/project_setup_wizard_start_java_maven.png" height="600" alt="Project Setup Wizard Start Java Maven">

**Create Empty**

If you do not have your project configured using Gradle or Maven, please continue at [Create an Empty Java Source Group](#create-an-empty-java-project) and come back here as soon as the project is created.

<img src="docs/documentation/project_setup_wizard_start_java_empty.png" height="600" alt="Project Setup Wizard Start Java Empty">

#### Source Group Setup for Python

**Create empty**
Expand Down Expand Up @@ -316,33 +292,6 @@ End of search list.
```


## Finding Java Runtime Library Location

The current version of Sourcetrail requires an installation of the Java 8 runtime environment to index any Java project. Make sure that Sourcetrail and your JRE share the same kind or architecture (a 32 bit Sourcetrail requires a 32 bit JRE). To locate the required library file, please refer to the applicable description below.

### Windows

The Java Runtime Library (called `jvm.dll`) can be found inside of your JRE install folder and looks like this:
`<path_to_jre>/bin/client/jvm.dll`

### macOS

The Java Runtime Library (called `libjli.dylib`) can be found inside of your JDK install folder. Run the following command in your terminal to find the location of your default Java installation:
`/usr/libexec/java_home`

This should give you a path looking like this:
`/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/Home`

The `"libjli.dylib"` should be available at:
`/Library/Java/JavaVirtualMachines/<jdk_version>/Contents/MacOS/libjli.dylib`

Insert the full path to `libjli.dylib` into the **Java Path** setting in the [Preferences Window](#preferences-window).

### Linux

The Java Runtime Library (called `libjvm.so`) can be found inside of your JRE install folder and looks like this:
`<path_to_jre>/lib/<arch>/server/libjvm.so`

# Interface

## Main Window
Expand Down Expand Up @@ -478,9 +427,6 @@ The Preferences window lets you define settings for all projects. You can open t
| Plugin Port | Port number that Sourcetrail sends outgoing messages to.
| Indexer threads | Define how many parallel threads are used during indexing. Setting this value to `default` will cause Sourcetrail to detect the ideal number of threads based on the CPU and use as many threads for indexing.
| Multi process C/C++ indexing | Enable C/C++ indexer threads to run in a different process. This prevents the application from crashing due to unforeseen exceptions while indexing.
| Java Path | If you want to use Sourcetrail on Java source code, please specify a path to your Java 8 runtime library. Please keep in mind that a 32 bit Sourcetrail requires a 32 bit version of Java while a 64 bit Sourcetrail requires a 64 bit Java to be working correctly. You can either use the button below for automatic detection or add the path manually. For instructions on how to find your Java runtime path see (Finding Java Runtime Library Location](#finding-java-runtime-library-location).
| JRE System Library | Add the jar files of your JRE System Library. These jars can be found inside your JRE install directory. You can either use the button below for automatic detection or add the paths manually.
| Maven Path | Only required for indexing projects using Maven. Provide the location of your installed Maven executable. You can also use the auto detection.
| Post Processing | Enable a post processing step to solve unsolved references after the indexing is done. These references will be marked "ambiguous" to indicate that some of these edges may never be encountered during runtime of the indexed code because the post processing only relies on symbol names and types.
| Global Include Paths | Set header search paths that are used for **all** of your projects (e.g. std headers). An option for automatic detection of these paths is available for Clang, GCC and the Visual Studio compiler. For instructions on how to add paths manually see [Path List Box](#path-list-box). For instructions on how to find the system header paths see [Finding System Header Locations](#finding-system-header-locations).
| Global Framework Search Paths | **(macOS only)** Define the search paths for `.framework` files for all of your projects. An option for automatic detection of these paths is available for Clang and GCC. <br />For instructions on how to add paths see [Path List Box](#path-list-box).
Expand Down Expand Up @@ -1292,48 +1238,6 @@ C/C++ Source Groups from Code::Blocks offer the following configuration options:
| Global Framework Search Paths (macOS only) | These Framework Search Paths will be used in all your projects. (<br />For instructions on how to add paths see [Path List Box](#path-list-box). For instructions on how to find the system header paths see [Finding System Header Locations](#finding-system-header-locations))
| Additional Compiler Flags | Define additional compiler flags used during indexing including the dash (e.g. use `-DRELEASE` to add a `#define` for `RELEASE`).<br /><br />For instructions on how to add paths see [Path List Box](#path-list-box).

## Empty Java Source Group

Choose this option if you want to index Java files using Sourcetrail.
Empty Java Source Groups offer the following configuration options:

| Setting | Description
| --- | ---
| Standard | Select the language standard that should be used for indexing your the Source Group. Usually the most recent language standard is preselected here. (See [Language Support](#supported-languages))
| Files & Directories to Index | These paths define the files and directories that will be indexed by Sourcetrail. Provide a directory to recursively add all contained source and header files. If your project's source code resides in one location, but generated source files are kept at a different location, you will also need to add that directory. You can make use of environment variables with ${ENV_VAR}.<br /><br />For instructions on how to add paths see [Path List Box](#path-list-box).
| Excluded Files & Directories | These paths define the files and directories that will be left out from indexing.<br />Hints:<br /><ul><li>You can use the wildcard `*` which represents characters except `\` or `/` (e.g. `src/*/test.h` matches `src/app/test.h` but does not match `src/app/widget/test.h` or `src/test.h`)</li><li>You can use the wildcard `**` which represents arbitrary characters (e.g. `src**test.h` matches `src/app/test.h` as well as `src/app/widget/test.h` or `src/test.h`)</li><li>You can make use of environment variables with `${ENV_VAR}`<br /><br />For instructions on how to add paths see [Path List Box](#path-list-box).</li></ul>
| Source File Extensions | Define the valid extensions for source files including the dot e.g. `.java`. Sourcetrail will only try to index files that match one of these extensions.
| Class Path | Enter all the .jar files your project depends on. If your project depends on uncompiled java code that should not be indexed, please add the root directory of those .java files here (the one where all the package names are relative to). You can make use of environment variables with ${ENV_VAR}.
| JRE System Library | Tick this box to use the JRE System library jars specified in your application settings. Disable this setting if you want to use another JRE System library for this project and add the respective jars to the project's Class Path.

## Java Source Group from Gradle

If you are using a Gradle configuration to manage and build your project use this approach to create a Sourcetrail Source Group.
Java Source Groups from Gradle offer the following configuration options:

| Setting | Description
| --- | ---
| Standard | Select the language standard that should be used for indexing your the Source Group. Usually the most recent language standard is preselected here. (See [Language Support](#supported-languages))
| Gradle Project File | The path to the `build.gradle` file in the root folder of your Gradle project.
| Should Index Tests | This checkbox indicates whether or not Sourcetrail indexes the test code that is part of your Gradle project.
| Intermediate Dependencies Directory | Directory where Sourcetrail stores all of the project's `.jar` dependencies.
| Excluded Files & Directories | These paths define the files and directories that will be left out from indexing.<br />Hints:<br /><ul><li>You can use the wildcard `*` which represents characters except `\` or `/` (e.g. `src/*/test.h` matches `src/app/test.h` but does not match `src/app/widget/test.h` or `src/test.h`)</li><li>You can use the wildcard `**` which represents arbitrary characters (e.g. `src**test.h` matches `src/app/test.h` as well as `src/app/widget/test.h` or `src/test.h`)</li><li>You can make use of environment variables with `${ENV_VAR}`<br /><br />For instructions on how to add paths see [Path List Box](#path-list-box).</li></ul>
| Source File Extensions | Define the valid extensions for source files including the dot e.g. `.java`. Sourcetrail will only try to index files that match one of these extensions.

## Java Source Group from Maven

If you are using a Maven configuration to manage and build your project use this approach to create a Sourcetrail Source Group.
Java Source Groups from Maven offer the following configuration options:

| Setting | Description
| --- | ---
| Standard | Select the language standard that should be used for indexing your the Source Group. Usually the most recent language standard is preselected here. (See [Language Support](#supported-languages))
| Maven Project File | The path to the `pom.xml` file in the root folder of your Maven project.
| Should Index Tests | This checkbox indicates whether or not Sourcetrail indexes the test code that is part of your Maven project.
| Intermediate Dependencies Directory | Directory where Sourcetrail stores all of the project's `.jar` dependencies.
| Excluded Files & Directories | These paths define the files and directories that will be left out from indexing.<br />Hints:<br /><ul><li>You can use the wildcard `*` which represents characters except `\` or `/` (e.g. `src/*/test.h` matches `src/app/test.h` but does not match `src/app/widget/test.h` or `src/test.h`)</li><li>You can use the wildcard `**` which represents arbitrary characters (e.g. `src**test.h` matches `src/app/test.h` as well as `src/app/widget/test.h` or `src/test.h`)</li><li>You can make use of environment variables with `${ENV_VAR}`<br /><br />For instructions on how to add paths see [Path List Box](#path-list-box).</li></ul>
| Source File Extensions | Define the valid extensions for source files including the dot e.g. `.java`. Sourcetrail will only try to index files that match one of these extensions.

## Empty Python Source Group

Choose this option if you want to index Python files using Sourcetrail.
Expand Down
Loading

0 comments on commit a22e76c

Please sign in to comment.