Skip to content

Commit b603e09

Browse files
authored
Add initial JVM example.
2 parents 30556e6 + 137a6cd commit b603e09

File tree

19 files changed

+2113
-0
lines changed

19 files changed

+2113
-0
lines changed

.github/workflows/pants.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2021 Pants project contributors.
2+
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3+
4+
# See https://pants.readme.io/docs/using-pants-in-ci for tips on how to set up your CI with Pants.
5+
6+
name: Pants
7+
8+
on: [push, pull_request]
9+
10+
jobs:
11+
org-check:
12+
name: Check GitHub Organization
13+
if: ${{ github.repository_owner == 'pantsbuild' }}
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- name: Noop
17+
run: "true"
18+
build:
19+
name: Perform CI Checks
20+
needs: org-check
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/cache@v2
25+
id: cache
26+
with:
27+
path: |
28+
~/.cache/pants/setup
29+
~/.cache/pants/lmdb_store
30+
~/.cache/pants/named_caches
31+
key: ${{ runner.os }}-
32+
- name: Bootstrap Pants
33+
run: ./pants --version
34+
- name: Check Pants config files
35+
run: ./pants tailor --check update-build-files --check
36+
- name: Lint, compile, and test
37+
run: ./pants lint check test '::'
38+
- name: Package / Run
39+
run: |
40+
./pants package ::
41+
- name: Upload Pants log
42+
uses: actions/upload-artifact@v2
43+
with:
44+
name: pants-log
45+
path: .pants.d/pants.log
46+
if: always() # We want the log even on failures.

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Pants workspace files
2+
/.pants.d/
3+
/dist/
4+
/.pids
5+
/.pants.workdir.file_lock*
6+
7+
# Editor specific files
8+
*.swp

.scalafmt.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version = 3.2.1
2+
runner.dialect = scala213
3+
maxColumn = 100
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
jvm_artifact(
2+
group="com.google.guava",
3+
artifact="guava",
4+
version="31.0.1-jre",
5+
# Because `guava` provides a package which does not match its `group`, we explicitly list it
6+
# here, which allows inference to recognize that imports of this package are provided by this
7+
# artifact. See https://www.pantsbuild.org/v2.9/docs/reference-jvm_artifact#codepackagescode
8+
# for more information.
9+
packages=["com.google.common.**"],
10+
)

3rdparty/jvm/com/lihaoyi/BUILD

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
jvm_artifact(
2+
name="acyclic",
3+
group="com.lihaoyi",
4+
artifact="acyclic_2.13",
5+
version="0.2.1",
6+
# Because `acyclic` provides a package which does not match its `group`, we explicitly list it
7+
# here, which allows inference to recognize that imports of this package are provided by this
8+
# artifact. See https://www.pantsbuild.org/v2.9/docs/reference-jvm_artifact#codepackagescode
9+
# for more information.
10+
packages=["acyclic.**"],
11+
)

0 commit comments

Comments
 (0)