@@ -13,15 +13,17 @@ for some other example layouts.
13
13
14
14
# Running Pants
15
15
16
- You run Pants goals using the ` ./pants ` wrapper script, which will bootstrap the
17
- configured version of Pants if necessary.
16
+ You run Pants goals using the ` pants ` launcher binary, which will bootstrap the
17
+ version of Pants configured for this repo if necessary.
18
+
19
+ See [ here] ( https://www.pantsbuild.org/docs/installation ) for how to install the ` pants ` binary.
18
20
19
21
# Goals
20
22
21
23
Pants commands are called _ goals_ . You can get a list of goals with
22
24
23
25
```
24
- ./ pants help goals
26
+ pants help goals
25
27
```
26
28
27
29
Most goals take arguments to run on. To run on a single directory, just use the directory name.
@@ -30,19 +32,19 @@ To recursively run on a directory and all its subdirectories, add `::` to the en
30
32
For example:
31
33
32
34
```
33
- ./ pants lint src: 3rdparty::
35
+ pants lint src: 3rdparty::
34
36
```
35
37
36
38
You can run on all changed files:
37
39
38
40
```
39
- ./ pants --changed-since=HEAD lint
41
+ pants --changed-since=HEAD lint
40
42
```
41
43
42
44
You can run on all changed files, and any of their "dependees":
43
45
44
46
```
45
- ./ pants --changed-since=HEAD --changed-dependees=transitive test
47
+ pants --changed-since=HEAD --changed-dependees=transitive test
46
48
```
47
49
48
50
# Example Goals
@@ -52,45 +54,45 @@ Try these out in this repo!
52
54
## Run ` ktlint `
53
55
54
56
```
55
- ./ pants fmt :: # Format all files.
56
- ./ pants fmt src/jvm # Format only files in this directory (non-recursively).
57
- ./ pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
57
+ pants fmt :: # Format all files.
58
+ pants fmt src/jvm # Format only files in this directory (non-recursively).
59
+ pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
58
60
```
59
61
60
62
## Check compilation
61
63
62
64
```
63
- ./ pants check :: # Compile everything.
64
- ./ pants check src/jvm/org/pantsbuild/example/json/JsonExample.kt # Compile a file and its deps.
65
+ pants check :: # Compile everything.
66
+ pants check src/jvm/org/pantsbuild/example/json/JsonExample.kt # Compile a file and its deps.
65
67
```
66
68
67
69
## Create a binary file
68
70
69
71
Writes the result to the ` dist/ ` folder.
70
72
71
73
```
72
- ./ pants package src/jvm/org/pantsbuild/example/json # Build binaries in this directory.
73
- ./ pants package :: # Create all binaries.
74
+ pants package src/jvm/org/pantsbuild/example/json # Build binaries in this directory.
75
+ pants package :: # Create all binaries.
74
76
```
75
77
76
78
## Determine dependencies
77
79
78
80
```
79
- ./ pants dependencies src/jvm::
80
- ./ pants dependencies --transitive src/jvm::
81
+ pants dependencies src/jvm::
82
+ pants dependencies --transitive src/jvm::
81
83
```
82
84
83
85
## Determine dependees
84
86
85
87
That is, find what code depends on a particular files.
86
88
87
89
```
88
- ./ pants dependees src/jvm/org/pantsbuild/example/json::
89
- ./ pants dependees --transitive src/jvm/org/pantsbuild/example/json/JsonExample.kt
90
+ pants dependees src/jvm/org/pantsbuild/example/json::
91
+ pants dependees --transitive src/jvm/org/pantsbuild/example/json/JsonExample.kt
90
92
```
91
93
92
94
## Count lines of code
93
95
94
96
```
95
- ./ pants count-loc ::
97
+ pants count-loc ::
96
98
```
0 commit comments