Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure JVM docs. (Cherry-pick of #20544) #20564

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/introduction/welcome-to-pants.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Pants is designed for fast, consistent, ergonomic builds. Some noteworthy featur

## Which languages and frameworks does Pants support?

- Pants [ships](page:language-support) with support for [Python](../python/overview/index.mdx), [Go](../go/index.mdx), [Java](../java-and-scala/index.mdx), [Scala](../java-and-scala/index.mdx) and [Shell](../shell/index.mdx).
- Pants [ships](page:language-support) with support for [Python](../python/overview/index.mdx), [Go](../go/index.mdx), [Java](../jvm/java-and-scala.mdx), [Scala](../jvm/java-and-scala.mdx), [Kotlin](../jvm/kotlin.mdx), and [Shell](../shell/index.mdx).
- Pants supports a wide range of code generators (such as Thrift, Protobuf, Scrooge and Avro), linters and formatters, and it is easy to add support for new or custom ones
- Pants can create standalone binaries, [Docker images](../docker/index.mdx), AWS Lambdas and GCP Cloud Functions

Expand Down
4 changes: 0 additions & 4 deletions docs/docs/java-and-scala/_category_.json

This file was deleted.

4 changes: 4 additions & 0 deletions docs/docs/jvm/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "JVM",
"position": 7
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Java and Scala overview
title: Java and Scala
sidebar_position: 0
---

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions docs/docs/using-pants/key-concepts/backends.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ The list of all backends (both stable and experimental) is also available via `p
| `pants.backend.experimental.go.lint.vet` | Enables support for running `go vet` | [Go overview](../../go/index.mdx) |
| `pants.backend.experimental.helm` | Enables core Helm support: [https://helm.sh](https://helm.sh) | [Helm overview](../../helm/index.mdx) |
| `pants.backend.experimental.helm.check.kubeconfirm` | Enables Kubeconform, a fast Kubernetes manifest validator: [https://github.com/yannh/kubeconform](https://github.com/yannh/kubeconform) | [Helm overview](../../helm/index.mdx) |
| `pants.backend.experimental.java` | Enables core Java support. | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.java.debug_goals` | Enable additional goals for introspecting Java targets | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.java.lint.google_java_format` | Enables Google Java Format. | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.java` | Enables core Java support. | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.java.debug_goals` | Enable additional goals for introspecting Java targets | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.java.lint.google_java_format` | Enables Google Java Format. | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.javascript` | Enables core JavaScript support. | |
| `pants.backend.experimental.javascript.lint.prettier` | Enables Prettier, a JavaScript (and more) autoformatter: [https://prettier.io](https://prettier.io) | |
| `pants.backend.experimental.kotlin` | Enables core Kotlin support | [Kotlin](../../java-and-scala/kotlin.mdx) |
| `pants.backend.experimental.kotlin.debug_goals` | Enables additional goals for introspecting Kotlin targets | [Kotlin](../../java-and-scala/kotlin.mdx) |
| `pants.backend.experimental.kotlin.lint.ktlint` | Enables ktlint, an anti-bikeshedding linter with built-in formatter: [https://pinterest.github.io/ktlint/](https://pinterest.github.io/ktlint/) | [Kotlin](../../java-and-scala/kotlin.mdx) |
| `pants.backend.experimental.kotlin` | Enables core Kotlin support | [Kotlin](../../jvm/kotlin.mdx) |
| `pants.backend.experimental.kotlin.debug_goals` | Enables additional goals for introspecting Kotlin targets | [Kotlin](../../jvm/kotlin.mdx) |
| `pants.backend.experimental.kotlin.lint.ktlint` | Enables ktlint, an anti-bikeshedding linter with built-in formatter: [https://pinterest.github.io/ktlint/](https://pinterest.github.io/ktlint/) | [Kotlin](../../jvm/kotlin.mdx) |
| `pants.backend.experimental.openapi` | Enables core OpenAPI support: [https://swagger.io/specification/](https://swagger.io/specification/) | [`openapi`](../../../reference/subsystems/openapi.mdx) |
| `pants.backend.experimental.openapi.codegen.java` | Enables generating Java from OpenAPI | |
| `pants.backend.experimental.openapi.lint.openapi_format` | Enables openapi-format: [https://github.com/thim81/openapi-format](https://github.com/thim81/openapi-format) | |
Expand All @@ -104,9 +104,9 @@ The list of all backends (both stable and experimental) is also available via `p
| `pants.backend.experimental.python.typecheck.pyright` | Enables Pyright, a Python type checker: [https://github.com/microsoft/pyright](https://github.com/microsoft/pyright) | |
| `pants.backend.experimental.python.typecheck.pytype` | Enables Pytype, a Python type checker: [https://google.github.io/pytype/](https://google.github.io/pytype/) | |
| `pants.backend.experimental.rust` | Enables core Rust support. | |
| `pants.backend.experimental.scala` | Enables core Scala support. | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.scala.debug_goals` | Enables additional goals for introspecting Scala targets | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.scala.lint.scalafmt` | Enables the Scalafmt formatter. | [Java & Scala overview](../../java-and-scala/index.mdx) |
| `pants.backend.experimental.scala` | Enables core Scala support. | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.scala.debug_goals` | Enables additional goals for introspecting Scala targets | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.scala.lint.scalafmt` | Enables the Scalafmt formatter. | [Java & Scala overview](../../jvm/java-and-scala.mdx) |
| `pants.backend.experimental.swift` | Enables core Swift support. | |
| `pants.backend.experimental.terraform` | Enables core Terraform support. | |
| `pants.backend.experimental.terraform.lint.tfsec` | Enables tfsec, for static analysis of Terraform: [https://aquasecurity.github.io/tfsec/](https://aquasecurity.github.io/tfsec/) | |
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/using-pants/troubleshooting-common-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ Is the missing import from first-party code? Common issues:
Common issues with both first and third-party imports:

- Ambiguity. >1 target exposes the same module/package.
- If it's a third-party dependency, you should likely use multiple "resolves" (lockfiles). Each resolve should have no more than one of the same requirement. See [Python](../python/overview/lockfiles.mdx#multiple-lockfiles) and [JVM](../java-and-scala/index.mdx).
- If it's a third-party dependency, you should likely use multiple "resolves" (lockfiles). Each resolve should have no more than one of the same requirement. See [Python](../python/overview/lockfiles.mdx#multiple-lockfiles) and [JVM](../jvm/java-and-scala.mdx).
- If it's a first-party dependency, you may have unintentionally created multiple targets owning the same file. Run `pants list path/to/file.ext` to see all owners. This often happens from overlapping `sources` fields. If this was intentional, follow the instructions in the ambiguity warning to disambiguate via the `dependencies` field.
- Some target types like `resources` and `files` often need to be explicitly added to the `dependencies` field and cannot be inferred (yet).
- Multiple resolves (Python and JVM).
- A target can only depend on targets that share the same "resolve" (lockfile).
- Pants will warn when it detects that the import exists in another resolve. This usually implies you should either change the current target's `resolve` field, or use the `parametrize()` mechanism so that the code works with multiple resolves.
- See [Python](../python/overview/lockfiles.mdx#multiple-lockfiles) and [JVM](../java-and-scala/index.mdx).
- See [Python](../python/overview/lockfiles.mdx#multiple-lockfiles) and [JVM](../jvm/java-and-scala.mdx).

When debugging dependency inference, it can help to explicitly add the problematic dependency to the `dependencies` field to see if it gets the code running. If so, you can then try to figure out why dependency inference is not working.

Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/notes/2.19.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Dependency inference for Java now supports code using recently added syntax like

##### Scala

Scala 3 is now supported when using [the BSP in an IDE](https://www.pantsbuild.org/2.19/docs/java-and-scala#working-in-an-ide).
Scala 3 is now supported when using [the BSP in an IDE](https://www.pantsbuild.org/2.19/docs/jvm/java-and-scala#working-in-an-ide).

#### OpenAPI

Expand Down
Loading