Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/i-al-istannen/javadocapi
Builds a slightly more convenient model of java source code to power a discord javadoc bot.
https://github.com/i-al-istannen/javadocapi
Last synced: 1 day ago
JSON representation
Builds a slightly more convenient model of java source code to power a discord javadoc bot.
- Host: GitHub
- URL: https://github.com/i-al-istannen/javadocapi
- Owner: I-Al-Istannen
- License: mit
- Created: 2021-05-15T21:00:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-30T17:33:53.000Z (about 2 years ago)
- Last Synced: 2023-03-07T03:52:09.247Z (over 1 year ago)
- Language: Java
- Size: 160 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JavadocApi
JavadocApi can index source code (as a ZIP or in the file system) and generate
a SQLite database containing every exported class, field and method along with
a *structural* JSON representation of its Javadoc.This project also contains a small fuzzy query-engine that can look up data
from multiple databases and fuzzy match it against user queries. This works
entirely by issuing SQLite commands, so RAM usage is kept quite low in
production.## Demo
## Indexing a project
JavadocApi needs a json configuration as input that describes the project you
want to index. A few sample configurations can be found in
[`src/main/resources`](https://github.com/I-Al-Istannen/JavadocApi/tree/master/src/main/resources).
The format of the config is roughly this:```js
{
// The path to write the database to
"outputPath": "target/Jdk-Index.db",
// All paths to the project source code. If the project consists of multiple
// src folders, you can list them here
"resourcePaths": ["/usr/lib/jvm/java-17-openjdk/lib/src.zip"],
// The packages to include in the database. `"*"` can be used as a wildcard
// to include *all* packages.
"allowedPackages": [
"java.applet",
"java.awt"
]
}
```You can then simply run `java -jar JavadocApi.jar `
### Having fun with the classpath
Sometimes knowing the classpath is quite convenient as it allows for better
resolution of link targets. JavadocApi understands (simple) maven and gradle
build files and uses them to build its classpath dynamically. The inner
workings are a bit scary, but it basically translates your gradle or maven file
into a simplified `pom.xml` and then asks maven to download and resolve all
needed dependencies.To enable this feature, you need to set the `mavenHome` and `buildFiles` keys:
```js
{
"outputPath": "target/JDA-Index.db",
"resourcePaths": ["/home/i_al_istannen/.temp/Indizes/JDA.zip"],
"allowedPackages": [
"*"
],
// All gradle/pom files you want JavadocApi to inspect
"buildFiles": ["/home/i_al_istannen/.temp/Indizes/JDA/build.gradle.kts"],
// Path to your maven home
"mavenHome": "/opt/maven"
}
```