@@ -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+
4023Use [ 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
5031curl -fLo coursier https://git.io/coursier-cli \
5132 && chmod +x coursier \
@@ -55,17 +36,38 @@ curl -fLo coursier https://git.io/coursier-cli \
5536bitsadmin /transfer downloadCoursierCli https://git.io/coursier-cli " %cd%\coursier"
5637bitsadmin /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+
105111Run the ` lsif-java index ` command to generate an LSIF index for your codebase.
106112This command should automatically infer the structure of your codebase and
107113configure your build tool to generate LSIF.
108114
109115``` sh
116+ # At the root of a Gradle or Maven codebase.
110117$ lsif-java index
111118...
112119info: /path/to/dump.lsif
0 commit comments