Skip to content

Commit

Permalink
Define a target for scala_parser.
Browse files Browse the repository at this point in the history
[ci skip-rust]

[ci skip-build-wheels]
  • Loading branch information
stuhood committed Dec 1, 2021
1 parent e29a618 commit 2954ded
Show file tree
Hide file tree
Showing 6 changed files with 1,135 additions and 2 deletions.
6 changes: 6 additions & 0 deletions 3rdparty/jvm/io/circe/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
jvm_artifact(
name="circe-generic",
group="io.circe",
artifact="circe-generic_2.13",
version="0.14.1",
)
7 changes: 7 additions & 0 deletions 3rdparty/jvm/org/scalameta/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jvm_artifact(
name="scalameta",
group="org.scalameta",
artifact="scalameta_2.13",
version="4.4.30",
packages=["scala.meta.**"],
)
2 changes: 2 additions & 0 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ jvm_testprojects = "3rdparty/jvm/testprojects.lockfile"
# A resolve for the java_parser, which is shipped with Pants, and invoked with its own isolated
# classpath. Consequently, we isolate it to its own lockfile.
java_parser = "src/python/pants/backend/java/dependency_inference/java_parser.lockfile"
# Has the same isolation requirements as `java_parser`.
scala_parser = "src/python/pants/backend/scala/dependency_inference/scala_parser.lockfile"

[toolchain-setup]
repo = "pants"
Expand Down
10 changes: 8 additions & 2 deletions src/python/pants/backend/scala/dependency_inference/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_sources(dependencies=[":scala_sources"])
python_sources(dependencies=[":scala_resources"])
resources(name="scala_resources", sources=["*.scala", "scala_parser.lockfile"])

python_tests(name="tests", timeout=240)

resources(name="scala_sources", sources=["*.scala"])
# Targets for developing on the Scala parser outside of engine rules.
scala_sources(
name="scala_parser",
compatible_resolves=["scala_parser"],
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* TODO: The dependencies of this class are defined in two places:
* 1. `3rdparty/jvm` via import inference.
* 2. `SCALA_PARSER_ARTIFACT_REQUIREMENTS`.
* See https://github.com/pantsbuild/pants/issues/13754.
*/
package org.pantsbuild.backend.scala.dependency_inference

import io.circe._
Expand Down
Loading

0 comments on commit 2954ded

Please sign in to comment.