Skip to content

Commit 44fb10f

Browse files
committed
Update documentation
- remove mention of the native image, which we no longer upload - reformulate the installation docs
1 parent 1e4df32 commit 44fb10f

File tree

2 files changed

+54
-36
lines changed

2 files changed

+54
-36
lines changed

docs/getting-started.md

Lines changed: 41 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,22 @@ tools that we're planning to support in the future.
1111

1212
## Install `lsif-java`
1313

14-
Most users only install `lsif-java` on a CI machine to upload LSIF indexes to a
15-
remote service like [Sourcegraph](https://sourcegraph.com/). The easiest way to
16-
install `lsif-java` is to download the native binary. However, you can also
17-
install `lsif-java` as a Java binary if that's easier to integrate with your
18-
setup.
19-
20-
### Native binary
21-
22-
The native binary is only available for Linux and macOS. The native binary
23-
includes all dependencies and does not need further access to the internet after
24-
it's been downloaded.
25-
26-
```sh
27-
# macOS
28-
curl -Lo lsif-java https://github.com/sourcegraph/lsif-java/releases/download/v@STABLE_VERSION@/lsif-java-x86_64-apple-darwin \
29-
&& chmod +x lsif-java \
30-
&& ./lsif-java --help
31-
32-
# Linux
33-
curl -Lo lsif-java https://github.com/sourcegraph/lsif-java/releases/download/v@STABLE_VERSION@/lsif-java-x86_64-pc-linux \
34-
&& chmod +x lsif-java \
35-
&& ./lsif-java --help
36-
```
14+
The most common way to use `lsif-java` is to run it from CI to upload LSIF
15+
indexes after merging a pull request. The easiest way to install `lsif-java` is
16+
to use the Java launcher.
3717

3818
### Java launcher
3919

20+
Use the `lsif-java` launcher if you can install software from the internet in
21+
your CI.
22+
4023
Use [Coursier](https://get-coursier.io/docs/cli-installation.html) to launch the
41-
Java binary. The jar files of `lsif-java` are downloaded the first time you run
42-
the `launch` command, and they're cached for subsequent runs.
24+
`lsif-java` Java binary. The jar files for `lsif-java` are downloaded the first
25+
time you run the `launch` command, and they are cached for subsequent runs.
4326

44-
```sh
45-
# Homebrew
46-
brew install coursier/formulas/coursier \
47-
&& coursier launch com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@ -- --help
27+
Copy-paste the steps below into your CI workflow to launch `lsif-java`.
4828

29+
```sh
4930
# macOS/Linux
5031
curl -fLo coursier https://git.io/coursier-cli \
5132
&& chmod +x coursier \
@@ -55,17 +36,38 @@ curl -fLo coursier https://git.io/coursier-cli \
5536
bitsadmin /transfer downloadCoursierCli https://git.io/coursier-cli "%cd%\coursier"
5637
bitsadmin /transfer downloadCoursierBat https://git.io/coursier-bat "%cd%\coursier.bat"
5738
./coursier launch com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@ -- --help
39+
40+
# Homebrew
41+
brew install coursier/formulas/coursier \
42+
&& coursier launch com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@ -- --help
5843
```
5944

45+
Additional command-line flags can be passed after the `--` argument. For
46+
example, replace `--help` with `index` in the command above to run the `index`
47+
subcommand.
48+
6049
### Java fat jar
6150

62-
Use the Coursier `bootstrap` command to generate an executable Java binary,
63-
which includes all dependencies and does not require further access to the
64-
internet after installation.
51+
Use the `lsif-java` fat jar if your CI does not allow downloading binaries from
52+
the internet.
53+
54+
Use the [Coursier](https://get-coursier.io/docs/cli-installation) `bootstrap`
55+
command to generate a local fat jar binary. The fat jar binary includes all
56+
dependencies and does not require further access to the internet after
57+
installation. The local fat jar will somehow need to be made available to your
58+
CI machine.
6559

6660
```sh
67-
# macOS/Linux/Windows
68-
cs bootstrap --standalone -o lsif-java com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@
61+
# macOS/Linux
62+
curl -fLo coursier https://git.io/coursier-cli \
63+
&& chmod +x coursier \
64+
&& ./coursier bootstrap --standalone -o lsif-java com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@
65+
./lsif-java --help
66+
67+
# Windows
68+
bitsadmin /transfer downloadCoursierCli https://git.io/coursier-cli "%cd%\coursier"
69+
bitsadmin /transfer downloadCoursierBat https://git.io/coursier-bat "%cd%\coursier.bat"
70+
./coursier bootstrap --standalone -o lsif-java com.sourcegraph:lsif-java_2.13:@STABLE_VERSION@
6971
./lsif-java --help
7072
```
7173

@@ -102,11 +104,16 @@ libraryDependencies += "com.sourcegraph" %% "lsif-java" % "@STABLE_VERSION@"
102104

103105
## Run `lsif-java index`
104106

107+
> The `index` command is only supported for Gradle and Maven, see
108+
> [Supported build tools](#supported-build-tools) for more details about other
109+
> build tools.
110+
105111
Run the `lsif-java index` command to generate an LSIF index for your codebase.
106112
This command should automatically infer the structure of your codebase and
107113
configure your build tool to generate LSIF.
108114

109115
```sh
116+
# At the root of a Gradle or Maven codebase.
110117
$ lsif-java index
111118
...
112119
info: /path/to/dump.lsif

docs/manual-configuration.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ zero-dependency Java library that you can install like any normal dependency.
2727

2828
[![](https://img.shields.io/maven-central/v/com.sourcegraph/semanticdb-javac)](https://repo1.maven.org/maven2/com/sourcegraph/semanticdb-javac/)
2929

30+
Use `curl` to download the compiler plugin jar file manually so that it can be
31+
added to the `javac -classpath` option.
32+
33+
```sh
34+
curl -Lo semanticdb-javac.jar https://repo1.maven.org/maven2/com/sourcegraph/semanticdb-javac/@STABLE_VERSION@/semanticdb-javac-@[email protected]
35+
javac -classpath semanticdb-javac.jar MyApplication.java
36+
```
37+
3038
If you're using Gradle.
3139

3240
```groovy
@@ -129,8 +137,11 @@ build/semanticdb-targetroot/META-INF/semanticdb/j8/src/main/java/example/Example
129137

130138
## Step 4: Generate LSIF index from SemanticDB files
131139

132-
Run the `lsif-java index-semanticdb` command to convert SemanticDB files into
133-
LSIF.
140+
First, install the `lsif-java` command-line tool according to the instructions
141+
in the [getting started guide](getting-started.md).
142+
143+
Next, run the `lsif-java index-semanticdb` command to convert SemanticDB files
144+
into LSIF.
134145

135146
```sh
136147
❯ lsif-java index-semanticdb $TARGETROOT

0 commit comments

Comments
 (0)