Skip to content

Commit acff3fc

Browse files
authored
Merge pull request #100 from olafurpg/build-tools
2 parents 0d693a4 + 13197da commit acff3fc

File tree

57 files changed

+3093
-1477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3093
-1477
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/ubuntu/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Ubuntu version: bionic, focal
4+
ARG VARIANT="focal"
5+
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
6+
7+
# [Optional] Uncomment this section to install additional OS packages.
8+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
&& apt-get -y install --no-install-recommends default-jdk gradle maven golang-go \
10+
&& go get github.com/sourcegraph/lsif-semanticdb/cmd/lsif-semanticdb
11+
12+

.devcontainer/devcontainer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.158.0/containers/ubuntu
3+
{
4+
"name": "Ubuntu",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
// Update 'VARIANT' to pick an Ubuntu version: focal, bionic
8+
"args": { "VARIANT": "focal" }
9+
},
10+
11+
// Set *default* container specific settings.json values on container create.
12+
"settings": {
13+
"terminal.integrated.shell.linux": "/bin/bash"
14+
},
15+
16+
// Add the IDs of extensions you want installed when the container is created.
17+
"extensions": [],
18+
19+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
20+
// "forwardPorts": [],
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
// "postCreateCommand": "uname -a",
24+
25+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
26+
"remoteUser": "vscode"
27+
}

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: olafurpg/setup-scala@v10
13+
- uses: actions/setup-go@v2
1314
with:
14-
java-version: [email protected]
15+
go-version: '^1.13.1'
16+
- run: go get github.com/sourcegraph/lsif-semanticdb/cmd/lsif-semanticdb
1517
- run: sbt test
1618
check:
1719
runs-on: ubuntu-latest
1820
steps:
1921
- uses: actions/checkout@v2
2022
- uses: olafurpg/setup-scala@v10
21-
with:
22-
java-version: [email protected]
2323
- run: sbt checkAll

.github/workflows/native.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Native Image
2+
on:
3+
push:
4+
branches:
5+
- master
6+
release:
7+
types: [published]
8+
jobs:
9+
unix:
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [macOS-latest, ubuntu-latest, windows-latest]
15+
include:
16+
- os: macOS-latest
17+
uploaded_filename: lsif-java-x86_64-apple-darwin
18+
local_path: lsif-java/target/native-image/lsif-java
19+
- os: ubuntu-latest
20+
uploaded_filename: lsif-java-x86_64-pc-linux
21+
local_path: lsif-java/target/native-image/lsif-java
22+
- os: windows-latest
23+
uploaded_filename: lsif-java-x86_64-pc-win32.exe
24+
local_path: lsif-java\target\native-image\lsif-java.exe
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: olafurpg/setup-scala@v10
28+
- uses: actions/setup-go@v2
29+
with:
30+
go-version: '^1.13.1'
31+
- run: go get github.com/sourcegraph/lsif-semanticdb/cmd/lsif-semanticdb
32+
- run: git fetch --tags || true
33+
- name: sbt nativeImage
34+
shell: bash
35+
if: ${{ matrix.os != 'windows-latest' }}
36+
run: |
37+
sbt cli/nativeImage "cli/nativeImageRun --cwd tests/gradle-example"
38+
- name: sbt nativeImage
39+
shell: cmd
40+
if: ${{ matrix.os == 'windows-latest' }}
41+
run: >-
42+
"C:\Program Files (x86)\Microsoft Visual
43+
Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && sbt
44+
cli/nativeImage
45+
- uses: actions/upload-artifact@master
46+
with:
47+
path: ${{ matrix.local_path }}
48+
name: ${{ matrix.uploaded_filename }}
49+
- name: Upload release
50+
if: github.event_name == 'release'
51+
uses: actions/[email protected]
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
upload_url: ${{ github.event.release.upload_url }}
56+
asset_path: ${{ matrix.local_path }}
57+
asset_name: ${{ matrix.uploaded_filename }}
58+
asset_content_type: application/zip

README.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,24 @@ Currently, only Java 8 with the build tool sbt is supported. We hope to increase
1313
compatibility with more Java language versions and build tools as the project
1414
evolves.
1515

16-
| Language version | Support |
17-
| ---------------- | ------- |
18-
| Java 7 ||
19-
| Java 8 ||
20-
| Java 11+ ||
16+
| Language version | Support |
17+
| ---------------- | --------------------------------- |
18+
| Java 7 ||
19+
| Java 8 ||
20+
| Java 11 ||
21+
| Java 12 | Not tested in CI, but should work |
22+
| Java 13 | Not tested in CI, but should work |
23+
| Java 14 | Not tested in CI, but should work |
24+
| Java 15 ||
25+
| Java 16 | Not tested in CI, but should work |
26+
| Java 17 | Not tested in CI, but should work |
2127

2228
| Build tool | Support |
2329
| ---------- | ------- |
24-
| Gradle | |
25-
| Maven | |
30+
| Gradle | |
31+
| Maven | |
2632
| Bazel ||
33+
| Buck ||
2734
| sbt ||
2835

2936
## Overview
@@ -82,6 +89,17 @@ using SemanticDB as an intermediary representation for LSIF:
8289

8390
The following sections provide tips on how to contribute to this codebase.
8491

92+
### System dependencies
93+
94+
- `java`: any version should work
95+
- `git`: any version should work
96+
- `lsif-semanticdb`:
97+
`go get github.com/sourcegraph/lsif-semanticdb/cmd/lsif-semanticdb`
98+
- `gradle`: `brew install gradle`, or see
99+
[general installation guide](https://gradle.org/install/).
100+
- `mvn`: `brew install maven`, or see
101+
[general installation guide](https://www.baeldung.com/install-maven-on-windows-linux-mac).
102+
85103
### Project structure
86104

87105
These are the main components of the project.
@@ -100,17 +118,19 @@ These are the main components of the project.
100118

101119
### Helpful commands
102120

103-
| Command | Where | Description |
104-
| ------------------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------- |
105-
| `./sbt` | terminal | Start interactive sbt shell with Java 8. Takes a while to load on the first run. |
106-
| `unit/test` | sbt | Run fast unit tests. |
107-
| `~unit/test` | sbt | Start watch mode to run tests on file save, good for local edit-and-test workflows. |
121+
| Command | Where | Description |
122+
| ------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------- |
123+
| `./sbt` | terminal | Start interactive sbt shell with Java 11. Takes a while to load on the first run. |
124+
| `unit/test` | sbt | Run fast unit tests. |
125+
| `~unit/test` | sbt | Start watch mode to run tests on file save, good for local edit-and-test workflows. |
126+
| `buildTools/test` | sbt | Run slow build tool tests (Gradle, Maven). |
108127
| `snapshots/testOnly tests.MinimizedSnapshotSuite` | sbt | Runs fast snapshot tests. Indexes a small set of files under `tests/minimized`. |
109128
| `snapshots/testOnly tests.MinimizedSnapshotSuite -- *InnerClasses*` | sbt | Runs only individual tests cases matching the name "InnerClasses". |
110129
| `snapshots/testOnly tests.LibrarySnapshotSuite` | sbt | Runs slow snapshot tests. Indexes a corpus of external Java libraries. |
111130
| `snapshots/test` | sbt | Runs all snapshot tests. |
112131
| `snapshots/run` | sbt | Update snapshot tests. Use this command after you have fixed a bug. |
113-
| `fixAll` | sbt | Run Scalafmt, Scalafix and Javafmt on all sources. Run this before opening a PR. |
132+
| `cli/run --cwd DIRECTORY` | sbt | Run `lsif-java` command-line tool against a given Gradle/Maven build. |
133+
| `fixAll` | sbt | Run Scalafmt, Scalafix and Javafmt on all sources. Run this before opening a PR. |
114134

115135
### Import the project into IntelliJ
116136

0 commit comments

Comments
 (0)