From 950aceda1d2ddb3df5fd30347e3f12efc6630c6b Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Thu, 14 Nov 2024 18:48:36 +0100 Subject: [PATCH 01/16] add args parser --- scalafix/BUILD | 15 ++++++++++++ scalafix/run_scalafix.bzl | 0 scalafix/src/ArgsConfig.scala | 43 +++++++++++++++++++++++++++++++++++ scalafix/src/Main.scala | 5 ++++ 4 files changed, 63 insertions(+) create mode 100644 scalafix/BUILD create mode 100644 scalafix/run_scalafix.bzl create mode 100644 scalafix/src/ArgsConfig.scala create mode 100644 scalafix/src/Main.scala diff --git a/scalafix/BUILD b/scalafix/BUILD new file mode 100644 index 00000000..4783bfa3 --- /dev/null +++ b/scalafix/BUILD @@ -0,0 +1,15 @@ +load("//rules:scala.bzl", "scala_binary") + +scala_binary( + name = "scalafmt", + args = [ + "--toolchain=", + "--opts=:--verbose:--config", + ], + main_class = "rules_scala3.scalafix.src.Main", + scala = "//scala:bootstrap_3", + visibility = ["//visibility:public"], + deps = [ + "@rules_scala3//3rdparty/jvm/com/github/scopt", + ], +) diff --git a/scalafix/run_scalafix.bzl b/scalafix/run_scalafix.bzl new file mode 100644 index 00000000..e69de29b diff --git a/scalafix/src/ArgsConfig.scala b/scalafix/src/ArgsConfig.scala new file mode 100644 index 00000000..e9aa5d65 --- /dev/null +++ b/scalafix/src/ArgsConfig.scala @@ -0,0 +1,43 @@ +package rules_scala3.scalafix.src + +import scopt.OParser + +case class ArgsConfig( + toolchain: Option[String] = None, + scalafixOpts: Option[String] = None, + targets: Seq[String] = Seq.empty, + excludedTargets: Seq[String] = Seq.empty +) + +object ArgsConfig: + private val builder = OParser.builder[ArgsConfig] + import builder.* + + private val parser = OParser.sequence( + programName("scalafix-runner"), + head("scalafix-runner", "1.0"), + + help('h', "help").text("Displays this usage text"), + + opt[String]('t', "toolchain") + .required() + .action((value, config) => config.copy(toolchain = Some(value))) + .text("Required. Specifies the toolchain with which targets will be built"), + + opt[String]('o', "opts") + .action((value, config) => config.copy(scalafixOpts = Some(value))) + .text("Options passed to scalafix as a colon-separated string (e.g., :--verbose:--config)"), + + arg[String]("...") + .unbounded() + .optional() + .action((target, config) => config.copy(targets = config.targets :+ target)) + .text("Specifies the Bazel targets to be included"), + + checkConfig { config => + val (excluded, included) = config.targets.partition(_.startsWith("-")) + Right(config.copy(excludedTargets = excluded.map(_.drop(1)), targets = included)) + } + ) + + def parse(args: Seq[String]): Option[ArgsConfig] = OParser.parse(parser, args, ArgsConfig()) \ No newline at end of file diff --git a/scalafix/src/Main.scala b/scalafix/src/Main.scala new file mode 100644 index 00000000..46c41399 --- /dev/null +++ b/scalafix/src/Main.scala @@ -0,0 +1,5 @@ +package rules_scala3.scalafix.src + +object Main: + def main(args: Array[String]): Unit = + given Vars = ArgsConfig(args.toIndexedSeq).getOrElse(sys.exit(2)) \ No newline at end of file From dcc7eaaff9d95824618226786a97c6385cd38941 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Thu, 14 Nov 2024 19:01:13 +0100 Subject: [PATCH 02/16] add args parser --- scalafix/BUILD | 5 +++-- scalafix/src/BUILD | 5 +++++ scalafix/src/Main.scala | 11 ++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 scalafix/src/BUILD diff --git a/scalafix/BUILD b/scalafix/BUILD index 4783bfa3..6de2b800 100644 --- a/scalafix/BUILD +++ b/scalafix/BUILD @@ -1,9 +1,10 @@ load("//rules:scala.bzl", "scala_binary") scala_binary( - name = "scalafmt", + name = "scalaix", + srcs = ["//scalafix/src:scalafix"], args = [ - "--toolchain=", + "--toolchain=//my/toolchain", "--opts=:--verbose:--config", ], main_class = "rules_scala3.scalafix.src.Main", diff --git a/scalafix/src/BUILD b/scalafix/src/BUILD new file mode 100644 index 00000000..250812f6 --- /dev/null +++ b/scalafix/src/BUILD @@ -0,0 +1,5 @@ +filegroup( + name = "scalafix", + srcs = glob(["*.scala"]), + visibility = ["//visibility:public"], +) diff --git a/scalafix/src/Main.scala b/scalafix/src/Main.scala index 46c41399..77143da9 100644 --- a/scalafix/src/Main.scala +++ b/scalafix/src/Main.scala @@ -2,4 +2,13 @@ package rules_scala3.scalafix.src object Main: def main(args: Array[String]): Unit = - given Vars = ArgsConfig(args.toIndexedSeq).getOrElse(sys.exit(2)) \ No newline at end of file + ArgsConfig.parse(args.toIndexedSeq) match + case Some(config) => + println("Parsed Arguments:") + println(s"Toolchain: ${config.toolchain.getOrElse("None")}") + println(s"Scalafix Options: ${config.scalafixOpts.getOrElse("None")}") + println(s"Targets: ${config.targets.mkString(", ")}") + println(s"Excluded Targets: ${config.excludedTargets.mkString(", ")}") + case None => + println("Failed to parse arguments.") + sys.exit(2) From 2ed295a8884f762253a096b95964151d8c29c620 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Mon, 18 Nov 2024 20:04:33 +0100 Subject: [PATCH 03/16] moved to /rules --- {scalafix => rules/scalafix}/BUILD | 4 ++-- {scalafix => rules/scalafix}/run_scalafix.bzl | 0 {scalafix => rules/scalafix}/src/ArgsConfig.scala | 2 +- {scalafix => rules/scalafix}/src/BUILD | 0 {scalafix => rules/scalafix}/src/Main.scala | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename {scalafix => rules/scalafix}/BUILD (76%) rename {scalafix => rules/scalafix}/run_scalafix.bzl (100%) rename {scalafix => rules/scalafix}/src/ArgsConfig.scala (97%) rename {scalafix => rules/scalafix}/src/BUILD (100%) rename {scalafix => rules/scalafix}/src/Main.scala (93%) diff --git a/scalafix/BUILD b/rules/scalafix/BUILD similarity index 76% rename from scalafix/BUILD rename to rules/scalafix/BUILD index 6de2b800..9067afd9 100644 --- a/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -2,12 +2,12 @@ load("//rules:scala.bzl", "scala_binary") scala_binary( name = "scalaix", - srcs = ["//scalafix/src:scalafix"], + srcs = ["//rules/scalafix/src:scalafix"], args = [ "--toolchain=//my/toolchain", "--opts=:--verbose:--config", ], - main_class = "rules_scala3.scalafix.src.Main", + main_class = "rules_scala3.rules.scalafix.src.Main", scala = "//scala:bootstrap_3", visibility = ["//visibility:public"], deps = [ diff --git a/scalafix/run_scalafix.bzl b/rules/scalafix/run_scalafix.bzl similarity index 100% rename from scalafix/run_scalafix.bzl rename to rules/scalafix/run_scalafix.bzl diff --git a/scalafix/src/ArgsConfig.scala b/rules/scalafix/src/ArgsConfig.scala similarity index 97% rename from scalafix/src/ArgsConfig.scala rename to rules/scalafix/src/ArgsConfig.scala index e9aa5d65..c9871f76 100644 --- a/scalafix/src/ArgsConfig.scala +++ b/rules/scalafix/src/ArgsConfig.scala @@ -1,4 +1,4 @@ -package rules_scala3.scalafix.src +package rules_scala3.rules.scalafix.src import scopt.OParser diff --git a/scalafix/src/BUILD b/rules/scalafix/src/BUILD similarity index 100% rename from scalafix/src/BUILD rename to rules/scalafix/src/BUILD diff --git a/scalafix/src/Main.scala b/rules/scalafix/src/Main.scala similarity index 93% rename from scalafix/src/Main.scala rename to rules/scalafix/src/Main.scala index 77143da9..94cf544d 100644 --- a/scalafix/src/Main.scala +++ b/rules/scalafix/src/Main.scala @@ -1,4 +1,4 @@ -package rules_scala3.scalafix.src +package rules_scala3.rules.scalafix.src object Main: def main(args: Array[String]): Unit = From 155d65ebbd735e20bbe99b954c0adbd98abbdc45 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Wed, 20 Nov 2024 17:01:32 +0100 Subject: [PATCH 04/16] 3rdparty addee --- rules/scalafix/3rdparty/BUILD | 0 .../scalafix/3rdparty/jvm/ch/epfl/scala/BUILD | 83 +++++++++ .../jvm/com/google/code/findbugs/BUILD | 10 ++ .../3rdparty/jvm/com/google/code/gson/BUILD | 10 ++ .../3rdparty/jvm/com/google/errorprone/BUILD | 10 ++ .../3rdparty/jvm/com/google/guava/BUILD | 38 +++++ .../3rdparty/jvm/com/google/j2objc/BUILD | 10 ++ .../3rdparty/jvm/com/google/protobuf/BUILD | 10 ++ .../jvm/com/googlecode/java_diff_utils/BUILD | 10 ++ .../jvm/com/googlecode/javaewah/BUILD | 10 ++ rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD | 27 +++ .../3rdparty/jvm/com/martiansoftware/BUILD | 10 ++ .../3rdparty/jvm/com/thesamet/scalapb/BUILD | 30 ++++ .../scalafix/3rdparty/jvm/com/typesafe/BUILD | 10 ++ .../3rdparty/jvm/io/get_coursier/BUILD | 13 ++ .../jvm/io/github/java_diff_utils/BUILD | 10 ++ .../3rdparty/jvm/net/java/dev/jna/BUILD | 10 ++ .../3rdparty/jvm/org/apache/commons/BUILD | 23 +++ .../3rdparty/jvm/org/checkerframework/BUILD | 10 ++ .../3rdparty/jvm/org/eclipse/jgit/BUILD | 14 ++ .../3rdparty/jvm/org/eclipse/lsp4j/BUILD | 41 +++++ .../3rdparty/jvm/org/eclipse/xtend/BUILD | 27 +++ .../3rdparty/jvm/org/eclipse/xtext/BUILD | 13 ++ rules/scalafix/3rdparty/jvm/org/jline/BUILD | 60 +++++++ rules/scalafix/3rdparty/jvm/org/lz4/BUILD | 10 ++ .../3rdparty/jvm/org/scala_lang/BUILD | 121 ++++++++++++++ .../3rdparty/jvm/org/scala_lang/modules/BUILD | 23 +++ .../scalafix/3rdparty/jvm/org/scala_sbt/BUILD | 23 +++ .../scalafix/3rdparty/jvm/org/scalameta/BUILD | 158 ++++++++++++++++++ rules/scalafix/3rdparty/jvm/org/slf4j/BUILD | 10 ++ .../scalafix/3rdparty/jvm/org/typelevel/BUILD | 13 ++ rules/scalafix/3rdparty/workspace.bzl | 109 ++++++++++++ 32 files changed, 956 insertions(+) create mode 100644 rules/scalafix/3rdparty/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/guava/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/com/typesafe/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/jline/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/lz4/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/scalameta/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/slf4j/BUILD create mode 100644 rules/scalafix/3rdparty/jvm/org/typelevel/BUILD create mode 100644 rules/scalafix/3rdparty/workspace.bzl diff --git a/rules/scalafix/3rdparty/BUILD b/rules/scalafix/3rdparty/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD b/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD new file mode 100644 index 00000000..a39d1820 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD @@ -0,0 +1,83 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "scalafix_cli", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_cli_3_5_1" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/martiansoftware:nailgun_server", + "//rules/scalafix/3rdparty/jvm/org/apache/commons:commons_text", + "//rules/scalafix/3rdparty/jvm/org/eclipse/jgit:org_eclipse_jgit", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_library", + ":scalafix_interfaces", + ":scalafix_reflect", + ":scalafix_rules" + ], + visibility = [ + "//visibility:public" + ] +) + +scala_import( + name = "scalafix_core", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_core_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils:diffutils", + "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + "//rules/scalafix/3rdparty/jvm/org/scalameta:metaconfig_typesafe_config", + "//rules/scalafix/3rdparty/jvm/org/scalameta:scalameta", + "//rules/scalafix/3rdparty/jvm/org/scalameta:semanticdb_shared" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "scalafix_interfaces", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_interfaces" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalafix_reflect", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_reflect_2_13_15" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect", + "//rules/scalafix/3rdparty/jvm/org/scalameta:semanticdb_scalac_core", + ":scalafix_core" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalafix_rules", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_rules_3_5_1" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_library", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_presentation_compiler", + ":scalafix_core" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD b/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD new file mode 100644 index 00000000..5e83ab97 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jsr305", + jars = [ + "//external:jar/com/google/code/findbugs/jsr305" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD b/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD new file mode 100644 index 00000000..0d1be6e9 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "gson", + jars = [ + "//external:jar/com/google/code/gson/gson" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD b/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD new file mode 100644 index 00000000..4305f7f3 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "error_prone_annotations", + jars = [ + "//external:jar/com/google/errorprone/error_prone_annotations" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD b/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD new file mode 100644 index 00000000..99daf8d2 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD @@ -0,0 +1,38 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "failureaccess", + jars = [ + "//external:jar/com/google/guava/failureaccess" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "guava", + jars = [ + "//external:jar/com/google/guava/guava" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/google/code/findbugs:jsr305", + "//rules/scalafix/3rdparty/jvm/com/google/errorprone:error_prone_annotations", + "//rules/scalafix/3rdparty/jvm/com/google/j2objc:j2objc_annotations", + "//rules/scalafix/3rdparty/jvm/org/checkerframework:checker_qual", + ":failureaccess", + ":listenablefuture" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "listenablefuture", + jars = [ + "//external:jar/com/google/guava/listenablefuture" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD b/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD new file mode 100644 index 00000000..0f31bab7 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "j2objc_annotations", + jars = [ + "//external:jar/com/google/j2objc/j2objc_annotations" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD b/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD new file mode 100644 index 00000000..d765b3d2 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "protobuf_java", + jars = [ + "//external:jar/com/google/protobuf/protobuf_java" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD b/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD new file mode 100644 index 00000000..c81eb08f --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "diffutils", + jars = [ + "//external:jar/com/googlecode/java_diff_utils/diffutils" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD b/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD new file mode 100644 index 00000000..ff9e55c2 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "JavaEWAH", + jars = [ + "//external:jar/com/googlecode/javaewah/JavaEWAH" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD b/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD new file mode 100644 index 00000000..f88aca27 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD @@ -0,0 +1,27 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "fansi", + jars = [ + "//external:jar/com/lihaoyi/fansi_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":sourcecode" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "sourcecode", + jars = [ + "//external:jar/com/lihaoyi/sourcecode_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD b/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD new file mode 100644 index 00000000..e0dd1452 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "nailgun_server", + jars = [ + "//external:jar/com/martiansoftware/nailgun_server" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD b/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD new file mode 100644 index 00000000..3849d4c3 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD @@ -0,0 +1,30 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "lenses", + jars = [ + "//external:jar/com/thesamet/scalapb/lenses_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalapb_runtime", + jars = [ + "//external:jar/com/thesamet/scalapb/scalapb_runtime_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/google/protobuf:protobuf_java", + "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":lenses" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD b/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD new file mode 100644 index 00000000..06483592 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "config", + jars = [ + "//external:jar/com/typesafe/config" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD b/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD new file mode 100644 index 00000000..079565d0 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "interface", + jars = [ + "//external:jar/io/get_coursier/interface" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/slf4j:slf4j_api" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD b/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD new file mode 100644 index 00000000..41c4afc4 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "java_diff_utils", + jars = [ + "//external:jar/io/github/java_diff_utils/java_diff_utils" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD b/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD new file mode 100644 index 00000000..ffe56fc6 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jna", + jars = [ + "//external:jar/net/java/dev/jna/jna" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD b/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD new file mode 100644 index 00000000..ccb76b0c --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD @@ -0,0 +1,23 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "commons_lang3", + jars = [ + "//external:jar/org/apache/commons/commons_lang3" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "commons_text", + jars = [ + "//external:jar/org/apache/commons/commons_text" + ], + runtime_deps = [ + ":commons_lang3" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD b/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD new file mode 100644 index 00000000..32ea9d4e --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "checker_qual", + jars = [ + "//external:jar/org/checkerframework/checker_qual" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD new file mode 100644 index 00000000..a8fd2d5b --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD @@ -0,0 +1,14 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_jgit", + jars = [ + "//external:jar/org/eclipse/jgit/org_eclipse_jgit" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/googlecode/javaewah:JavaEWAH", + "//rules/scalafix/3rdparty/jvm/org/slf4j:slf4j_api" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD new file mode 100644 index 00000000..28f70938 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD @@ -0,0 +1,41 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_lsp4j", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j" + ], + runtime_deps = [ + ":org_eclipse_lsp4j_generator", + ":org_eclipse_lsp4j_jsonrpc" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_lsp4j_generator", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/eclipse/xtend:org_eclipse_xtend_lib", + ":org_eclipse_lsp4j_jsonrpc" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_lsp4j_jsonrpc", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/google/code/gson:gson" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD new file mode 100644 index 00000000..c98b1c4a --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD @@ -0,0 +1,27 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_xtend_lib", + jars = [ + "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib", + ":org_eclipse_xtend_lib_macro" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_xtend_lib_macro", + jars = [ + "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD new file mode 100644 index 00000000..906fe86a --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_xtext_xbase_lib", + jars = [ + "//external:jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/google/guava:guava" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/jline/BUILD b/rules/scalafix/3rdparty/jvm/org/jline/BUILD new file mode 100644 index 00000000..22b82e28 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/jline/BUILD @@ -0,0 +1,60 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jline", + jars = [ + "//external:jar/org/jline/jline" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_native", + jars = [ + "//external:jar/org/jline/jline_native" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_reader", + jars = [ + "//external:jar/org/jline/jline_reader" + ], + runtime_deps = [ + ":jline_terminal" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_terminal", + jars = [ + "//external:jar/org/jline/jline_terminal" + ], + runtime_deps = [ + ":jline_native" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_terminal_jna", + jars = [ + "//external:jar/org/jline/jline_terminal_jna" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/net/java/dev/jna:jna", + ":jline_terminal" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/lz4/BUILD b/rules/scalafix/3rdparty/jvm/org/lz4/BUILD new file mode 100644 index 00000000..636ee71d --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/lz4/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "lz4_java", + jars = [ + "//external:jar/org/lz4/lz4_java" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD new file mode 100644 index 00000000..99c008fe --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD @@ -0,0 +1,121 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "scala3_compiler", + jars = [ + "//external:jar/org/scala_lang/scala3_compiler_3" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/jline:jline_reader", + "//rules/scalafix/3rdparty/jvm/org/jline:jline_terminal", + "//rules/scalafix/3rdparty/jvm/org/jline:jline_terminal_jna", + "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_asm", + "//rules/scalafix/3rdparty/jvm/org/scala_sbt:compiler_interface", + ":scala3_interfaces", + ":scala3_library", + ":tasty_core" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala3_interfaces", + jars = [ + "//external:jar/org/scala_lang/scala3_interfaces" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala3_library", + exports = [ + "@scala3_library//jar" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala3_presentation_compiler", + jars = [ + "//external:jar/org/scala_lang/scala3_presentation_compiler_3" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface", + "//rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j:org_eclipse_lsp4j", + "//rules/scalafix/3rdparty/jvm/org/lz4:lz4_java", + "//rules/scalafix/3rdparty/jvm/org/scalameta:mtags_interfaces", + ":scala3_compiler", + ":scala3_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_compiler", + jars = [ + "//external:jar/org/scala_lang/scala_compiler" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/io/github/java_diff_utils:java_diff_utils", + "//rules/scalafix/3rdparty/jvm/net/java/dev/jna:jna", + "//rules/scalafix/3rdparty/jvm/org/jline:jline", + ":scala_library", + ":scala_reflect" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_library", + exports = [ + "@scala_library_2_13//jar" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_reflect", + exports = [ + "@scala_reflect_2_13//jar" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalap", + jars = [ + "//external:jar/org/scala_lang/scalap" + ], + runtime_deps = [ + ":scala_compiler" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "tasty_core", + jars = [ + "//external:jar/org/scala_lang/tasty_core_3" + ], + runtime_deps = [ + ":scala3_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD new file mode 100644 index 00000000..9af614f8 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD @@ -0,0 +1,23 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "scala_asm", + jars = [ + "//external:jar/org/scala_lang/modules/scala_asm" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_collection_compat", + jars = [ + "//external:jar/org/scala_lang/modules/scala_collection_compat_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD new file mode 100644 index 00000000..f189571e --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD @@ -0,0 +1,23 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "compiler_interface", + jars = [ + "//external:jar/org/scala_sbt/compiler_interface" + ], + runtime_deps = [ + ":util_interface" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "util_interface", + jars = [ + "//external:jar/org/scala_sbt/util_interface" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD b/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD new file mode 100644 index 00000000..bcd6bed1 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD @@ -0,0 +1,158 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "common", + jars = [ + "//external:jar/org/scalameta/common_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/lihaoyi:sourcecode", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_core", + jars = [ + "//external:jar/org/scalameta/metaconfig_core_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect", + "//rules/scalafix/3rdparty/jvm/org/typelevel:paiges_core", + ":metaconfig_pprint" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_pprint", + jars = [ + "//external:jar/org/scalameta/metaconfig_pprint_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/lihaoyi:fansi", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_typesafe_config", + jars = [ + "//external:jar/org/scalameta/metaconfig_typesafe_config_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/typesafe:config", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":metaconfig_core" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "mtags_interfaces", + jars = [ + "//external:jar/org/scalameta/mtags_interfaces" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "parsers", + jars = [ + "//external:jar/org/scalameta/parsers_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":trees" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalameta", + jars = [ + "//external:jar/org/scalameta/scalameta_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scalap", + ":parsers" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "semanticdb_scalac", + jars = [ + "//external:jar/org/scalameta/semanticdb_scalac_2_13_15" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//visibility:public" + ] +) + +scala_import( + name = "semanticdb_scalac_core", + jars = [ + "//external:jar/org/scalameta/semanticdb_scalac_core_2_13_15" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":semanticdb_shared" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "semanticdb_shared", + jars = [ + "//external:jar/org/scalameta/semanticdb_shared_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/com/thesamet/scalapb:scalapb_runtime", + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":scalameta" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "trees", + jars = [ + "//external:jar/org/scalameta/trees_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", + ":common" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD b/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD new file mode 100644 index 00000000..a1e3cea1 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "slf4j_api", + jars = [ + "//external:jar/org/slf4j/slf4j_api" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD b/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD new file mode 100644 index 00000000..1a7f55a4 --- /dev/null +++ b/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "paiges_core", + jars = [ + "//external:jar/org/typelevel/paiges_core_2_13" + ], + runtime_deps = [ + "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//rules/scalafix/3rdparty/jvm:__subpackages__" + ] +) diff --git a/rules/scalafix/3rdparty/workspace.bzl b/rules/scalafix/3rdparty/workspace.bzl new file mode 100644 index 00000000..2af92c32 --- /dev/null +++ b/rules/scalafix/3rdparty/workspace.bzl @@ -0,0 +1,109 @@ +# Do not edit. rules_scala3 autogenerates this file +def _jar_artifact_impl(ctx): + jar_name = "%s.jar" % ctx.name + ctx.download( + output = ctx.path("jar/%s" % jar_name), + url = ctx.attr.urls, + executable = False, + ) + build_file_contents = """ +package(default_visibility = ['//visibility:public']) +filegroup( + name = 'jar', + srcs = ['{jar_name}'], + visibility = ['//visibility:public'], +) +alias( + name = "file", + actual = ":jar", + visibility = ["//visibility:public"], +)\n""".format(artifact = ctx.attr.artifact, jar_name = jar_name) + ctx.file(ctx.path("jar/BUILD"), build_file_contents, False) + return None + +jar_artifact = repository_rule( + attrs = { + "artifact": attr.string(mandatory = True), + "urls": attr.string_list(mandatory = True), + }, + implementation = _jar_artifact_impl, +) + +def jar_artifact_callback(hash): + jar_artifact( + artifact = hash["artifact"], + name = hash["name"], + urls = [hash["url"]], + ) + native.bind(name = hash["bind"], actual = hash["actual"]) + +def list_dependencies(): + return [ + {"artifact":"ch.epfl.scala:scalafix-cli_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-cli_3.5.1/0.13.0/scalafix-cli_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_cli_3_5_1","actual":"@ch_epfl_scala_scalafix_cli_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_cli_3_5_1"}, + {"artifact":"ch.epfl.scala:scalafix-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-core_2.13/0.13.0/scalafix-core_2.13-0.13.0.jar","name":"ch_epfl_scala_scalafix_core_2_13","actual":"@ch_epfl_scala_scalafix_core_2_13//jar","bind": "jar/ch/epfl/scala/scalafix_core_2_13"}, + {"artifact":"ch.epfl.scala:scalafix-interfaces:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-interfaces/0.13.0/scalafix-interfaces-0.13.0.jar","name":"ch_epfl_scala_scalafix_interfaces","actual":"@ch_epfl_scala_scalafix_interfaces//jar","bind": "jar/ch/epfl/scala/scalafix_interfaces"}, + {"artifact":"ch.epfl.scala:scalafix-reflect_2.13.15:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-reflect_2.13.15/0.13.0/scalafix-reflect_2.13.15-0.13.0.jar","name":"ch_epfl_scala_scalafix_reflect_2_13_15","actual":"@ch_epfl_scala_scalafix_reflect_2_13_15//jar","bind": "jar/ch/epfl/scala/scalafix_reflect_2_13_15"}, + {"artifact":"ch.epfl.scala:scalafix-rules_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-rules_3.5.1/0.13.0/scalafix-rules_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_rules_3_5_1","actual":"@ch_epfl_scala_scalafix_rules_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_rules_3_5_1"}, + {"artifact":"com.google.code.findbugs:jsr305:3.0.2","url":"https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar","name":"com_google_code_findbugs_jsr305","actual":"@com_google_code_findbugs_jsr305//jar","bind": "jar/com/google/code/findbugs/jsr305"}, + {"artifact":"com.google.code.gson:gson:2.10.1","url":"https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar","name":"com_google_code_gson_gson","actual":"@com_google_code_gson_gson//jar","bind": "jar/com/google/code/gson/gson"}, + {"artifact":"com.google.errorprone:error_prone_annotations:2.3.4","url":"https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar","name":"com_google_errorprone_error_prone_annotations","actual":"@com_google_errorprone_error_prone_annotations//jar","bind": "jar/com/google/errorprone/error_prone_annotations"}, + {"artifact":"com.google.guava:failureaccess:1.0.1","url":"https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar","name":"com_google_guava_failureaccess","actual":"@com_google_guava_failureaccess//jar","bind": "jar/com/google/guava/failureaccess"}, + {"artifact":"com.google.guava:guava:30.1-jre","url":"https://repo1.maven.org/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar","name":"com_google_guava_guava","actual":"@com_google_guava_guava//jar","bind": "jar/com/google/guava/guava"}, + {"artifact":"com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava","url":"https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar","name":"com_google_guava_listenablefuture","actual":"@com_google_guava_listenablefuture//jar","bind": "jar/com/google/guava/listenablefuture"}, + {"artifact":"com.google.j2objc:j2objc-annotations:1.3","url":"https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar","name":"com_google_j2objc_j2objc_annotations","actual":"@com_google_j2objc_j2objc_annotations//jar","bind": "jar/com/google/j2objc/j2objc_annotations"}, + {"artifact":"com.google.protobuf:protobuf-java:3.19.6","url":"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.6/protobuf-java-3.19.6.jar","name":"com_google_protobuf_protobuf_java","actual":"@com_google_protobuf_protobuf_java//jar","bind": "jar/com/google/protobuf/protobuf_java"}, + {"artifact":"com.googlecode.java-diff-utils:diffutils:1.3.0","url":"https://repo1.maven.org/maven2/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar","name":"com_googlecode_java_diff_utils_diffutils","actual":"@com_googlecode_java_diff_utils_diffutils//jar","bind": "jar/com/googlecode/java_diff_utils/diffutils"}, + {"artifact":"com.googlecode.javaewah:JavaEWAH:1.1.13","url":"https://repo1.maven.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.13/JavaEWAH-1.1.13.jar","name":"com_googlecode_javaewah_JavaEWAH","actual":"@com_googlecode_javaewah_JavaEWAH//jar","bind": "jar/com/googlecode/javaewah/JavaEWAH"}, + {"artifact":"com.lihaoyi:fansi_2.13:0.5.0","url":"https://repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0/fansi_2.13-0.5.0.jar","name":"com_lihaoyi_fansi_2_13","actual":"@com_lihaoyi_fansi_2_13//jar","bind": "jar/com/lihaoyi/fansi_2_13"}, + {"artifact":"com.lihaoyi:sourcecode_2.13:0.4.2","url":"https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.2/sourcecode_2.13-0.4.2.jar","name":"com_lihaoyi_sourcecode_2_13","actual":"@com_lihaoyi_sourcecode_2_13//jar","bind": "jar/com/lihaoyi/sourcecode_2_13"}, + {"artifact":"com.martiansoftware:nailgun-server:0.9.1","url":"https://repo1.maven.org/maven2/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar","name":"com_martiansoftware_nailgun_server","actual":"@com_martiansoftware_nailgun_server//jar","bind": "jar/com/martiansoftware/nailgun_server"}, + {"artifact":"com.thesamet.scalapb:lenses_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.13/0.11.15/lenses_2.13-0.11.15.jar","name":"com_thesamet_scalapb_lenses_2_13","actual":"@com_thesamet_scalapb_lenses_2_13//jar","bind": "jar/com/thesamet/scalapb/lenses_2_13"}, + {"artifact":"com.thesamet.scalapb:scalapb-runtime_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.13/0.11.15/scalapb-runtime_2.13-0.11.15.jar","name":"com_thesamet_scalapb_scalapb_runtime_2_13","actual":"@com_thesamet_scalapb_scalapb_runtime_2_13//jar","bind": "jar/com/thesamet/scalapb/scalapb_runtime_2_13"}, + {"artifact":"com.typesafe:config:1.4.3","url":"https://repo1.maven.org/maven2/com/typesafe/config/1.4.3/config-1.4.3.jar","name":"com_typesafe_config","actual":"@com_typesafe_config//jar","bind": "jar/com/typesafe/config"}, + {"artifact":"io.get-coursier:interface:1.0.20","url":"https://repo1.maven.org/maven2/io/get-coursier/interface/1.0.20/interface-1.0.20.jar","name":"io_get_coursier_interface","actual":"@io_get_coursier_interface//jar","bind": "jar/io/get_coursier/interface"}, + {"artifact":"io.github.java-diff-utils:java-diff-utils:4.12","url":"https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar","name":"io_github_java_diff_utils_java_diff_utils","actual":"@io_github_java_diff_utils_java_diff_utils//jar","bind": "jar/io/github/java_diff_utils/java_diff_utils"}, + {"artifact":"net.java.dev.jna:jna:5.15.0","url":"https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.15.0/jna-5.15.0.jar","name":"net_java_dev_jna_jna","actual":"@net_java_dev_jna_jna//jar","bind": "jar/net/java/dev/jna/jna"}, + {"artifact":"org.apache.commons:commons-lang3:3.14.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar","name":"org_apache_commons_commons_lang3","actual":"@org_apache_commons_commons_lang3//jar","bind": "jar/org/apache/commons/commons_lang3"}, + {"artifact":"org.apache.commons:commons-text:1.12.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.jar","name":"org_apache_commons_commons_text","actual":"@org_apache_commons_commons_text//jar","bind": "jar/org/apache/commons/commons_text"}, + {"artifact":"org.checkerframework:checker-qual:3.5.0","url":"https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar","name":"org_checkerframework_checker_qual","actual":"@org_checkerframework_checker_qual//jar","bind": "jar/org/checkerframework/checker_qual"}, + {"artifact":"org.eclipse.jgit:org.eclipse.jgit:5.13.3.202401111512-r","url":"https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.13.3.202401111512-r/org.eclipse.jgit-5.13.3.202401111512-r.jar","name":"org_eclipse_jgit_org_eclipse_jgit","actual":"@org_eclipse_jgit_org_eclipse_jgit//jar","bind": "jar/org/eclipse/jgit/org_eclipse_jgit"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j/0.20.1/org.eclipse.lsp4j-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.generator:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.20.1/org.eclipse.lsp4j.generator-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_generator","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_generator//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.20.1/org.eclipse.lsp4j.jsonrpc-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc"}, + {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib/2.28.0/org.eclipse.xtend.lib-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib"}, + {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.28.0/org.eclipse.xtend.lib.macro-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib_macro","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib_macro//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro"}, + {"artifact":"org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.28.0/org.eclipse.xtext.xbase.lib-2.28.0.jar","name":"org_eclipse_xtext_org_eclipse_xtext_xbase_lib","actual":"@org_eclipse_xtext_org_eclipse_xtext_xbase_lib//jar","bind": "jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib"}, + {"artifact":"org.jline:jline:3.26.3","url":"https://repo1.maven.org/maven2/org/jline/jline/3.26.3/jline-3.26.3.jar","name":"org_jline_jline","actual":"@org_jline_jline//jar","bind": "jar/org/jline/jline"}, + {"artifact":"org.jline:jline-native:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-native/3.27.0/jline-native-3.27.0.jar","name":"org_jline_jline_native","actual":"@org_jline_jline_native//jar","bind": "jar/org/jline/jline_native"}, + {"artifact":"org.jline:jline-reader:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-reader/3.27.0/jline-reader-3.27.0.jar","name":"org_jline_jline_reader","actual":"@org_jline_jline_reader//jar","bind": "jar/org/jline/jline_reader"}, + {"artifact":"org.jline:jline-terminal:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal/3.27.0/jline-terminal-3.27.0.jar","name":"org_jline_jline_terminal","actual":"@org_jline_jline_terminal//jar","bind": "jar/org/jline/jline_terminal"}, + {"artifact":"org.jline:jline-terminal-jna:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.27.0/jline-terminal-jna-3.27.0.jar","name":"org_jline_jline_terminal_jna","actual":"@org_jline_jline_terminal_jna//jar","bind": "jar/org/jline/jline_terminal_jna"}, + {"artifact":"org.lz4:lz4-java:1.8.0","url":"https://repo1.maven.org/maven2/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar","name":"org_lz4_lz4_java","actual":"@org_lz4_lz4_java//jar","bind": "jar/org/lz4/lz4_java"}, + {"artifact":"org.scala-lang.modules:scala-asm:9.7.0-scala-2","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.7.0-scala-2/scala-asm-9.7.0-scala-2.jar","name":"org_scala_lang_modules_scala_asm","actual":"@org_scala_lang_modules_scala_asm//jar","bind": "jar/org/scala_lang/modules/scala_asm"}, + {"artifact":"org.scala-lang.modules:scala-collection-compat_2.13:2.12.0","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0/scala-collection-compat_2.13-2.12.0.jar","name":"org_scala_lang_modules_scala_collection_compat_2_13","actual":"@org_scala_lang_modules_scala_collection_compat_2_13//jar","bind": "jar/org/scala_lang/modules/scala_collection_compat_2_13"}, + {"artifact":"org.scala-lang:scala3-compiler_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.6.1/scala3-compiler_3-3.6.1.jar","name":"org_scala_lang_scala3_compiler_3","actual":"@org_scala_lang_scala3_compiler_3//jar","bind": "jar/org/scala_lang/scala3_compiler_3"}, + {"artifact":"org.scala-lang:scala3-interfaces:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.6.1/scala3-interfaces-3.6.1.jar","name":"org_scala_lang_scala3_interfaces","actual":"@org_scala_lang_scala3_interfaces//jar","bind": "jar/org/scala_lang/scala3_interfaces"}, + {"artifact":"org.scala-lang:scala3-presentation-compiler_3:3.5.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-presentation-compiler_3/3.5.1/scala3-presentation-compiler_3-3.5.1.jar","name":"org_scala_lang_scala3_presentation_compiler_3","actual":"@org_scala_lang_scala3_presentation_compiler_3//jar","bind": "jar/org/scala_lang/scala3_presentation_compiler_3"}, + {"artifact":"org.scala-lang:scala-compiler:2.13.15","url":"https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15.jar","name":"org_scala_lang_scala_compiler","actual":"@org_scala_lang_scala_compiler//jar","bind": "jar/org/scala_lang/scala_compiler"}, + {"artifact":"org.scala-lang:scalap:2.13.12","url":"https://repo1.maven.org/maven2/org/scala-lang/scalap/2.13.12/scalap-2.13.12.jar","name":"org_scala_lang_scalap","actual":"@org_scala_lang_scalap//jar","bind": "jar/org/scala_lang/scalap"}, + {"artifact":"org.scala-lang:tasty-core_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.6.1/tasty-core_3-3.6.1.jar","name":"org_scala_lang_tasty_core_3","actual":"@org_scala_lang_tasty_core_3//jar","bind": "jar/org/scala_lang/tasty_core_3"}, + {"artifact":"org.scala-sbt:compiler-interface:1.9.6","url":"https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar","name":"org_scala_sbt_compiler_interface","actual":"@org_scala_sbt_compiler_interface//jar","bind": "jar/org/scala_sbt/compiler_interface"}, + {"artifact":"org.scala-sbt:util-interface:1.9.8","url":"https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar","name":"org_scala_sbt_util_interface","actual":"@org_scala_sbt_util_interface//jar","bind": "jar/org/scala_sbt/util_interface"}, + {"artifact":"org.scalameta:common_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/common_2.13/4.10.1/common_2.13-4.10.1.jar","name":"org_scalameta_common_2_13","actual":"@org_scalameta_common_2_13//jar","bind": "jar/org/scalameta/common_2_13"}, + {"artifact":"org.scalameta:metaconfig-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-core_2.13/0.13.0/metaconfig-core_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_core_2_13","actual":"@org_scalameta_metaconfig_core_2_13//jar","bind": "jar/org/scalameta/metaconfig_core_2_13"}, + {"artifact":"org.scalameta:metaconfig-pprint_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-pprint_2.13/0.13.0/metaconfig-pprint_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_pprint_2_13","actual":"@org_scalameta_metaconfig_pprint_2_13//jar","bind": "jar/org/scalameta/metaconfig_pprint_2_13"}, + {"artifact":"org.scalameta:metaconfig-typesafe-config_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-typesafe-config_2.13/0.13.0/metaconfig-typesafe-config_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_typesafe_config_2_13","actual":"@org_scalameta_metaconfig_typesafe_config_2_13//jar","bind": "jar/org/scalameta/metaconfig_typesafe_config_2_13"}, + {"artifact":"org.scalameta:mtags-interfaces:1.3.2","url":"https://repo1.maven.org/maven2/org/scalameta/mtags-interfaces/1.3.2/mtags-interfaces-1.3.2.jar","name":"org_scalameta_mtags_interfaces","actual":"@org_scalameta_mtags_interfaces//jar","bind": "jar/org/scalameta/mtags_interfaces"}, + {"artifact":"org.scalameta:parsers_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/parsers_2.13/4.10.1/parsers_2.13-4.10.1.jar","name":"org_scalameta_parsers_2_13","actual":"@org_scalameta_parsers_2_13//jar","bind": "jar/org/scalameta/parsers_2_13"}, + {"artifact":"org.scalameta:scalameta_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/scalameta_2.13/4.10.1/scalameta_2.13-4.10.1.jar","name":"org_scalameta_scalameta_2_13","actual":"@org_scalameta_scalameta_2_13//jar","bind": "jar/org/scalameta/scalameta_2_13"}, + {"artifact":"org.scalameta:semanticdb-scalac_2.13.15:4.11.2","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac_2.13.15/4.11.2/semanticdb-scalac_2.13.15-4.11.2.jar","name":"org_scalameta_semanticdb_scalac_2_13_15","actual":"@org_scalameta_semanticdb_scalac_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_2_13_15"}, + {"artifact":"org.scalameta:semanticdb-scalac-core_2.13.15:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac-core_2.13.15/4.10.1/semanticdb-scalac-core_2.13.15-4.10.1.jar","name":"org_scalameta_semanticdb_scalac_core_2_13_15","actual":"@org_scalameta_semanticdb_scalac_core_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_core_2_13_15"}, + {"artifact":"org.scalameta:semanticdb-shared_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-shared_2.13/4.10.1/semanticdb-shared_2.13-4.10.1.jar","name":"org_scalameta_semanticdb_shared_2_13","actual":"@org_scalameta_semanticdb_shared_2_13//jar","bind": "jar/org/scalameta/semanticdb_shared_2_13"}, + {"artifact":"org.scalameta:trees_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/trees_2.13/4.10.1/trees_2.13-4.10.1.jar","name":"org_scalameta_trees_2_13","actual":"@org_scalameta_trees_2_13//jar","bind": "jar/org/scalameta/trees_2_13"}, + {"artifact":"org.slf4j:slf4j-api:1.7.36","url":"https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar","name":"org_slf4j_slf4j_api","actual":"@org_slf4j_slf4j_api//jar","bind": "jar/org/slf4j/slf4j_api"}, + {"artifact":"org.typelevel:paiges-core_2.13:0.4.4","url":"https://repo1.maven.org/maven2/org/typelevel/paiges-core_2.13/0.4.4/paiges-core_2.13-0.4.4.jar","name":"org_typelevel_paiges_core_2_13","actual":"@org_typelevel_paiges_core_2_13//jar","bind": "jar/org/typelevel/paiges_core_2_13"}, + ] + +def maven_dependencies(callback = jar_artifact_callback): + for hash in list_dependencies(): + callback(hash) From 24f4fbe9f730b477c8975c775623fa06f01c0bd8 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Wed, 20 Nov 2024 17:02:02 +0100 Subject: [PATCH 05/16] Dependencies.scala added --- rules/scala/init.bzl | 2 ++ rules/scalafix/BUILD | 13 +++++++++++++ rules/scalafix/Dependencies.scala | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 rules/scalafix/Dependencies.scala diff --git a/rules/scala/init.bzl b/rules/scala/init.bzl index fee24b68..866f173b 100644 --- a/rules/scala/init.bzl +++ b/rules/scala/init.bzl @@ -6,12 +6,14 @@ load("//3rdparty:workspace.bzl", "maven_dependencies") load("//rules/scala_proto/3rdparty:workspace.bzl", maven_dependencies_scala_proto = "maven_dependencies") load("//rules/scalafmt:config.bzl", "scalafmt_default_config") load("//rules/scalafmt/3rdparty:workspace.bzl", maven_dependencies_scalafmt = "maven_dependencies") +load("//rules/scalafix/3rdparty:workspace.bzl", maven_dependencies_scalafix = "maven_dependencies") load("//scala/3rdparty:workspace.bzl", maven_dependencies_scala = "maven_dependencies") def load_maven_dependencies(): maven_dependencies() maven_dependencies_scala_proto() maven_dependencies_scalafmt() + maven_dependencies_scalafix() maven_dependencies_scala() def rules_scala3_init(): diff --git a/rules/scalafix/BUILD b/rules/scalafix/BUILD index 9067afd9..10a3d2e4 100644 --- a/rules/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -1,4 +1,17 @@ load("//rules:scala.bzl", "scala_binary") +load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") + +filegroup( + name = "dependencies", + srcs = ["Dependencies.scala"], + visibility = ["//visibility:public"], +) + +scala_deps( + name = "scala_deps", + src = "//rules/scalafix:dependencies", + dependencies = "rules_scala3.rules.scalafix.Dependencies", +) scala_binary( name = "scalaix", diff --git a/rules/scalafix/Dependencies.scala b/rules/scalafix/Dependencies.scala new file mode 100644 index 00000000..99dcb41b --- /dev/null +++ b/rules/scalafix/Dependencies.scala @@ -0,0 +1,23 @@ +package rules_scala3.rules.scalafix + +import sbt.librarymanagement.syntax.* +import sbt.librarymanagement.{DependencyBuilders, ModuleID, Resolver}, DependencyBuilders.OrganizationArtifactName + +object Dependencies: + + private val jmhV = "1.37" + + val resolvers: Seq[Resolver] = Vector( + "mavencentral".at("https://repo1.maven.org/maven2/") + ) + // Replacements are not handled by `librarymanagement`. any Scala prefix in the name will be dropped. + // It also doesn't matter whether you use double `%` to get the Scala version or not. + val replacements: Map[OrganizationArtifactName, String] = Map( + "org.scala-lang" % "scala3-library" -> "@scala3_library//jar", + "org.scala-lang" % "scala-library" -> "@scala_library_2_13//jar", + "org.scala-lang" % "scala-reflect" -> "@scala_reflect_2_13//jar" + ) + val dependencies: Seq[ModuleID] = Vector( + "ch.epfl.scala" % "scalafix-cli_3.5.1" % "0.13.0", + "org.scalameta" % "semanticdb-scalac_2.13.15" % "4.11.2" + ) From aef0d7d94254b70a633611bdc30d9b527b8639e6 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 14:07:14 +0100 Subject: [PATCH 06/16] .conf file added --- .scalafix.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .scalafix.conf diff --git a/.scalafix.conf b/.scalafix.conf new file mode 100644 index 00000000..cba42689 --- /dev/null +++ b/.scalafix.conf @@ -0,0 +1,18 @@ +rules = [ + RemoveUnused, + DisableSyntax, + NoAutoTupling, + LeakingImplicitClassVal, + NoValInForComprehension, +] + +DisableSyntax.noFinalize = true + +NoInfer.disabledTypes = [ + scala.Any, + scala.AnyVal, + scala.Serializable, + java.io.Serializable, + scala.Product, + scala.Predef.any2stringadd +] From 57460d519fba18bb845c7353155f85ea81ec8000 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 17:03:08 +0100 Subject: [PATCH 07/16] run_scalafix added --- scripts/run_scalafix | 164 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100755 scripts/run_scalafix diff --git a/scripts/run_scalafix b/scripts/run_scalafix new file mode 100755 index 00000000..f56a4d5e --- /dev/null +++ b/scripts/run_scalafix @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +name="$(basename "$0")" + +red='\033[31m' +green='\033[32m' +bold='\033[1m' +nc='\033[0m' + +trap 'exit 130' INT + +usage() { + printf "This script will build the specified targets with the toolchain, and then run +scalafix with the necessary options for each target. Make sure the toolchain +generates semanticdbs and contains the necessary scalac options. + +For targets containing 'scala' attribute, 'global_scalacopts' will be +overridden by the toolchain specified in this attribute. Ensure that the +toolchain specified in 'scala' attribute contains the necessary 'scalacopts'. + +It also filters targets by their kind. Only 'scala_binary', 'scala_library', +'scala_test' and 'scalajs_library' will be build. + +${bold}Usage:${nc} + %s [options] [bazel targets] + +${bold}Example:${nc} + %s -t //:scala_toolchain -o ':--verbose:--config ../.scalafix.conf' //... -- -//exclude:target + +${bold}Options:${nc} + ${bold}-t, --toolchain required.${nc} toolchain with which targets will be built + ${bold}-o, --opts${nc} options passed to scalafix. must be a string starting + with a colon and containing colon-separated options + ${bold}-h, --help${nc} display this help message +" "$name" "$name" + exit +} + +# Parse args +declare -a targets excluded_targets +opts=true + +while [[ $# -gt 0 ]]; do + if $opts; then + case $1 in + -h | --help) + usage + ;; + -t | --toolchain) + toolchain="$2" + shift + shift + ;; + -o | --opts) + scalafix_opts="$2" + shift + shift + ;; + --) + opts=false + shift + ;; + -*) + printf "${red}%s${nc} %s\n%s\n" "Unknown option:" "$1" "Did you forget '--'?" + exit 1 + ;; + *) + targets+=("$1") + shift + ;; + esac + else + case $1 in + -*) + excluded_targets+=("${1#-}") + shift + ;; + *) + targets+=("$1") + shift + ;; + esac + fi +done + +# check required args +if [[ ${#targets[@]} -eq 0 ]]; then + printf "${red}%s${nc}\n" "At least one target is required" + exit 1 +fi +if [[ ! -v toolchain ]]; then + printf "${red}%s${nc}\n" "The '--toolchain' option is required" + exit 1 +fi + +# Filter targets +printf "${green}${bold}%s${nc}\n" "Filtering targets..." +readarray -t filtered_targets < <(bazel query \ + "kind('scala(_binary|_library|_test|js_library)', set(${targets[*]}) except set(${excluded_targets[*]}))" 2>/dev/null) + +# Build targets +build_cmd="bazel build --extra_toolchains='$toolchain' -- ${filtered_targets[*]}" +printf "${green}${bold}%s${nc}\n${green}%s${nc} %s\n" "Building targets..." "Command:" "$build_cmd" + +if ! eval "$build_cmd"; then + printf "${red}%s${nc}\n" "BUILD FAILED, FIX AND TRY AGAIN" + kill -INT $$ +fi + +# Run scalafix +exec_root="$(bazel info execution_root 2>/dev/null)" +toolchain_impl="$( + bazel query "$toolchain" --output=streamed_jsonproto 2>/dev/null | + jq -r '.rule.attribute[] | select(.name=="toolchain" and .explicitlySpecified==true) | .stringValue' +)" +for target in "${filtered_targets[@]}"; do + target_json="$(bazel query "$target" --output=streamed_jsonproto 2>/dev/null)" + + readarray -t files < <( + echo "$target_json" | + jq -r '.rule.attribute[]? | select(.name=="srcs" and .stringListValue!=null) | .stringListValue[]' | + while read -r source; do + printf -- "--files %s\n" "$(bazel query "$source" --output location 2>/dev/null)" + done + ) + + if [[ ${#files[@]} -eq 0 ]]; then + continue + fi + + if echo "$target_json" | + jq -e '.rule.attribute[] | select(.name=="scala" and .explicitlySpecified==true)' >/dev/null; then + actual_toolchain="$(echo "$target_json" | jq -r '.rule.attribute[] | select(.name=="scala") | .stringValue')" + else + actual_toolchain=$toolchain_impl + fi + + readarray -t scalac_opts < <( + # if 'enable_semanticdb = True' toolchain adds this under the hood + if bazel query "$toolchain_impl" --output streamed_jsonproto 2>/dev/null | + jq -e '.rule.attribute[] | select(.name=="enable_semanticdb" and .stringValue=="true")' >/dev/null; then + echo "-Xsemanticdb" + fi + # scalacopts from toolchain + bazel query "$actual_toolchain" --output streamed_jsonproto 2>/dev/null | + jq -r '.rule.attribute[] | select(.name=="global_scalacopts" and .stringListValue!=null) | .stringListValue[]' + # scalacopts passed when defining the target + echo "$target_json" | + jq -r '.rule.attribute[] | select(.name=="scalacopts" and .stringListValue!=null) | .stringListValue[]' + ) + + scala_version="$( + bazel cquery "$target" --output starlark --starlark:expr \ + 'providers(target).get("java").scala_info.toolchain.scala_version' 2>/dev/null + )" + + cs="--classpath $exec_root/$(bazel cquery "$target.jar" --output files 2>/dev/null)" + + sr="--sourceroot $(bazel info workspace 2>/dev/null)" + + scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sr $cs ${scalac_opts[*]/#/--scalac-options } ${files[*]%%:*}" + printf "\n${green}${bold}%s${nc}\n${green}%s${nc} %s\n" "Trying to fix $target" "Command:" "$scalafix_cmd" + eval "$scalafix_cmd" +done From 06016c900ef6cc49a626f53b1c02f7f44cbdfcde Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 22:24:04 +0100 Subject: [PATCH 08/16] some files deleted --- rules/scalafix/run_scalafix.bzl | 0 rules/scalafix/src/ArgsConfig.scala | 43 ----------------------------- rules/scalafix/src/BUILD | 5 ---- rules/scalafix/src/Main.scala | 14 ---------- 4 files changed, 62 deletions(-) delete mode 100644 rules/scalafix/run_scalafix.bzl delete mode 100644 rules/scalafix/src/ArgsConfig.scala delete mode 100644 rules/scalafix/src/BUILD delete mode 100644 rules/scalafix/src/Main.scala diff --git a/rules/scalafix/run_scalafix.bzl b/rules/scalafix/run_scalafix.bzl deleted file mode 100644 index e69de29b..00000000 diff --git a/rules/scalafix/src/ArgsConfig.scala b/rules/scalafix/src/ArgsConfig.scala deleted file mode 100644 index c9871f76..00000000 --- a/rules/scalafix/src/ArgsConfig.scala +++ /dev/null @@ -1,43 +0,0 @@ -package rules_scala3.rules.scalafix.src - -import scopt.OParser - -case class ArgsConfig( - toolchain: Option[String] = None, - scalafixOpts: Option[String] = None, - targets: Seq[String] = Seq.empty, - excludedTargets: Seq[String] = Seq.empty -) - -object ArgsConfig: - private val builder = OParser.builder[ArgsConfig] - import builder.* - - private val parser = OParser.sequence( - programName("scalafix-runner"), - head("scalafix-runner", "1.0"), - - help('h', "help").text("Displays this usage text"), - - opt[String]('t', "toolchain") - .required() - .action((value, config) => config.copy(toolchain = Some(value))) - .text("Required. Specifies the toolchain with which targets will be built"), - - opt[String]('o', "opts") - .action((value, config) => config.copy(scalafixOpts = Some(value))) - .text("Options passed to scalafix as a colon-separated string (e.g., :--verbose:--config)"), - - arg[String]("...") - .unbounded() - .optional() - .action((target, config) => config.copy(targets = config.targets :+ target)) - .text("Specifies the Bazel targets to be included"), - - checkConfig { config => - val (excluded, included) = config.targets.partition(_.startsWith("-")) - Right(config.copy(excludedTargets = excluded.map(_.drop(1)), targets = included)) - } - ) - - def parse(args: Seq[String]): Option[ArgsConfig] = OParser.parse(parser, args, ArgsConfig()) \ No newline at end of file diff --git a/rules/scalafix/src/BUILD b/rules/scalafix/src/BUILD deleted file mode 100644 index 250812f6..00000000 --- a/rules/scalafix/src/BUILD +++ /dev/null @@ -1,5 +0,0 @@ -filegroup( - name = "scalafix", - srcs = glob(["*.scala"]), - visibility = ["//visibility:public"], -) diff --git a/rules/scalafix/src/Main.scala b/rules/scalafix/src/Main.scala deleted file mode 100644 index 94cf544d..00000000 --- a/rules/scalafix/src/Main.scala +++ /dev/null @@ -1,14 +0,0 @@ -package rules_scala3.rules.scalafix.src - -object Main: - def main(args: Array[String]): Unit = - ArgsConfig.parse(args.toIndexedSeq) match - case Some(config) => - println("Parsed Arguments:") - println(s"Toolchain: ${config.toolchain.getOrElse("None")}") - println(s"Scalafix Options: ${config.scalafixOpts.getOrElse("None")}") - println(s"Targets: ${config.targets.mkString(", ")}") - println(s"Excluded Targets: ${config.excludedTargets.mkString(", ")}") - case None => - println("Failed to parse arguments.") - sys.exit(2) From 1228d58b47077f91ecb3f7a916fbc239c665d609 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 22:44:37 +0100 Subject: [PATCH 09/16] scalafix_runner rule added --- rules/scalafix/BUILD | 32 +----- rules/scalafix/scalafix_runner.bzl | 108 +++++++++++++++++++ scripts/run_scalafix | 164 ----------------------------- 3 files changed, 113 insertions(+), 191 deletions(-) create mode 100644 rules/scalafix/scalafix_runner.bzl delete mode 100755 scripts/run_scalafix diff --git a/rules/scalafix/BUILD b/rules/scalafix/BUILD index 10a3d2e4..5dca530e 100644 --- a/rules/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -1,29 +1,7 @@ -load("//rules:scala.bzl", "scala_binary") -load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") +load("//rules/scalafix:scalafix_runner.bzl", "scalafix_runner") -filegroup( - name = "dependencies", - srcs = ["Dependencies.scala"], - visibility = ["//visibility:public"], -) - -scala_deps( - name = "scala_deps", - src = "//rules/scalafix:dependencies", - dependencies = "rules_scala3.rules.scalafix.Dependencies", -) - -scala_binary( - name = "scalaix", - srcs = ["//rules/scalafix/src:scalafix"], - args = [ - "--toolchain=//my/toolchain", - "--opts=:--verbose:--config", - ], - main_class = "rules_scala3.rules.scalafix.src.Main", - scala = "//scala:bootstrap_3", - visibility = ["//visibility:public"], - deps = [ - "@rules_scala3//3rdparty/jvm/com/github/scopt", - ], +scalafix_runner( + name = "run_scalafix", + toolchain = "//:scalafix_toolchain", + targets = ["//deps:deps"], ) diff --git a/rules/scalafix/scalafix_runner.bzl b/rules/scalafix/scalafix_runner.bzl new file mode 100644 index 00000000..1f072825 --- /dev/null +++ b/rules/scalafix/scalafix_runner.bzl @@ -0,0 +1,108 @@ +def _scalafix_runner_impl(ctx): + + toolchain = ctx.attr.toolchain.label + scalafix_opts = ctx.attr.opts or "" + + targets = " ".join(['"%s"' % t.label for t in ctx.attr.targets]) + excluded_targets = " ".join(['"%s"' % ("-" + et.label) for et in ctx.attr.excluded_targets]) + + script_content = """#!/usr/bin/env bash + +set -e + +workspace="$BUILD_WORKSPACE_DIRECTORY" + +cd "$workspace" + +toolchain="%s" +scalafix_opts="%s" + +targets=(%s) +excluded_targets=(%s) + +# Filter targets +echo "Targets: ${targets[*]}" +echo "Excluded Targets: ${excluded_targets[*]}" +filtered_targets=$( + bazel query \\ + "kind('scala(_binary|_library|_test|js_library)', set(${targets[@]}) except set(${excluded_targets[@]}))" \\ + 2>/dev/null +) + +if [[ -z "$filtered_targets" ]]; then + echo "No matching targets found." + exit 0 +fi + +# Build targets +echo "Building targets..." +bazel build --extra_toolchains="$toolchain" -- $filtered_targets + +# Run scalafix +exec_root=$(bazel info execution_root 2>/dev/null) +for target in $filtered_targets; do + echo "Running scalafix for $target..." + files=$( + bazel query "$target" --output=streamed_jsonproto 2>/dev/null | \\ + jq -r '.rule.attribute[]? | select(.name=="srcs" and .stringListValue!=null) | .stringListValue[]' + ) + + if [[ -z "$files" ]]; then + continue + fi + + # Get the source files for the target + files=$( + bazel query "kind('source file', deps($target))" --output=label 2>/dev/null | \ + sed 's|^//|./|' | sed 's|:|/|' + ) + + if [[ -z "$files" ]]; then + echo "No source files found for $target" + continue + fi + + scalac_opts=$( + bazel query "$toolchain" --output=streamed_jsonproto 2>/dev/null | \ + jq -r '.rule.attribute[] | select(.name=="global_scalacopts" and .stringListValue!=null) | .stringListValue[]' + ) + + required_options="-Wunused:all" + if [[ "$scalac_opts" != *"$required_options"* ]]; then + scalac_opts="$scalac_opts $required_options" + fi + + scala_version=$( + bazel cquery "$target" --output=starlark --starlark:expr \\ + 'providers(target).get("java").scala_info.toolchain.scala_version' 2>/dev/null + ) + + classpath="--classpath $exec_root/$(bazel cquery "$target.jar" --output files 2>/dev/null)" + sourceroot="--sourceroot $workspace" + + scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sourceroot $classpath ${scalac_opts[*]/#/--scalac-options } $files" + echo "$scalafix_cmd" + eval "$scalafix_cmd" +done +""" % (toolchain, scalafix_opts, targets, excluded_targets) + + # Write the script to an output file + script_file = ctx.actions.declare_file("run_scalafix.sh") + ctx.actions.write(script_file, script_content) + + # Return the script file as an executable output + return DefaultInfo( + executable=script_file, + files=depset([script_file]), + ) + +scalafix_runner = rule( + implementation=_scalafix_runner_impl, + attrs={ + "toolchain": attr.label(mandatory=True), + "opts": attr.string(default=":--verbose:--config .scalafix.conf"), + "targets": attr.label_list(mandatory=True, allow_files=False), + "excluded_targets": attr.label_list(default=[], allow_files=False), + }, + executable=True, # Mark this rule as producing an executable +) diff --git a/scripts/run_scalafix b/scripts/run_scalafix deleted file mode 100755 index f56a4d5e..00000000 --- a/scripts/run_scalafix +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -name="$(basename "$0")" - -red='\033[31m' -green='\033[32m' -bold='\033[1m' -nc='\033[0m' - -trap 'exit 130' INT - -usage() { - printf "This script will build the specified targets with the toolchain, and then run -scalafix with the necessary options for each target. Make sure the toolchain -generates semanticdbs and contains the necessary scalac options. - -For targets containing 'scala' attribute, 'global_scalacopts' will be -overridden by the toolchain specified in this attribute. Ensure that the -toolchain specified in 'scala' attribute contains the necessary 'scalacopts'. - -It also filters targets by their kind. Only 'scala_binary', 'scala_library', -'scala_test' and 'scalajs_library' will be build. - -${bold}Usage:${nc} - %s [options] [bazel targets] - -${bold}Example:${nc} - %s -t //:scala_toolchain -o ':--verbose:--config ../.scalafix.conf' //... -- -//exclude:target - -${bold}Options:${nc} - ${bold}-t, --toolchain required.${nc} toolchain with which targets will be built - ${bold}-o, --opts${nc} options passed to scalafix. must be a string starting - with a colon and containing colon-separated options - ${bold}-h, --help${nc} display this help message -" "$name" "$name" - exit -} - -# Parse args -declare -a targets excluded_targets -opts=true - -while [[ $# -gt 0 ]]; do - if $opts; then - case $1 in - -h | --help) - usage - ;; - -t | --toolchain) - toolchain="$2" - shift - shift - ;; - -o | --opts) - scalafix_opts="$2" - shift - shift - ;; - --) - opts=false - shift - ;; - -*) - printf "${red}%s${nc} %s\n%s\n" "Unknown option:" "$1" "Did you forget '--'?" - exit 1 - ;; - *) - targets+=("$1") - shift - ;; - esac - else - case $1 in - -*) - excluded_targets+=("${1#-}") - shift - ;; - *) - targets+=("$1") - shift - ;; - esac - fi -done - -# check required args -if [[ ${#targets[@]} -eq 0 ]]; then - printf "${red}%s${nc}\n" "At least one target is required" - exit 1 -fi -if [[ ! -v toolchain ]]; then - printf "${red}%s${nc}\n" "The '--toolchain' option is required" - exit 1 -fi - -# Filter targets -printf "${green}${bold}%s${nc}\n" "Filtering targets..." -readarray -t filtered_targets < <(bazel query \ - "kind('scala(_binary|_library|_test|js_library)', set(${targets[*]}) except set(${excluded_targets[*]}))" 2>/dev/null) - -# Build targets -build_cmd="bazel build --extra_toolchains='$toolchain' -- ${filtered_targets[*]}" -printf "${green}${bold}%s${nc}\n${green}%s${nc} %s\n" "Building targets..." "Command:" "$build_cmd" - -if ! eval "$build_cmd"; then - printf "${red}%s${nc}\n" "BUILD FAILED, FIX AND TRY AGAIN" - kill -INT $$ -fi - -# Run scalafix -exec_root="$(bazel info execution_root 2>/dev/null)" -toolchain_impl="$( - bazel query "$toolchain" --output=streamed_jsonproto 2>/dev/null | - jq -r '.rule.attribute[] | select(.name=="toolchain" and .explicitlySpecified==true) | .stringValue' -)" -for target in "${filtered_targets[@]}"; do - target_json="$(bazel query "$target" --output=streamed_jsonproto 2>/dev/null)" - - readarray -t files < <( - echo "$target_json" | - jq -r '.rule.attribute[]? | select(.name=="srcs" and .stringListValue!=null) | .stringListValue[]' | - while read -r source; do - printf -- "--files %s\n" "$(bazel query "$source" --output location 2>/dev/null)" - done - ) - - if [[ ${#files[@]} -eq 0 ]]; then - continue - fi - - if echo "$target_json" | - jq -e '.rule.attribute[] | select(.name=="scala" and .explicitlySpecified==true)' >/dev/null; then - actual_toolchain="$(echo "$target_json" | jq -r '.rule.attribute[] | select(.name=="scala") | .stringValue')" - else - actual_toolchain=$toolchain_impl - fi - - readarray -t scalac_opts < <( - # if 'enable_semanticdb = True' toolchain adds this under the hood - if bazel query "$toolchain_impl" --output streamed_jsonproto 2>/dev/null | - jq -e '.rule.attribute[] | select(.name=="enable_semanticdb" and .stringValue=="true")' >/dev/null; then - echo "-Xsemanticdb" - fi - # scalacopts from toolchain - bazel query "$actual_toolchain" --output streamed_jsonproto 2>/dev/null | - jq -r '.rule.attribute[] | select(.name=="global_scalacopts" and .stringListValue!=null) | .stringListValue[]' - # scalacopts passed when defining the target - echo "$target_json" | - jq -r '.rule.attribute[] | select(.name=="scalacopts" and .stringListValue!=null) | .stringListValue[]' - ) - - scala_version="$( - bazel cquery "$target" --output starlark --starlark:expr \ - 'providers(target).get("java").scala_info.toolchain.scala_version' 2>/dev/null - )" - - cs="--classpath $exec_root/$(bazel cquery "$target.jar" --output files 2>/dev/null)" - - sr="--sourceroot $(bazel info workspace 2>/dev/null)" - - scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sr $cs ${scalac_opts[*]/#/--scalac-options } ${files[*]%%:*}" - printf "\n${green}${bold}%s${nc}\n${green}%s${nc} %s\n" "Trying to fix $target" "Command:" "$scalafix_cmd" - eval "$scalafix_cmd" -done From 5ceac73c68aec2f384805c36ae5a66e44823e036 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 22:47:24 +0100 Subject: [PATCH 10/16] toolchain added --- BUILD | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index e6953b70..4b041212 100644 --- a/BUILD +++ b/BUILD @@ -1,5 +1,7 @@ load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") load("@rules_scala3//rules:scala.bzl", "configure_zinc_scala") +load("@rules_scala3//scala3:toolchain.bzl", "scala_toolchain") +load('//scala3:repositories.bzl', _default_scalacopts = 'GLOBAL_SCALACOPTS') filegroup( name = "dependencies", @@ -25,11 +27,38 @@ compiler_classpath_3 = runtime_classpath_3 + [ "@scala_asm//jar", ] +scala_version = "3.6.2-RC1" + +scalac_scalafix_opts = [ + "-Wunused:all", + "-Ywarn-unused", + "-Xsemanticdb" +] + configure_zinc_scala( name = "zinc_3", compiler_bridge = "@scala3_sbt_bridge//jar", compiler_classpath = compiler_classpath_3, runtime_classpath = runtime_classpath_3, - version = "3.6.1", + version = scala_version, + visibility = ["//visibility:public"], +) + +scala_toolchain( + name = "scalafix_toolchain_impl", + compiler_bridge = "@scala3_sbt_bridge//jar", + compiler_classpath = compiler_classpath_3, + enable_semanticdb = True, + global_scalacopts = _default_scalacopts + scalac_scalafix_opts, + runtime_classpath = runtime_classpath_3, + scala_version = scala_version, + semanticdb_bundle_in_jar = True, +) + +toolchain( + name = "scalafix_toolchain", + toolchain = ":scalafix_toolchain_impl", + toolchain_type = "//scala3:toolchain_type", visibility = ["//visibility:public"], ) + From d9718afc21860cd2d7ebaa6f0c26d1ba992385ef Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Sat, 23 Nov 2024 23:51:12 +0100 Subject: [PATCH 11/16] scalafix_runner.bzl modified --- rules/scalafix/scalafix_runner.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/scalafix/scalafix_runner.bzl b/rules/scalafix/scalafix_runner.bzl index 1f072825..35664665 100644 --- a/rules/scalafix/scalafix_runner.bzl +++ b/rules/scalafix/scalafix_runner.bzl @@ -104,5 +104,5 @@ scalafix_runner = rule( "targets": attr.label_list(mandatory=True, allow_files=False), "excluded_targets": attr.label_list(default=[], allow_files=False), }, - executable=True, # Mark this rule as producing an executable + executable=True, ) From 38d5e78aa71b2f1fedfcacd14200338c2256d979 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Tue, 26 Nov 2024 17:18:14 +0100 Subject: [PATCH 12/16] script embedded --- rules/scalafix/BUILD | 15 ++- rules/scalafix/scalafix_runner.bzl | 162 ++++++++++++++++------------- 2 files changed, 102 insertions(+), 75 deletions(-) diff --git a/rules/scalafix/BUILD b/rules/scalafix/BUILD index 5dca530e..334b6745 100644 --- a/rules/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -1,7 +1,20 @@ load("//rules/scalafix:scalafix_runner.bzl", "scalafix_runner") +load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") + +filegroup( + name = "dependencies", + srcs = ["Dependencies.scala"], + visibility = ["//visibility:public"], +) + +scala_deps( + name = "scala_deps", + src = "//rules/scalafix:dependencies", + dependencies = "rules_scala3.rules.scalafix.Dependencies", +) scalafix_runner( name = "run_scalafix", toolchain = "//:scalafix_toolchain", targets = ["//deps:deps"], -) +) \ No newline at end of file diff --git a/rules/scalafix/scalafix_runner.bzl b/rules/scalafix/scalafix_runner.bzl index 35664665..f78c7fcc 100644 --- a/rules/scalafix/scalafix_runner.bzl +++ b/rules/scalafix/scalafix_runner.bzl @@ -1,90 +1,104 @@ def _scalafix_runner_impl(ctx): - - toolchain = ctx.attr.toolchain.label - scalafix_opts = ctx.attr.opts or "" - - targets = " ".join(['"%s"' % t.label for t in ctx.attr.targets]) - excluded_targets = " ".join(['"%s"' % ("-" + et.label) for et in ctx.attr.excluded_targets]) - + # Dynamically generate the script content script_content = """#!/usr/bin/env bash -set -e - +# Navigate to the Bazel workspace workspace="$BUILD_WORKSPACE_DIRECTORY" - cd "$workspace" -toolchain="%s" -scalafix_opts="%s" - -targets=(%s) -excluded_targets=(%s) +# Variables +toolchain="{toolchain}" +opts="{opts}" +targets=({targets}) +excluded_targets=({excluded_targets}) # Filter targets -echo "Targets: ${targets[*]}" -echo "Excluded Targets: ${excluded_targets[*]}" -filtered_targets=$( - bazel query \\ - "kind('scala(_binary|_library|_test|js_library)', set(${targets[@]}) except set(${excluded_targets[@]}))" \\ - 2>/dev/null -) +echo "Filtering targets..." +readarray -t filtered_targets < <(bazel query \ + "kind('scala(_binary|_library|_test|js_library)', set(${targets[*]}) except set(${excluded_targets[*]}))" --output=label 2>/dev/null) -if [[ -z "$filtered_targets" ]]; then - echo "No matching targets found." - exit 0 +if [[ ${#filtered_targets[@]} -eq 0 ]]; then + echo "No valid targets found to build." + exit 1 fi +# Debug filtered targets +echo "Filtered targets: ${filtered_targets[@]}" + # Build targets +build_cmd="bazel build --extra_toolchains='$toolchain' -- ${filtered_targets[@]}" echo "Building targets..." -bazel build --extra_toolchains="$toolchain" -- $filtered_targets +echo "Command: $build_cmd" +if ! eval "$build_cmd"; then + echo "BUILD FAILED, FIX AND TRY AGAIN" + kill -INT $$ +fi # Run scalafix -exec_root=$(bazel info execution_root 2>/dev/null) -for target in $filtered_targets; do - echo "Running scalafix for $target..." - files=$( - bazel query "$target" --output=streamed_jsonproto 2>/dev/null | \\ - jq -r '.rule.attribute[]? | select(.name=="srcs" and .stringListValue!=null) | .stringListValue[]' - ) - - if [[ -z "$files" ]]; then - continue - fi - - # Get the source files for the target - files=$( - bazel query "kind('source file', deps($target))" --output=label 2>/dev/null | \ - sed 's|^//|./|' | sed 's|:|/|' - ) - - if [[ -z "$files" ]]; then - echo "No source files found for $target" - continue - fi - - scalac_opts=$( - bazel query "$toolchain" --output=streamed_jsonproto 2>/dev/null | \ - jq -r '.rule.attribute[] | select(.name=="global_scalacopts" and .stringListValue!=null) | .stringListValue[]' - ) - - required_options="-Wunused:all" - if [[ "$scalac_opts" != *"$required_options"* ]]; then - scalac_opts="$scalac_opts $required_options" - fi - - scala_version=$( - bazel cquery "$target" --output=starlark --starlark:expr \\ - 'providers(target).get("java").scala_info.toolchain.scala_version' 2>/dev/null - ) - - classpath="--classpath $exec_root/$(bazel cquery "$target.jar" --output files 2>/dev/null)" - sourceroot="--sourceroot $workspace" - - scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sourceroot $classpath ${scalac_opts[*]/#/--scalac-options } $files" - echo "$scalafix_cmd" - eval "$scalafix_cmd" +exec_root="$(bazel info execution_root 2>/dev/null)" +toolchain_impl="$( + bazel query "$toolchain" --output=streamed_jsonproto 2>/dev/null | + jq -r '.rule.attribute[] | select(.name=="toolchain" and .explicitlySpecified==true) | .stringValue' +)" +for target in "${filtered_targets[@]}"; do + target_json="$(bazel query "$target" --output=streamed_jsonproto 2>/dev/null)" + + readarray -t files < <( + echo "$target_json" | + jq -r '.rule.attribute[]? | select(.name=="srcs" and .stringListValue!=null) | .stringListValue[]' | + while read -r source; do + printf -- "--files %s\n" "$(bazel query "$source" --output location 2>/dev/null)" + done + ) + + if [[ ${#files[@]} -eq 0 ]]; then + continue + fi + + if echo "$target_json" | + jq -e '.rule.attribute[] | select(.name=="scala" and .explicitlySpecified==true)' >/dev/null; then + actual_toolchain="$(echo "$target_json" | jq -r '.rule.attribute[] | select(.name=="scala") | .stringValue')" + else + actual_toolchain=$toolchain_impl + fi + + readarray -t scalac_opts < <( + # if 'enable_semanticdb = True' toolchain adds this under the hood + if bazel query "$toolchain_impl" --output streamed_jsonproto 2>/dev/null | + jq -e '.rule.attribute[] | select(.name=="enable_semanticdb" and .stringValue=="true")' >/dev/null; then + echo "-Xsemanticdb" + fi + # scalacopts from toolchain + bazel query "$actual_toolchain" --output streamed_jsonproto 2>/dev/null | + jq -r '.rule.attribute[] | select(.name=="global_scalacopts" and .stringListValue!=null) | .stringListValue[]' + # scalacopts passed when defining the target + echo "$target_json" | + jq -r '.rule.attribute[] | select(.name=="scalacopts" and .stringListValue!=null) | .stringListValue[]' + ) + + scala_version="$( + bazel cquery "$target" --output starlark --starlark:expr \ + 'providers(target).get("java").scala_info.toolchain.scala_version' 2>/dev/null + )" + + cs="--classpath $exec_root/$(bazel cquery "$target.jar" --output files 2>/dev/null)" + + sr="--sourceroot $(bazel info workspace 2>/dev/null)" + + scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sr $cs ${scalac_opts[*]/#/--scalac-options } ${files[*]%%:*}" + echo "\nTrying to fix $target" + echo "Command: $scalafix_cmd" + eval "$scalafix_cmd" done -""" % (toolchain, scalafix_opts, targets, excluded_targets) +""".replace( + "{toolchain}", str(ctx.attr.toolchain.label) + ).replace( + "{opts}", ctx.attr.opts + ).replace( + "{targets}", " ".join(['"%s"' % t for t in ctx.attr.targets]) + ).replace( + "{excluded_targets}", " ".join(['"%s"' % t for t in ctx.attr.excluded_targets]) + ) # Write the script to an output file script_file = ctx.actions.declare_file("run_scalafix.sh") @@ -100,9 +114,9 @@ scalafix_runner = rule( implementation=_scalafix_runner_impl, attrs={ "toolchain": attr.label(mandatory=True), - "opts": attr.string(default=":--verbose:--config .scalafix.conf"), - "targets": attr.label_list(mandatory=True, allow_files=False), - "excluded_targets": attr.label_list(default=[], allow_files=False), + "opts": attr.string(default="--verbose --config .scalafix.conf"), + "targets": attr.string_list(mandatory=True), # String list for patterns + "excluded_targets": attr.string_list(default=[]), }, executable=True, ) From a6e912439f8030c2aaaf438728d867a3ffd44c42 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Wed, 27 Nov 2024 00:31:10 +0100 Subject: [PATCH 13/16] runner moved --- BUILD | 7 + rules/scala/init.bzl | 2 - rules/scalafix/3rdparty/BUILD | 0 .../scalafix/3rdparty/jvm/ch/epfl/scala/BUILD | 83 --------- .../jvm/com/google/code/findbugs/BUILD | 10 -- .../3rdparty/jvm/com/google/code/gson/BUILD | 10 -- .../3rdparty/jvm/com/google/errorprone/BUILD | 10 -- .../3rdparty/jvm/com/google/guava/BUILD | 38 ----- .../3rdparty/jvm/com/google/j2objc/BUILD | 10 -- .../3rdparty/jvm/com/google/protobuf/BUILD | 10 -- .../jvm/com/googlecode/java_diff_utils/BUILD | 10 -- .../jvm/com/googlecode/javaewah/BUILD | 10 -- rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD | 27 --- .../3rdparty/jvm/com/martiansoftware/BUILD | 10 -- .../3rdparty/jvm/com/thesamet/scalapb/BUILD | 30 ---- .../scalafix/3rdparty/jvm/com/typesafe/BUILD | 10 -- .../3rdparty/jvm/io/get_coursier/BUILD | 13 -- .../jvm/io/github/java_diff_utils/BUILD | 10 -- .../3rdparty/jvm/net/java/dev/jna/BUILD | 10 -- .../3rdparty/jvm/org/apache/commons/BUILD | 23 --- .../3rdparty/jvm/org/checkerframework/BUILD | 10 -- .../3rdparty/jvm/org/eclipse/jgit/BUILD | 14 -- .../3rdparty/jvm/org/eclipse/lsp4j/BUILD | 41 ----- .../3rdparty/jvm/org/eclipse/xtend/BUILD | 27 --- .../3rdparty/jvm/org/eclipse/xtext/BUILD | 13 -- rules/scalafix/3rdparty/jvm/org/jline/BUILD | 60 ------- rules/scalafix/3rdparty/jvm/org/lz4/BUILD | 10 -- .../3rdparty/jvm/org/scala_lang/BUILD | 121 -------------- .../3rdparty/jvm/org/scala_lang/modules/BUILD | 23 --- .../scalafix/3rdparty/jvm/org/scala_sbt/BUILD | 23 --- .../scalafix/3rdparty/jvm/org/scalameta/BUILD | 158 ------------------ rules/scalafix/3rdparty/jvm/org/slf4j/BUILD | 10 -- .../scalafix/3rdparty/jvm/org/typelevel/BUILD | 13 -- rules/scalafix/3rdparty/workspace.bzl | 109 ------------ rules/scalafix/BUILD | 20 --- rules/scalafix/Dependencies.scala | 23 --- rules/scalafix/scalafix_runner.bzl | 4 - scala/BUILD | 2 +- 38 files changed, 8 insertions(+), 1006 deletions(-) delete mode 100644 rules/scalafix/3rdparty/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/guava/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/com/typesafe/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/jline/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/lz4/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/scalameta/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/slf4j/BUILD delete mode 100644 rules/scalafix/3rdparty/jvm/org/typelevel/BUILD delete mode 100644 rules/scalafix/3rdparty/workspace.bzl delete mode 100644 rules/scalafix/Dependencies.scala diff --git a/BUILD b/BUILD index 4b041212..b3d98dc7 100644 --- a/BUILD +++ b/BUILD @@ -1,6 +1,7 @@ load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") load("@rules_scala3//rules:scala.bzl", "configure_zinc_scala") load("@rules_scala3//scala3:toolchain.bzl", "scala_toolchain") +load("@rules_scala3//rules/scalafix:scalafix_runner.bzl", "scalafix_runner") load('//scala3:repositories.bzl', _default_scalacopts = 'GLOBAL_SCALACOPTS') filegroup( @@ -15,6 +16,12 @@ scala_deps( dependencies = "rules_scala3.Dependencies", ) +scalafix_runner( + name = "run_scalafix", + toolchain = "//:scalafix_toolchain", + targets = ["//..."], +) + runtime_classpath_3 = [ "@scala3_library//jar", "@scala_library_2_13//jar", diff --git a/rules/scala/init.bzl b/rules/scala/init.bzl index 866f173b..fee24b68 100644 --- a/rules/scala/init.bzl +++ b/rules/scala/init.bzl @@ -6,14 +6,12 @@ load("//3rdparty:workspace.bzl", "maven_dependencies") load("//rules/scala_proto/3rdparty:workspace.bzl", maven_dependencies_scala_proto = "maven_dependencies") load("//rules/scalafmt:config.bzl", "scalafmt_default_config") load("//rules/scalafmt/3rdparty:workspace.bzl", maven_dependencies_scalafmt = "maven_dependencies") -load("//rules/scalafix/3rdparty:workspace.bzl", maven_dependencies_scalafix = "maven_dependencies") load("//scala/3rdparty:workspace.bzl", maven_dependencies_scala = "maven_dependencies") def load_maven_dependencies(): maven_dependencies() maven_dependencies_scala_proto() maven_dependencies_scalafmt() - maven_dependencies_scalafix() maven_dependencies_scala() def rules_scala3_init(): diff --git a/rules/scalafix/3rdparty/BUILD b/rules/scalafix/3rdparty/BUILD deleted file mode 100644 index e69de29b..00000000 diff --git a/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD b/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD deleted file mode 100644 index a39d1820..00000000 --- a/rules/scalafix/3rdparty/jvm/ch/epfl/scala/BUILD +++ /dev/null @@ -1,83 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "scalafix_cli", - jars = [ - "//external:jar/ch/epfl/scala/scalafix_cli_3_5_1" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/martiansoftware:nailgun_server", - "//rules/scalafix/3rdparty/jvm/org/apache/commons:commons_text", - "//rules/scalafix/3rdparty/jvm/org/eclipse/jgit:org_eclipse_jgit", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_library", - ":scalafix_interfaces", - ":scalafix_reflect", - ":scalafix_rules" - ], - visibility = [ - "//visibility:public" - ] -) - -scala_import( - name = "scalafix_core", - jars = [ - "//external:jar/ch/epfl/scala/scalafix_core_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils:diffutils", - "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - "//rules/scalafix/3rdparty/jvm/org/scalameta:metaconfig_typesafe_config", - "//rules/scalafix/3rdparty/jvm/org/scalameta:scalameta", - "//rules/scalafix/3rdparty/jvm/org/scalameta:semanticdb_shared" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "scalafix_interfaces", - jars = [ - "//external:jar/ch/epfl/scala/scalafix_interfaces" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scalafix_reflect", - jars = [ - "//external:jar/ch/epfl/scala/scalafix_reflect_2_13_15" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect", - "//rules/scalafix/3rdparty/jvm/org/scalameta:semanticdb_scalac_core", - ":scalafix_core" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scalafix_rules", - jars = [ - "//external:jar/ch/epfl/scala/scalafix_rules_3_5_1" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_library", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala3_presentation_compiler", - ":scalafix_core" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD b/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD deleted file mode 100644 index 5e83ab97..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/code/findbugs/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "jsr305", - jars = [ - "//external:jar/com/google/code/findbugs/jsr305" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD b/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD deleted file mode 100644 index 0d1be6e9..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/code/gson/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "gson", - jars = [ - "//external:jar/com/google/code/gson/gson" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD b/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD deleted file mode 100644 index 4305f7f3..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/errorprone/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "error_prone_annotations", - jars = [ - "//external:jar/com/google/errorprone/error_prone_annotations" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD b/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD deleted file mode 100644 index 99daf8d2..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/guava/BUILD +++ /dev/null @@ -1,38 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "failureaccess", - jars = [ - "//external:jar/com/google/guava/failureaccess" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "guava", - jars = [ - "//external:jar/com/google/guava/guava" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/google/code/findbugs:jsr305", - "//rules/scalafix/3rdparty/jvm/com/google/errorprone:error_prone_annotations", - "//rules/scalafix/3rdparty/jvm/com/google/j2objc:j2objc_annotations", - "//rules/scalafix/3rdparty/jvm/org/checkerframework:checker_qual", - ":failureaccess", - ":listenablefuture" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "listenablefuture", - jars = [ - "//external:jar/com/google/guava/listenablefuture" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD b/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD deleted file mode 100644 index 0f31bab7..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/j2objc/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "j2objc_annotations", - jars = [ - "//external:jar/com/google/j2objc/j2objc_annotations" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD b/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD deleted file mode 100644 index d765b3d2..00000000 --- a/rules/scalafix/3rdparty/jvm/com/google/protobuf/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "protobuf_java", - jars = [ - "//external:jar/com/google/protobuf/protobuf_java" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD b/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD deleted file mode 100644 index c81eb08f..00000000 --- a/rules/scalafix/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "diffutils", - jars = [ - "//external:jar/com/googlecode/java_diff_utils/diffutils" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD b/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD deleted file mode 100644 index ff9e55c2..00000000 --- a/rules/scalafix/3rdparty/jvm/com/googlecode/javaewah/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "JavaEWAH", - jars = [ - "//external:jar/com/googlecode/javaewah/JavaEWAH" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD b/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD deleted file mode 100644 index f88aca27..00000000 --- a/rules/scalafix/3rdparty/jvm/com/lihaoyi/BUILD +++ /dev/null @@ -1,27 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "fansi", - jars = [ - "//external:jar/com/lihaoyi/fansi_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":sourcecode" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "sourcecode", - jars = [ - "//external:jar/com/lihaoyi/sourcecode_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD b/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD deleted file mode 100644 index e0dd1452..00000000 --- a/rules/scalafix/3rdparty/jvm/com/martiansoftware/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "nailgun_server", - jars = [ - "//external:jar/com/martiansoftware/nailgun_server" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD b/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD deleted file mode 100644 index 3849d4c3..00000000 --- a/rules/scalafix/3rdparty/jvm/com/thesamet/scalapb/BUILD +++ /dev/null @@ -1,30 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "lenses", - jars = [ - "//external:jar/com/thesamet/scalapb/lenses_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scalapb_runtime", - jars = [ - "//external:jar/com/thesamet/scalapb/scalapb_runtime_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/google/protobuf:protobuf_java", - "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":lenses" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD b/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD deleted file mode 100644 index 06483592..00000000 --- a/rules/scalafix/3rdparty/jvm/com/typesafe/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "config", - jars = [ - "//external:jar/com/typesafe/config" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD b/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD deleted file mode 100644 index 079565d0..00000000 --- a/rules/scalafix/3rdparty/jvm/io/get_coursier/BUILD +++ /dev/null @@ -1,13 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "interface", - jars = [ - "//external:jar/io/get_coursier/interface" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/slf4j:slf4j_api" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD b/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD deleted file mode 100644 index 41c4afc4..00000000 --- a/rules/scalafix/3rdparty/jvm/io/github/java_diff_utils/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "java_diff_utils", - jars = [ - "//external:jar/io/github/java_diff_utils/java_diff_utils" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD b/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD deleted file mode 100644 index ffe56fc6..00000000 --- a/rules/scalafix/3rdparty/jvm/net/java/dev/jna/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "jna", - jars = [ - "//external:jar/net/java/dev/jna/jna" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD b/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD deleted file mode 100644 index ccb76b0c..00000000 --- a/rules/scalafix/3rdparty/jvm/org/apache/commons/BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "commons_lang3", - jars = [ - "//external:jar/org/apache/commons/commons_lang3" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "commons_text", - jars = [ - "//external:jar/org/apache/commons/commons_text" - ], - runtime_deps = [ - ":commons_lang3" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD b/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD deleted file mode 100644 index 32ea9d4e..00000000 --- a/rules/scalafix/3rdparty/jvm/org/checkerframework/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "checker_qual", - jars = [ - "//external:jar/org/checkerframework/checker_qual" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD deleted file mode 100644 index a8fd2d5b..00000000 --- a/rules/scalafix/3rdparty/jvm/org/eclipse/jgit/BUILD +++ /dev/null @@ -1,14 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "org_eclipse_jgit", - jars = [ - "//external:jar/org/eclipse/jgit/org_eclipse_jgit" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/googlecode/javaewah:JavaEWAH", - "//rules/scalafix/3rdparty/jvm/org/slf4j:slf4j_api" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD deleted file mode 100644 index 28f70938..00000000 --- a/rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j/BUILD +++ /dev/null @@ -1,41 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "org_eclipse_lsp4j", - jars = [ - "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j" - ], - runtime_deps = [ - ":org_eclipse_lsp4j_generator", - ":org_eclipse_lsp4j_jsonrpc" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "org_eclipse_lsp4j_generator", - jars = [ - "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/eclipse/xtend:org_eclipse_xtend_lib", - ":org_eclipse_lsp4j_jsonrpc" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "org_eclipse_lsp4j_jsonrpc", - jars = [ - "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/google/code/gson:gson" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD deleted file mode 100644 index c98b1c4a..00000000 --- a/rules/scalafix/3rdparty/jvm/org/eclipse/xtend/BUILD +++ /dev/null @@ -1,27 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "org_eclipse_xtend_lib", - jars = [ - "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib", - ":org_eclipse_xtend_lib_macro" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "org_eclipse_xtend_lib_macro", - jars = [ - "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD b/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD deleted file mode 100644 index 906fe86a..00000000 --- a/rules/scalafix/3rdparty/jvm/org/eclipse/xtext/BUILD +++ /dev/null @@ -1,13 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "org_eclipse_xtext_xbase_lib", - jars = [ - "//external:jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/google/guava:guava" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/jline/BUILD b/rules/scalafix/3rdparty/jvm/org/jline/BUILD deleted file mode 100644 index 22b82e28..00000000 --- a/rules/scalafix/3rdparty/jvm/org/jline/BUILD +++ /dev/null @@ -1,60 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "jline", - jars = [ - "//external:jar/org/jline/jline" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "jline_native", - jars = [ - "//external:jar/org/jline/jline_native" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "jline_reader", - jars = [ - "//external:jar/org/jline/jline_reader" - ], - runtime_deps = [ - ":jline_terminal" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "jline_terminal", - jars = [ - "//external:jar/org/jline/jline_terminal" - ], - runtime_deps = [ - ":jline_native" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "jline_terminal_jna", - jars = [ - "//external:jar/org/jline/jline_terminal_jna" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/net/java/dev/jna:jna", - ":jline_terminal" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/lz4/BUILD b/rules/scalafix/3rdparty/jvm/org/lz4/BUILD deleted file mode 100644 index 636ee71d..00000000 --- a/rules/scalafix/3rdparty/jvm/org/lz4/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "lz4_java", - jars = [ - "//external:jar/org/lz4/lz4_java" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD deleted file mode 100644 index 99c008fe..00000000 --- a/rules/scalafix/3rdparty/jvm/org/scala_lang/BUILD +++ /dev/null @@ -1,121 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "scala3_compiler", - jars = [ - "//external:jar/org/scala_lang/scala3_compiler_3" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/jline:jline_reader", - "//rules/scalafix/3rdparty/jvm/org/jline:jline_terminal", - "//rules/scalafix/3rdparty/jvm/org/jline:jline_terminal_jna", - "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_asm", - "//rules/scalafix/3rdparty/jvm/org/scala_sbt:compiler_interface", - ":scala3_interfaces", - ":scala3_library", - ":tasty_core" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala3_interfaces", - jars = [ - "//external:jar/org/scala_lang/scala3_interfaces" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala3_library", - exports = [ - "@scala3_library//jar" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala3_presentation_compiler", - jars = [ - "//external:jar/org/scala_lang/scala3_presentation_compiler_3" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/io/get_coursier:interface", - "//rules/scalafix/3rdparty/jvm/org/eclipse/lsp4j:org_eclipse_lsp4j", - "//rules/scalafix/3rdparty/jvm/org/lz4:lz4_java", - "//rules/scalafix/3rdparty/jvm/org/scalameta:mtags_interfaces", - ":scala3_compiler", - ":scala3_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala_compiler", - jars = [ - "//external:jar/org/scala_lang/scala_compiler" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/io/github/java_diff_utils:java_diff_utils", - "//rules/scalafix/3rdparty/jvm/net/java/dev/jna:jna", - "//rules/scalafix/3rdparty/jvm/org/jline:jline", - ":scala_library", - ":scala_reflect" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala_library", - exports = [ - "@scala_library_2_13//jar" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala_reflect", - exports = [ - "@scala_reflect_2_13//jar" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scalap", - jars = [ - "//external:jar/org/scala_lang/scalap" - ], - runtime_deps = [ - ":scala_compiler" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "tasty_core", - jars = [ - "//external:jar/org/scala_lang/tasty_core_3" - ], - runtime_deps = [ - ":scala3_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD deleted file mode 100644 index 9af614f8..00000000 --- a/rules/scalafix/3rdparty/jvm/org/scala_lang/modules/BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "scala_asm", - jars = [ - "//external:jar/org/scala_lang/modules/scala_asm" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scala_collection_compat", - jars = [ - "//external:jar/org/scala_lang/modules/scala_collection_compat_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD b/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD deleted file mode 100644 index f189571e..00000000 --- a/rules/scalafix/3rdparty/jvm/org/scala_sbt/BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "compiler_interface", - jars = [ - "//external:jar/org/scala_sbt/compiler_interface" - ], - runtime_deps = [ - ":util_interface" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "util_interface", - jars = [ - "//external:jar/org/scala_sbt/util_interface" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD b/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD deleted file mode 100644 index bcd6bed1..00000000 --- a/rules/scalafix/3rdparty/jvm/org/scalameta/BUILD +++ /dev/null @@ -1,158 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "common", - jars = [ - "//external:jar/org/scalameta/common_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/lihaoyi:sourcecode", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "metaconfig_core", - jars = [ - "//external:jar/org/scalameta/metaconfig_core_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect", - "//rules/scalafix/3rdparty/jvm/org/typelevel:paiges_core", - ":metaconfig_pprint" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "metaconfig_pprint", - jars = [ - "//external:jar/org/scalameta/metaconfig_pprint_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/lihaoyi:fansi", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_reflect" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "metaconfig_typesafe_config", - jars = [ - "//external:jar/org/scalameta/metaconfig_typesafe_config_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/typesafe:config", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":metaconfig_core" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -java_import( - name = "mtags_interfaces", - jars = [ - "//external:jar/org/scalameta/mtags_interfaces" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "parsers", - jars = [ - "//external:jar/org/scalameta/parsers_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":trees" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "scalameta", - jars = [ - "//external:jar/org/scalameta/scalameta_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scalap", - ":parsers" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "semanticdb_scalac", - jars = [ - "//external:jar/org/scalameta/semanticdb_scalac_2_13_15" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//visibility:public" - ] -) - -scala_import( - name = "semanticdb_scalac_core", - jars = [ - "//external:jar/org/scalameta/semanticdb_scalac_core_2_13_15" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_compiler", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":semanticdb_shared" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "semanticdb_shared", - jars = [ - "//external:jar/org/scalameta/semanticdb_shared_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/com/thesamet/scalapb:scalapb_runtime", - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":scalameta" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) - -scala_import( - name = "trees", - jars = [ - "//external:jar/org/scalameta/trees_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library", - ":common" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD b/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD deleted file mode 100644 index a1e3cea1..00000000 --- a/rules/scalafix/3rdparty/jvm/org/slf4j/BUILD +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -java_import( - name = "slf4j_api", - jars = [ - "//external:jar/org/slf4j/slf4j_api" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD b/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD deleted file mode 100644 index 1a7f55a4..00000000 --- a/rules/scalafix/3rdparty/jvm/org/typelevel/BUILD +++ /dev/null @@ -1,13 +0,0 @@ -load("@rules_scala3//rules:scala.bzl", "scala_import") -scala_import( - name = "paiges_core", - jars = [ - "//external:jar/org/typelevel/paiges_core_2_13" - ], - runtime_deps = [ - "//rules/scalafix/3rdparty/jvm/org/scala_lang:scala_library" - ], - visibility = [ - "//rules/scalafix/3rdparty/jvm:__subpackages__" - ] -) diff --git a/rules/scalafix/3rdparty/workspace.bzl b/rules/scalafix/3rdparty/workspace.bzl deleted file mode 100644 index 2af92c32..00000000 --- a/rules/scalafix/3rdparty/workspace.bzl +++ /dev/null @@ -1,109 +0,0 @@ -# Do not edit. rules_scala3 autogenerates this file -def _jar_artifact_impl(ctx): - jar_name = "%s.jar" % ctx.name - ctx.download( - output = ctx.path("jar/%s" % jar_name), - url = ctx.attr.urls, - executable = False, - ) - build_file_contents = """ -package(default_visibility = ['//visibility:public']) -filegroup( - name = 'jar', - srcs = ['{jar_name}'], - visibility = ['//visibility:public'], -) -alias( - name = "file", - actual = ":jar", - visibility = ["//visibility:public"], -)\n""".format(artifact = ctx.attr.artifact, jar_name = jar_name) - ctx.file(ctx.path("jar/BUILD"), build_file_contents, False) - return None - -jar_artifact = repository_rule( - attrs = { - "artifact": attr.string(mandatory = True), - "urls": attr.string_list(mandatory = True), - }, - implementation = _jar_artifact_impl, -) - -def jar_artifact_callback(hash): - jar_artifact( - artifact = hash["artifact"], - name = hash["name"], - urls = [hash["url"]], - ) - native.bind(name = hash["bind"], actual = hash["actual"]) - -def list_dependencies(): - return [ - {"artifact":"ch.epfl.scala:scalafix-cli_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-cli_3.5.1/0.13.0/scalafix-cli_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_cli_3_5_1","actual":"@ch_epfl_scala_scalafix_cli_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_cli_3_5_1"}, - {"artifact":"ch.epfl.scala:scalafix-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-core_2.13/0.13.0/scalafix-core_2.13-0.13.0.jar","name":"ch_epfl_scala_scalafix_core_2_13","actual":"@ch_epfl_scala_scalafix_core_2_13//jar","bind": "jar/ch/epfl/scala/scalafix_core_2_13"}, - {"artifact":"ch.epfl.scala:scalafix-interfaces:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-interfaces/0.13.0/scalafix-interfaces-0.13.0.jar","name":"ch_epfl_scala_scalafix_interfaces","actual":"@ch_epfl_scala_scalafix_interfaces//jar","bind": "jar/ch/epfl/scala/scalafix_interfaces"}, - {"artifact":"ch.epfl.scala:scalafix-reflect_2.13.15:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-reflect_2.13.15/0.13.0/scalafix-reflect_2.13.15-0.13.0.jar","name":"ch_epfl_scala_scalafix_reflect_2_13_15","actual":"@ch_epfl_scala_scalafix_reflect_2_13_15//jar","bind": "jar/ch/epfl/scala/scalafix_reflect_2_13_15"}, - {"artifact":"ch.epfl.scala:scalafix-rules_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-rules_3.5.1/0.13.0/scalafix-rules_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_rules_3_5_1","actual":"@ch_epfl_scala_scalafix_rules_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_rules_3_5_1"}, - {"artifact":"com.google.code.findbugs:jsr305:3.0.2","url":"https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar","name":"com_google_code_findbugs_jsr305","actual":"@com_google_code_findbugs_jsr305//jar","bind": "jar/com/google/code/findbugs/jsr305"}, - {"artifact":"com.google.code.gson:gson:2.10.1","url":"https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar","name":"com_google_code_gson_gson","actual":"@com_google_code_gson_gson//jar","bind": "jar/com/google/code/gson/gson"}, - {"artifact":"com.google.errorprone:error_prone_annotations:2.3.4","url":"https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar","name":"com_google_errorprone_error_prone_annotations","actual":"@com_google_errorprone_error_prone_annotations//jar","bind": "jar/com/google/errorprone/error_prone_annotations"}, - {"artifact":"com.google.guava:failureaccess:1.0.1","url":"https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar","name":"com_google_guava_failureaccess","actual":"@com_google_guava_failureaccess//jar","bind": "jar/com/google/guava/failureaccess"}, - {"artifact":"com.google.guava:guava:30.1-jre","url":"https://repo1.maven.org/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar","name":"com_google_guava_guava","actual":"@com_google_guava_guava//jar","bind": "jar/com/google/guava/guava"}, - {"artifact":"com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava","url":"https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar","name":"com_google_guava_listenablefuture","actual":"@com_google_guava_listenablefuture//jar","bind": "jar/com/google/guava/listenablefuture"}, - {"artifact":"com.google.j2objc:j2objc-annotations:1.3","url":"https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar","name":"com_google_j2objc_j2objc_annotations","actual":"@com_google_j2objc_j2objc_annotations//jar","bind": "jar/com/google/j2objc/j2objc_annotations"}, - {"artifact":"com.google.protobuf:protobuf-java:3.19.6","url":"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.6/protobuf-java-3.19.6.jar","name":"com_google_protobuf_protobuf_java","actual":"@com_google_protobuf_protobuf_java//jar","bind": "jar/com/google/protobuf/protobuf_java"}, - {"artifact":"com.googlecode.java-diff-utils:diffutils:1.3.0","url":"https://repo1.maven.org/maven2/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar","name":"com_googlecode_java_diff_utils_diffutils","actual":"@com_googlecode_java_diff_utils_diffutils//jar","bind": "jar/com/googlecode/java_diff_utils/diffutils"}, - {"artifact":"com.googlecode.javaewah:JavaEWAH:1.1.13","url":"https://repo1.maven.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.13/JavaEWAH-1.1.13.jar","name":"com_googlecode_javaewah_JavaEWAH","actual":"@com_googlecode_javaewah_JavaEWAH//jar","bind": "jar/com/googlecode/javaewah/JavaEWAH"}, - {"artifact":"com.lihaoyi:fansi_2.13:0.5.0","url":"https://repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0/fansi_2.13-0.5.0.jar","name":"com_lihaoyi_fansi_2_13","actual":"@com_lihaoyi_fansi_2_13//jar","bind": "jar/com/lihaoyi/fansi_2_13"}, - {"artifact":"com.lihaoyi:sourcecode_2.13:0.4.2","url":"https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.2/sourcecode_2.13-0.4.2.jar","name":"com_lihaoyi_sourcecode_2_13","actual":"@com_lihaoyi_sourcecode_2_13//jar","bind": "jar/com/lihaoyi/sourcecode_2_13"}, - {"artifact":"com.martiansoftware:nailgun-server:0.9.1","url":"https://repo1.maven.org/maven2/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar","name":"com_martiansoftware_nailgun_server","actual":"@com_martiansoftware_nailgun_server//jar","bind": "jar/com/martiansoftware/nailgun_server"}, - {"artifact":"com.thesamet.scalapb:lenses_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.13/0.11.15/lenses_2.13-0.11.15.jar","name":"com_thesamet_scalapb_lenses_2_13","actual":"@com_thesamet_scalapb_lenses_2_13//jar","bind": "jar/com/thesamet/scalapb/lenses_2_13"}, - {"artifact":"com.thesamet.scalapb:scalapb-runtime_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.13/0.11.15/scalapb-runtime_2.13-0.11.15.jar","name":"com_thesamet_scalapb_scalapb_runtime_2_13","actual":"@com_thesamet_scalapb_scalapb_runtime_2_13//jar","bind": "jar/com/thesamet/scalapb/scalapb_runtime_2_13"}, - {"artifact":"com.typesafe:config:1.4.3","url":"https://repo1.maven.org/maven2/com/typesafe/config/1.4.3/config-1.4.3.jar","name":"com_typesafe_config","actual":"@com_typesafe_config//jar","bind": "jar/com/typesafe/config"}, - {"artifact":"io.get-coursier:interface:1.0.20","url":"https://repo1.maven.org/maven2/io/get-coursier/interface/1.0.20/interface-1.0.20.jar","name":"io_get_coursier_interface","actual":"@io_get_coursier_interface//jar","bind": "jar/io/get_coursier/interface"}, - {"artifact":"io.github.java-diff-utils:java-diff-utils:4.12","url":"https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar","name":"io_github_java_diff_utils_java_diff_utils","actual":"@io_github_java_diff_utils_java_diff_utils//jar","bind": "jar/io/github/java_diff_utils/java_diff_utils"}, - {"artifact":"net.java.dev.jna:jna:5.15.0","url":"https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.15.0/jna-5.15.0.jar","name":"net_java_dev_jna_jna","actual":"@net_java_dev_jna_jna//jar","bind": "jar/net/java/dev/jna/jna"}, - {"artifact":"org.apache.commons:commons-lang3:3.14.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar","name":"org_apache_commons_commons_lang3","actual":"@org_apache_commons_commons_lang3//jar","bind": "jar/org/apache/commons/commons_lang3"}, - {"artifact":"org.apache.commons:commons-text:1.12.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.jar","name":"org_apache_commons_commons_text","actual":"@org_apache_commons_commons_text//jar","bind": "jar/org/apache/commons/commons_text"}, - {"artifact":"org.checkerframework:checker-qual:3.5.0","url":"https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar","name":"org_checkerframework_checker_qual","actual":"@org_checkerframework_checker_qual//jar","bind": "jar/org/checkerframework/checker_qual"}, - {"artifact":"org.eclipse.jgit:org.eclipse.jgit:5.13.3.202401111512-r","url":"https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.13.3.202401111512-r/org.eclipse.jgit-5.13.3.202401111512-r.jar","name":"org_eclipse_jgit_org_eclipse_jgit","actual":"@org_eclipse_jgit_org_eclipse_jgit//jar","bind": "jar/org/eclipse/jgit/org_eclipse_jgit"}, - {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j/0.20.1/org.eclipse.lsp4j-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j"}, - {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.generator:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.20.1/org.eclipse.lsp4j.generator-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_generator","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_generator//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator"}, - {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.20.1/org.eclipse.lsp4j.jsonrpc-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc"}, - {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib/2.28.0/org.eclipse.xtend.lib-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib"}, - {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.28.0/org.eclipse.xtend.lib.macro-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib_macro","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib_macro//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro"}, - {"artifact":"org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.28.0/org.eclipse.xtext.xbase.lib-2.28.0.jar","name":"org_eclipse_xtext_org_eclipse_xtext_xbase_lib","actual":"@org_eclipse_xtext_org_eclipse_xtext_xbase_lib//jar","bind": "jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib"}, - {"artifact":"org.jline:jline:3.26.3","url":"https://repo1.maven.org/maven2/org/jline/jline/3.26.3/jline-3.26.3.jar","name":"org_jline_jline","actual":"@org_jline_jline//jar","bind": "jar/org/jline/jline"}, - {"artifact":"org.jline:jline-native:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-native/3.27.0/jline-native-3.27.0.jar","name":"org_jline_jline_native","actual":"@org_jline_jline_native//jar","bind": "jar/org/jline/jline_native"}, - {"artifact":"org.jline:jline-reader:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-reader/3.27.0/jline-reader-3.27.0.jar","name":"org_jline_jline_reader","actual":"@org_jline_jline_reader//jar","bind": "jar/org/jline/jline_reader"}, - {"artifact":"org.jline:jline-terminal:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal/3.27.0/jline-terminal-3.27.0.jar","name":"org_jline_jline_terminal","actual":"@org_jline_jline_terminal//jar","bind": "jar/org/jline/jline_terminal"}, - {"artifact":"org.jline:jline-terminal-jna:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.27.0/jline-terminal-jna-3.27.0.jar","name":"org_jline_jline_terminal_jna","actual":"@org_jline_jline_terminal_jna//jar","bind": "jar/org/jline/jline_terminal_jna"}, - {"artifact":"org.lz4:lz4-java:1.8.0","url":"https://repo1.maven.org/maven2/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar","name":"org_lz4_lz4_java","actual":"@org_lz4_lz4_java//jar","bind": "jar/org/lz4/lz4_java"}, - {"artifact":"org.scala-lang.modules:scala-asm:9.7.0-scala-2","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.7.0-scala-2/scala-asm-9.7.0-scala-2.jar","name":"org_scala_lang_modules_scala_asm","actual":"@org_scala_lang_modules_scala_asm//jar","bind": "jar/org/scala_lang/modules/scala_asm"}, - {"artifact":"org.scala-lang.modules:scala-collection-compat_2.13:2.12.0","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0/scala-collection-compat_2.13-2.12.0.jar","name":"org_scala_lang_modules_scala_collection_compat_2_13","actual":"@org_scala_lang_modules_scala_collection_compat_2_13//jar","bind": "jar/org/scala_lang/modules/scala_collection_compat_2_13"}, - {"artifact":"org.scala-lang:scala3-compiler_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.6.1/scala3-compiler_3-3.6.1.jar","name":"org_scala_lang_scala3_compiler_3","actual":"@org_scala_lang_scala3_compiler_3//jar","bind": "jar/org/scala_lang/scala3_compiler_3"}, - {"artifact":"org.scala-lang:scala3-interfaces:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.6.1/scala3-interfaces-3.6.1.jar","name":"org_scala_lang_scala3_interfaces","actual":"@org_scala_lang_scala3_interfaces//jar","bind": "jar/org/scala_lang/scala3_interfaces"}, - {"artifact":"org.scala-lang:scala3-presentation-compiler_3:3.5.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-presentation-compiler_3/3.5.1/scala3-presentation-compiler_3-3.5.1.jar","name":"org_scala_lang_scala3_presentation_compiler_3","actual":"@org_scala_lang_scala3_presentation_compiler_3//jar","bind": "jar/org/scala_lang/scala3_presentation_compiler_3"}, - {"artifact":"org.scala-lang:scala-compiler:2.13.15","url":"https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15.jar","name":"org_scala_lang_scala_compiler","actual":"@org_scala_lang_scala_compiler//jar","bind": "jar/org/scala_lang/scala_compiler"}, - {"artifact":"org.scala-lang:scalap:2.13.12","url":"https://repo1.maven.org/maven2/org/scala-lang/scalap/2.13.12/scalap-2.13.12.jar","name":"org_scala_lang_scalap","actual":"@org_scala_lang_scalap//jar","bind": "jar/org/scala_lang/scalap"}, - {"artifact":"org.scala-lang:tasty-core_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.6.1/tasty-core_3-3.6.1.jar","name":"org_scala_lang_tasty_core_3","actual":"@org_scala_lang_tasty_core_3//jar","bind": "jar/org/scala_lang/tasty_core_3"}, - {"artifact":"org.scala-sbt:compiler-interface:1.9.6","url":"https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar","name":"org_scala_sbt_compiler_interface","actual":"@org_scala_sbt_compiler_interface//jar","bind": "jar/org/scala_sbt/compiler_interface"}, - {"artifact":"org.scala-sbt:util-interface:1.9.8","url":"https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar","name":"org_scala_sbt_util_interface","actual":"@org_scala_sbt_util_interface//jar","bind": "jar/org/scala_sbt/util_interface"}, - {"artifact":"org.scalameta:common_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/common_2.13/4.10.1/common_2.13-4.10.1.jar","name":"org_scalameta_common_2_13","actual":"@org_scalameta_common_2_13//jar","bind": "jar/org/scalameta/common_2_13"}, - {"artifact":"org.scalameta:metaconfig-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-core_2.13/0.13.0/metaconfig-core_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_core_2_13","actual":"@org_scalameta_metaconfig_core_2_13//jar","bind": "jar/org/scalameta/metaconfig_core_2_13"}, - {"artifact":"org.scalameta:metaconfig-pprint_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-pprint_2.13/0.13.0/metaconfig-pprint_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_pprint_2_13","actual":"@org_scalameta_metaconfig_pprint_2_13//jar","bind": "jar/org/scalameta/metaconfig_pprint_2_13"}, - {"artifact":"org.scalameta:metaconfig-typesafe-config_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-typesafe-config_2.13/0.13.0/metaconfig-typesafe-config_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_typesafe_config_2_13","actual":"@org_scalameta_metaconfig_typesafe_config_2_13//jar","bind": "jar/org/scalameta/metaconfig_typesafe_config_2_13"}, - {"artifact":"org.scalameta:mtags-interfaces:1.3.2","url":"https://repo1.maven.org/maven2/org/scalameta/mtags-interfaces/1.3.2/mtags-interfaces-1.3.2.jar","name":"org_scalameta_mtags_interfaces","actual":"@org_scalameta_mtags_interfaces//jar","bind": "jar/org/scalameta/mtags_interfaces"}, - {"artifact":"org.scalameta:parsers_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/parsers_2.13/4.10.1/parsers_2.13-4.10.1.jar","name":"org_scalameta_parsers_2_13","actual":"@org_scalameta_parsers_2_13//jar","bind": "jar/org/scalameta/parsers_2_13"}, - {"artifact":"org.scalameta:scalameta_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/scalameta_2.13/4.10.1/scalameta_2.13-4.10.1.jar","name":"org_scalameta_scalameta_2_13","actual":"@org_scalameta_scalameta_2_13//jar","bind": "jar/org/scalameta/scalameta_2_13"}, - {"artifact":"org.scalameta:semanticdb-scalac_2.13.15:4.11.2","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac_2.13.15/4.11.2/semanticdb-scalac_2.13.15-4.11.2.jar","name":"org_scalameta_semanticdb_scalac_2_13_15","actual":"@org_scalameta_semanticdb_scalac_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_2_13_15"}, - {"artifact":"org.scalameta:semanticdb-scalac-core_2.13.15:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac-core_2.13.15/4.10.1/semanticdb-scalac-core_2.13.15-4.10.1.jar","name":"org_scalameta_semanticdb_scalac_core_2_13_15","actual":"@org_scalameta_semanticdb_scalac_core_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_core_2_13_15"}, - {"artifact":"org.scalameta:semanticdb-shared_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-shared_2.13/4.10.1/semanticdb-shared_2.13-4.10.1.jar","name":"org_scalameta_semanticdb_shared_2_13","actual":"@org_scalameta_semanticdb_shared_2_13//jar","bind": "jar/org/scalameta/semanticdb_shared_2_13"}, - {"artifact":"org.scalameta:trees_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/trees_2.13/4.10.1/trees_2.13-4.10.1.jar","name":"org_scalameta_trees_2_13","actual":"@org_scalameta_trees_2_13//jar","bind": "jar/org/scalameta/trees_2_13"}, - {"artifact":"org.slf4j:slf4j-api:1.7.36","url":"https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar","name":"org_slf4j_slf4j_api","actual":"@org_slf4j_slf4j_api//jar","bind": "jar/org/slf4j/slf4j_api"}, - {"artifact":"org.typelevel:paiges-core_2.13:0.4.4","url":"https://repo1.maven.org/maven2/org/typelevel/paiges-core_2.13/0.4.4/paiges-core_2.13-0.4.4.jar","name":"org_typelevel_paiges_core_2_13","actual":"@org_typelevel_paiges_core_2_13//jar","bind": "jar/org/typelevel/paiges_core_2_13"}, - ] - -def maven_dependencies(callback = jar_artifact_callback): - for hash in list_dependencies(): - callback(hash) diff --git a/rules/scalafix/BUILD b/rules/scalafix/BUILD index 334b6745..e69de29b 100644 --- a/rules/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -1,20 +0,0 @@ -load("//rules/scalafix:scalafix_runner.bzl", "scalafix_runner") -load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") - -filegroup( - name = "dependencies", - srcs = ["Dependencies.scala"], - visibility = ["//visibility:public"], -) - -scala_deps( - name = "scala_deps", - src = "//rules/scalafix:dependencies", - dependencies = "rules_scala3.rules.scalafix.Dependencies", -) - -scalafix_runner( - name = "run_scalafix", - toolchain = "//:scalafix_toolchain", - targets = ["//deps:deps"], -) \ No newline at end of file diff --git a/rules/scalafix/Dependencies.scala b/rules/scalafix/Dependencies.scala deleted file mode 100644 index 99dcb41b..00000000 --- a/rules/scalafix/Dependencies.scala +++ /dev/null @@ -1,23 +0,0 @@ -package rules_scala3.rules.scalafix - -import sbt.librarymanagement.syntax.* -import sbt.librarymanagement.{DependencyBuilders, ModuleID, Resolver}, DependencyBuilders.OrganizationArtifactName - -object Dependencies: - - private val jmhV = "1.37" - - val resolvers: Seq[Resolver] = Vector( - "mavencentral".at("https://repo1.maven.org/maven2/") - ) - // Replacements are not handled by `librarymanagement`. any Scala prefix in the name will be dropped. - // It also doesn't matter whether you use double `%` to get the Scala version or not. - val replacements: Map[OrganizationArtifactName, String] = Map( - "org.scala-lang" % "scala3-library" -> "@scala3_library//jar", - "org.scala-lang" % "scala-library" -> "@scala_library_2_13//jar", - "org.scala-lang" % "scala-reflect" -> "@scala_reflect_2_13//jar" - ) - val dependencies: Seq[ModuleID] = Vector( - "ch.epfl.scala" % "scalafix-cli_3.5.1" % "0.13.0", - "org.scalameta" % "semanticdb-scalac_2.13.15" % "4.11.2" - ) diff --git a/rules/scalafix/scalafix_runner.bzl b/rules/scalafix/scalafix_runner.bzl index f78c7fcc..875566f7 100644 --- a/rules/scalafix/scalafix_runner.bzl +++ b/rules/scalafix/scalafix_runner.bzl @@ -1,5 +1,4 @@ def _scalafix_runner_impl(ctx): - # Dynamically generate the script content script_content = """#!/usr/bin/env bash # Navigate to the Bazel workspace @@ -22,9 +21,6 @@ if [[ ${#filtered_targets[@]} -eq 0 ]]; then exit 1 fi -# Debug filtered targets -echo "Filtered targets: ${filtered_targets[@]}" - # Build targets build_cmd="bazel build --extra_toolchains='$toolchain' -- ${filtered_targets[@]}" echo "Building targets..." diff --git a/scala/BUILD b/scala/BUILD index fedc2308..d4afd2aa 100644 --- a/scala/BUILD +++ b/scala/BUILD @@ -80,7 +80,7 @@ alias( visibility = ["//visibility:public"], ) -scala3 = "3.6.1" +scala3 = "3.6.2-RC1" scala3_global_scalacopts = [ "-deprecation", From 9b807c810a0116490cbb216045b74aceccf37351 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Wed, 27 Nov 2024 00:32:13 +0100 Subject: [PATCH 14/16] files changed with scalafix --- scala/workers/zinc/test/TestFrameworkRunner.scala | 2 +- scala/workers/zinc/test/TestRunner.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/workers/zinc/test/TestFrameworkRunner.scala b/scala/workers/zinc/test/TestFrameworkRunner.scala index 98b015ae..af18f4de 100644 --- a/scala/workers/zinc/test/TestFrameworkRunner.scala +++ b/scala/workers/zinc/test/TestFrameworkRunner.scala @@ -80,7 +80,7 @@ final class ProcessTestRunner( } } - val taskExecutor = TestTaskExecutor(logger) + TestTaskExecutor(logger) val failures = mutable.Set[String]() tests.foreach { test => val process = ProcessBuilder((command.executable +: command.arguments)*) diff --git a/scala/workers/zinc/test/TestRunner.scala b/scala/workers/zinc/test/TestRunner.scala index 89938ebb..9c635915 100644 --- a/scala/workers/zinc/test/TestRunner.scala +++ b/scala/workers/zinc/test/TestRunner.scala @@ -121,7 +121,7 @@ object TestRunner: val classpath = workArgs.classpath.map(runPath.resolve(_)) val sharedClasspath = workArgs.sharedClasspath.map(runPath.resolve(_)) - val sharedUrls = classpath.filter(sharedClasspath.toSet).map(_.toUri.toURL) + classpath.filter(sharedClasspath.toSet).map(_.toUri.toURL) val classLoader = ClassLoaders.sbtTestClassLoader(classpath.map(_.toUri.toURL)) val sharedClassLoader = ClassLoaders.sbtTestClassLoader(classpath.filter(sharedClasspath.toSet).map(_.toUri.toURL)) From 5725d8913672976c9e8b4d389646226d933f3ad5 Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Wed, 27 Nov 2024 00:58:01 +0100 Subject: [PATCH 15/16] colors added --- rules/scalafix/scalafix_runner.bzl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rules/scalafix/scalafix_runner.bzl b/rules/scalafix/scalafix_runner.bzl index 875566f7..e7173698 100644 --- a/rules/scalafix/scalafix_runner.bzl +++ b/rules/scalafix/scalafix_runner.bzl @@ -5,6 +5,11 @@ def _scalafix_runner_impl(ctx): workspace="$BUILD_WORKSPACE_DIRECTORY" cd "$workspace" +red='\033[31m' +green='\033[32m' +bold='\033[1m' +nc='\033[0m' + # Variables toolchain="{toolchain}" opts="{opts}" @@ -12,7 +17,7 @@ targets=({targets}) excluded_targets=({excluded_targets}) # Filter targets -echo "Filtering targets..." +echo -e "${green}${bold}Filtering targets...${nc}" readarray -t filtered_targets < <(bazel query \ "kind('scala(_binary|_library|_test|js_library)', set(${targets[*]}) except set(${excluded_targets[*]}))" --output=label 2>/dev/null) @@ -23,10 +28,10 @@ fi # Build targets build_cmd="bazel build --extra_toolchains='$toolchain' -- ${filtered_targets[@]}" -echo "Building targets..." +echo -e "${green}${bold}Building targets...${nc}" echo "Command: $build_cmd" if ! eval "$build_cmd"; then - echo "BUILD FAILED, FIX AND TRY AGAIN" + echo -e "${red}BUILD FAILED, FIX AND TRY AGAIN${nc}" kill -INT $$ fi @@ -82,7 +87,7 @@ for target in "${filtered_targets[@]}"; do sr="--sourceroot $(bazel info workspace 2>/dev/null)" scalafix_cmd="scalafix ${scalafix_opts//:/ } --scala-version $scala_version $sr $cs ${scalac_opts[*]/#/--scalac-options } ${files[*]%%:*}" - echo "\nTrying to fix $target" + echo -e "${green}${bold}\nTrying to fix $target${nc}" echo "Command: $scalafix_cmd" eval "$scalafix_cmd" done From fb832a4357e9f9c9ee5eb9b16d462b13b27a40aa Mon Sep 17 00:00:00 2001 From: anna-skrodzka Date: Thu, 12 Dec 2024 15:20:28 +0100 Subject: [PATCH 16/16] 3rdparty added --- 3rdparty/jvm/ch/epfl/scala/BUILD | 83 +++++++++ 3rdparty/jvm/com/google/code/findbugs/BUILD | 10 ++ 3rdparty/jvm/com/google/code/gson/BUILD | 10 ++ 3rdparty/jvm/com/google/errorprone/BUILD | 10 ++ 3rdparty/jvm/com/google/guava/BUILD | 38 +++++ 3rdparty/jvm/com/google/j2objc/BUILD | 10 ++ 3rdparty/jvm/com/google/protobuf/BUILD | 10 ++ .../jvm/com/googlecode/java_diff_utils/BUILD | 10 ++ 3rdparty/jvm/com/googlecode/javaewah/BUILD | 10 ++ 3rdparty/jvm/com/lihaoyi/BUILD | 27 +++ 3rdparty/jvm/com/martiansoftware/BUILD | 10 ++ 3rdparty/jvm/com/thesamet/scalapb/BUILD | 30 ++++ 3rdparty/jvm/com/typesafe/BUILD | 10 ++ 3rdparty/jvm/io/get_coursier/BUILD | 13 ++ 3rdparty/jvm/io/github/java_diff_utils/BUILD | 10 ++ 3rdparty/jvm/net/java/dev/jna/BUILD | 10 ++ 3rdparty/jvm/org/apache/commons/BUILD | 23 +++ 3rdparty/jvm/org/checkerframework/BUILD | 10 ++ 3rdparty/jvm/org/eclipse/jgit/BUILD | 14 ++ 3rdparty/jvm/org/eclipse/lsp4j/BUILD | 41 +++++ 3rdparty/jvm/org/eclipse/xtend/BUILD | 27 +++ 3rdparty/jvm/org/eclipse/xtext/BUILD | 13 ++ 3rdparty/jvm/org/jline/BUILD | 60 +++++++ 3rdparty/jvm/org/lz4/BUILD | 10 ++ 3rdparty/jvm/org/scala_lang/BUILD | 111 ++++++++++++ 3rdparty/jvm/org/scala_lang/modules/BUILD | 23 +++ 3rdparty/jvm/org/scala_sbt/BUILD | 23 +++ 3rdparty/jvm/org/scalameta/BUILD | 158 ++++++++++++++++++ 3rdparty/jvm/org/slf4j/BUILD | 10 ++ 3rdparty/jvm/org/typelevel/BUILD | 13 ++ 3rdparty/workspace.bzl | 63 +++++++ BUILD | 37 +--- Dependencies.scala | 4 +- WORKSPACE | 4 +- rules/scalafix/BUILD | 60 +++++++ 35 files changed, 973 insertions(+), 32 deletions(-) create mode 100644 3rdparty/jvm/ch/epfl/scala/BUILD create mode 100644 3rdparty/jvm/com/google/code/findbugs/BUILD create mode 100644 3rdparty/jvm/com/google/code/gson/BUILD create mode 100644 3rdparty/jvm/com/google/errorprone/BUILD create mode 100644 3rdparty/jvm/com/google/guava/BUILD create mode 100644 3rdparty/jvm/com/google/j2objc/BUILD create mode 100644 3rdparty/jvm/com/google/protobuf/BUILD create mode 100644 3rdparty/jvm/com/googlecode/java_diff_utils/BUILD create mode 100644 3rdparty/jvm/com/googlecode/javaewah/BUILD create mode 100644 3rdparty/jvm/com/lihaoyi/BUILD create mode 100644 3rdparty/jvm/com/martiansoftware/BUILD create mode 100644 3rdparty/jvm/com/thesamet/scalapb/BUILD create mode 100644 3rdparty/jvm/com/typesafe/BUILD create mode 100644 3rdparty/jvm/io/get_coursier/BUILD create mode 100644 3rdparty/jvm/io/github/java_diff_utils/BUILD create mode 100644 3rdparty/jvm/net/java/dev/jna/BUILD create mode 100644 3rdparty/jvm/org/checkerframework/BUILD create mode 100644 3rdparty/jvm/org/eclipse/jgit/BUILD create mode 100644 3rdparty/jvm/org/eclipse/lsp4j/BUILD create mode 100644 3rdparty/jvm/org/eclipse/xtend/BUILD create mode 100644 3rdparty/jvm/org/eclipse/xtext/BUILD create mode 100644 3rdparty/jvm/org/jline/BUILD create mode 100644 3rdparty/jvm/org/lz4/BUILD create mode 100644 3rdparty/jvm/org/scala_lang/modules/BUILD create mode 100644 3rdparty/jvm/org/scala_sbt/BUILD create mode 100644 3rdparty/jvm/org/scalameta/BUILD create mode 100644 3rdparty/jvm/org/slf4j/BUILD create mode 100644 3rdparty/jvm/org/typelevel/BUILD diff --git a/3rdparty/jvm/ch/epfl/scala/BUILD b/3rdparty/jvm/ch/epfl/scala/BUILD new file mode 100644 index 00000000..d00e7ef8 --- /dev/null +++ b/3rdparty/jvm/ch/epfl/scala/BUILD @@ -0,0 +1,83 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "scalafix_cli", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_cli_3_5_1" + ], + runtime_deps = [ + "//3rdparty/jvm/com/martiansoftware:nailgun_server", + "//3rdparty/jvm/org/apache/commons:commons_text", + "//3rdparty/jvm/org/eclipse/jgit:org_eclipse_jgit", + "//3rdparty/jvm/org/scala_lang:scala3_library", + ":scalafix_interfaces", + ":scalafix_reflect", + ":scalafix_rules" + ], + visibility = [ + "//visibility:public" + ] +) + +scala_import( + name = "scalafix_core", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_core_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/googlecode/java_diff_utils:diffutils", + "//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//3rdparty/jvm/org/scala_lang:scala_library", + "//3rdparty/jvm/org/scalameta:metaconfig_typesafe_config", + "//3rdparty/jvm/org/scalameta:scalameta", + "//3rdparty/jvm/org/scalameta:semanticdb_shared" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "scalafix_interfaces", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_interfaces" + ], + runtime_deps = [ + "//3rdparty/jvm/io/get_coursier:interface" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalafix_reflect", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_reflect_2_13_15" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_compiler", + "//3rdparty/jvm/org/scala_lang:scala_library", + "//3rdparty/jvm/org/scala_lang:scala_reflect", + "//3rdparty/jvm/org/scalameta:semanticdb_scalac_core", + ":scalafix_core" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalafix_rules", + jars = [ + "//external:jar/ch/epfl/scala/scalafix_rules_3_5_1" + ], + runtime_deps = [ + "//3rdparty/jvm/io/get_coursier:interface", + "//3rdparty/jvm/org/scala_lang:scala3_library", + "//3rdparty/jvm/org/scala_lang:scala3_presentation_compiler", + ":scalafix_core" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/code/findbugs/BUILD b/3rdparty/jvm/com/google/code/findbugs/BUILD new file mode 100644 index 00000000..723fcb6a --- /dev/null +++ b/3rdparty/jvm/com/google/code/findbugs/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jsr305", + jars = [ + "//external:jar/com/google/code/findbugs/jsr305" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/code/gson/BUILD b/3rdparty/jvm/com/google/code/gson/BUILD new file mode 100644 index 00000000..86a804eb --- /dev/null +++ b/3rdparty/jvm/com/google/code/gson/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "gson", + jars = [ + "//external:jar/com/google/code/gson/gson" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/errorprone/BUILD b/3rdparty/jvm/com/google/errorprone/BUILD new file mode 100644 index 00000000..7b904df6 --- /dev/null +++ b/3rdparty/jvm/com/google/errorprone/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "error_prone_annotations", + jars = [ + "//external:jar/com/google/errorprone/error_prone_annotations" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/guava/BUILD b/3rdparty/jvm/com/google/guava/BUILD new file mode 100644 index 00000000..aefa84eb --- /dev/null +++ b/3rdparty/jvm/com/google/guava/BUILD @@ -0,0 +1,38 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "failureaccess", + jars = [ + "//external:jar/com/google/guava/failureaccess" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "guava", + jars = [ + "//external:jar/com/google/guava/guava" + ], + runtime_deps = [ + "//3rdparty/jvm/com/google/code/findbugs:jsr305", + "//3rdparty/jvm/com/google/errorprone:error_prone_annotations", + "//3rdparty/jvm/com/google/j2objc:j2objc_annotations", + "//3rdparty/jvm/org/checkerframework:checker_qual", + ":failureaccess", + ":listenablefuture" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "listenablefuture", + jars = [ + "//external:jar/com/google/guava/listenablefuture" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/j2objc/BUILD b/3rdparty/jvm/com/google/j2objc/BUILD new file mode 100644 index 00000000..9d3604ab --- /dev/null +++ b/3rdparty/jvm/com/google/j2objc/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "j2objc_annotations", + jars = [ + "//external:jar/com/google/j2objc/j2objc_annotations" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/google/protobuf/BUILD b/3rdparty/jvm/com/google/protobuf/BUILD new file mode 100644 index 00000000..331fe601 --- /dev/null +++ b/3rdparty/jvm/com/google/protobuf/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "protobuf_java", + jars = [ + "//external:jar/com/google/protobuf/protobuf_java" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD b/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD new file mode 100644 index 00000000..f19af142 --- /dev/null +++ b/3rdparty/jvm/com/googlecode/java_diff_utils/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "diffutils", + jars = [ + "//external:jar/com/googlecode/java_diff_utils/diffutils" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/googlecode/javaewah/BUILD b/3rdparty/jvm/com/googlecode/javaewah/BUILD new file mode 100644 index 00000000..2e82de40 --- /dev/null +++ b/3rdparty/jvm/com/googlecode/javaewah/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "JavaEWAH", + jars = [ + "//external:jar/com/googlecode/javaewah/JavaEWAH" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/lihaoyi/BUILD b/3rdparty/jvm/com/lihaoyi/BUILD new file mode 100644 index 00000000..9fda8526 --- /dev/null +++ b/3rdparty/jvm/com/lihaoyi/BUILD @@ -0,0 +1,27 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "fansi", + jars = [ + "//external:jar/com/lihaoyi/fansi_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library", + ":sourcecode" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "sourcecode", + jars = [ + "//external:jar/com/lihaoyi/sourcecode_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/martiansoftware/BUILD b/3rdparty/jvm/com/martiansoftware/BUILD new file mode 100644 index 00000000..96d54456 --- /dev/null +++ b/3rdparty/jvm/com/martiansoftware/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "nailgun_server", + jars = [ + "//external:jar/com/martiansoftware/nailgun_server" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/thesamet/scalapb/BUILD b/3rdparty/jvm/com/thesamet/scalapb/BUILD new file mode 100644 index 00000000..7ba67c1c --- /dev/null +++ b/3rdparty/jvm/com/thesamet/scalapb/BUILD @@ -0,0 +1,30 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "lenses", + jars = [ + "//external:jar/com/thesamet/scalapb/lenses_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalapb_runtime", + jars = [ + "//external:jar/com/thesamet/scalapb/scalapb_runtime_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/google/protobuf:protobuf_java", + "//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//3rdparty/jvm/org/scala_lang:scala_library", + ":lenses" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/com/typesafe/BUILD b/3rdparty/jvm/com/typesafe/BUILD new file mode 100644 index 00000000..844eba76 --- /dev/null +++ b/3rdparty/jvm/com/typesafe/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "config", + jars = [ + "//external:jar/com/typesafe/config" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/io/get_coursier/BUILD b/3rdparty/jvm/io/get_coursier/BUILD new file mode 100644 index 00000000..5b4b4269 --- /dev/null +++ b/3rdparty/jvm/io/get_coursier/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "interface", + jars = [ + "//external:jar/io/get_coursier/interface" + ], + runtime_deps = [ + "//3rdparty/jvm/org/slf4j:slf4j_api" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/io/github/java_diff_utils/BUILD b/3rdparty/jvm/io/github/java_diff_utils/BUILD new file mode 100644 index 00000000..35b132aa --- /dev/null +++ b/3rdparty/jvm/io/github/java_diff_utils/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "java_diff_utils", + jars = [ + "//external:jar/io/github/java_diff_utils/java_diff_utils" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/net/java/dev/jna/BUILD b/3rdparty/jvm/net/java/dev/jna/BUILD new file mode 100644 index 00000000..b1e2fc25 --- /dev/null +++ b/3rdparty/jvm/net/java/dev/jna/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jna", + jars = [ + "//external:jar/net/java/dev/jna/jna" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/apache/commons/BUILD b/3rdparty/jvm/org/apache/commons/BUILD index 5eef1a07..81fb8198 100644 --- a/3rdparty/jvm/org/apache/commons/BUILD +++ b/3rdparty/jvm/org/apache/commons/BUILD @@ -1,4 +1,14 @@ load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "commons_lang3", + jars = [ + "//external:jar/org/apache/commons/commons_lang3" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + java_import( name = "commons_math3", jars = [ @@ -8,3 +18,16 @@ java_import( "//3rdparty/jvm:__subpackages__" ] ) + +java_import( + name = "commons_text", + jars = [ + "//external:jar/org/apache/commons/commons_text" + ], + runtime_deps = [ + ":commons_lang3" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/checkerframework/BUILD b/3rdparty/jvm/org/checkerframework/BUILD new file mode 100644 index 00000000..4b1b5f83 --- /dev/null +++ b/3rdparty/jvm/org/checkerframework/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "checker_qual", + jars = [ + "//external:jar/org/checkerframework/checker_qual" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/eclipse/jgit/BUILD b/3rdparty/jvm/org/eclipse/jgit/BUILD new file mode 100644 index 00000000..519fde08 --- /dev/null +++ b/3rdparty/jvm/org/eclipse/jgit/BUILD @@ -0,0 +1,14 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_jgit", + jars = [ + "//external:jar/org/eclipse/jgit/org_eclipse_jgit" + ], + runtime_deps = [ + "//3rdparty/jvm/com/googlecode/javaewah:JavaEWAH", + "//3rdparty/jvm/org/slf4j:slf4j_api" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/eclipse/lsp4j/BUILD b/3rdparty/jvm/org/eclipse/lsp4j/BUILD new file mode 100644 index 00000000..6277013a --- /dev/null +++ b/3rdparty/jvm/org/eclipse/lsp4j/BUILD @@ -0,0 +1,41 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_lsp4j", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j" + ], + runtime_deps = [ + ":org_eclipse_lsp4j_generator", + ":org_eclipse_lsp4j_jsonrpc" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_lsp4j_generator", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator" + ], + runtime_deps = [ + "//3rdparty/jvm/org/eclipse/xtend:org_eclipse_xtend_lib", + ":org_eclipse_lsp4j_jsonrpc" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_lsp4j_jsonrpc", + jars = [ + "//external:jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc" + ], + runtime_deps = [ + "//3rdparty/jvm/com/google/code/gson:gson" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/eclipse/xtend/BUILD b/3rdparty/jvm/org/eclipse/xtend/BUILD new file mode 100644 index 00000000..8a5dd720 --- /dev/null +++ b/3rdparty/jvm/org/eclipse/xtend/BUILD @@ -0,0 +1,27 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_xtend_lib", + jars = [ + "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib" + ], + runtime_deps = [ + "//3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib", + ":org_eclipse_xtend_lib_macro" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "org_eclipse_xtend_lib_macro", + jars = [ + "//external:jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro" + ], + runtime_deps = [ + "//3rdparty/jvm/org/eclipse/xtext:org_eclipse_xtext_xbase_lib" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/eclipse/xtext/BUILD b/3rdparty/jvm/org/eclipse/xtext/BUILD new file mode 100644 index 00000000..b416a0eb --- /dev/null +++ b/3rdparty/jvm/org/eclipse/xtext/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "org_eclipse_xtext_xbase_lib", + jars = [ + "//external:jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib" + ], + runtime_deps = [ + "//3rdparty/jvm/com/google/guava:guava" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/jline/BUILD b/3rdparty/jvm/org/jline/BUILD new file mode 100644 index 00000000..59b90c61 --- /dev/null +++ b/3rdparty/jvm/org/jline/BUILD @@ -0,0 +1,60 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "jline", + jars = [ + "//external:jar/org/jline/jline" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_native", + jars = [ + "//external:jar/org/jline/jline_native" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_reader", + jars = [ + "//external:jar/org/jline/jline_reader" + ], + runtime_deps = [ + ":jline_terminal" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_terminal", + jars = [ + "//external:jar/org/jline/jline_terminal" + ], + runtime_deps = [ + ":jline_native" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "jline_terminal_jna", + jars = [ + "//external:jar/org/jline/jline_terminal_jna" + ], + runtime_deps = [ + "//3rdparty/jvm/net/java/dev/jna:jna", + ":jline_terminal" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/lz4/BUILD b/3rdparty/jvm/org/lz4/BUILD new file mode 100644 index 00000000..5fa920ca --- /dev/null +++ b/3rdparty/jvm/org/lz4/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "lz4_java", + jars = [ + "//external:jar/org/lz4/lz4_java" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/scala_lang/BUILD b/3rdparty/jvm/org/scala_lang/BUILD index a9a9d19a..0c9b6e9d 100644 --- a/3rdparty/jvm/org/scala_lang/BUILD +++ b/3rdparty/jvm/org/scala_lang/BUILD @@ -1,4 +1,34 @@ load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "scala3_compiler", + jars = [ + "//external:jar/org/scala_lang/scala3_compiler_3" + ], + runtime_deps = [ + "//3rdparty/jvm/org/jline:jline_reader", + "//3rdparty/jvm/org/jline:jline_terminal", + "//3rdparty/jvm/org/jline:jline_terminal_jna", + "//3rdparty/jvm/org/scala_lang/modules:scala_asm", + "//3rdparty/jvm/org/scala_sbt:compiler_interface", + ":scala3_interfaces", + ":scala3_library", + ":tasty_core" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala3_interfaces", + jars = [ + "//external:jar/org/scala_lang/scala3_interfaces" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + scala_import( name = "scala3_library", exports = [ @@ -8,3 +38,84 @@ scala_import( "//3rdparty/jvm:__subpackages__" ] ) + +scala_import( + name = "scala3_presentation_compiler", + jars = [ + "//external:jar/org/scala_lang/scala3_presentation_compiler_3" + ], + runtime_deps = [ + "//3rdparty/jvm/io/get_coursier:interface", + "//3rdparty/jvm/org/eclipse/lsp4j:org_eclipse_lsp4j", + "//3rdparty/jvm/org/lz4:lz4_java", + "//3rdparty/jvm/org/scalameta:mtags_interfaces", + ":scala3_compiler", + ":scala3_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_compiler", + jars = [ + "//external:jar/org/scala_lang/scala_compiler" + ], + runtime_deps = [ + "//3rdparty/jvm/io/github/java_diff_utils:java_diff_utils", + "//3rdparty/jvm/net/java/dev/jna:jna", + "//3rdparty/jvm/org/jline:jline", + ":scala_library", + ":scala_reflect" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_library", + exports = [ + "@scala_library_2_13//jar" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_reflect", + exports = [ + "@scala_reflect_2_13//jar" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalap", + jars = [ + "//external:jar/org/scala_lang/scalap" + ], + runtime_deps = [ + ":scala_compiler" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "tasty_core", + jars = [ + "//external:jar/org/scala_lang/tasty_core_3" + ], + runtime_deps = [ + ":scala3_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/scala_lang/modules/BUILD b/3rdparty/jvm/org/scala_lang/modules/BUILD new file mode 100644 index 00000000..692966ce --- /dev/null +++ b/3rdparty/jvm/org/scala_lang/modules/BUILD @@ -0,0 +1,23 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "scala_asm", + jars = [ + "//external:jar/org/scala_lang/modules/scala_asm" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scala_collection_compat", + jars = [ + "//external:jar/org/scala_lang/modules/scala_collection_compat_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/scala_sbt/BUILD b/3rdparty/jvm/org/scala_sbt/BUILD new file mode 100644 index 00000000..3655a258 --- /dev/null +++ b/3rdparty/jvm/org/scala_sbt/BUILD @@ -0,0 +1,23 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "compiler_interface", + jars = [ + "//external:jar/org/scala_sbt/compiler_interface" + ], + runtime_deps = [ + ":util_interface" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "util_interface", + jars = [ + "//external:jar/org/scala_sbt/util_interface" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/scalameta/BUILD b/3rdparty/jvm/org/scalameta/BUILD new file mode 100644 index 00000000..57006465 --- /dev/null +++ b/3rdparty/jvm/org/scalameta/BUILD @@ -0,0 +1,158 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "common", + jars = [ + "//external:jar/org/scalameta/common_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/lihaoyi:sourcecode", + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_core", + jars = [ + "//external:jar/org/scalameta/metaconfig_core_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang/modules:scala_collection_compat", + "//3rdparty/jvm/org/scala_lang:scala_library", + "//3rdparty/jvm/org/scala_lang:scala_reflect", + "//3rdparty/jvm/org/typelevel:paiges_core", + ":metaconfig_pprint" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_pprint", + jars = [ + "//external:jar/org/scalameta/metaconfig_pprint_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/lihaoyi:fansi", + "//3rdparty/jvm/org/scala_lang:scala_compiler", + "//3rdparty/jvm/org/scala_lang:scala_library", + "//3rdparty/jvm/org/scala_lang:scala_reflect" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "metaconfig_typesafe_config", + jars = [ + "//external:jar/org/scalameta/metaconfig_typesafe_config_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/typesafe:config", + "//3rdparty/jvm/org/scala_lang:scala_library", + ":metaconfig_core" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +java_import( + name = "mtags_interfaces", + jars = [ + "//external:jar/org/scalameta/mtags_interfaces" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "parsers", + jars = [ + "//external:jar/org/scalameta/parsers_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library", + ":trees" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "scalameta", + jars = [ + "//external:jar/org/scalameta/scalameta_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library", + "//3rdparty/jvm/org/scala_lang:scalap", + ":parsers" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "semanticdb_scalac", + jars = [ + "//external:jar/org/scalameta/semanticdb_scalac_2_13_15" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//visibility:public" + ] +) + +scala_import( + name = "semanticdb_scalac_core", + jars = [ + "//external:jar/org/scalameta/semanticdb_scalac_core_2_13_15" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_compiler", + "//3rdparty/jvm/org/scala_lang:scala_library", + ":semanticdb_shared" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "semanticdb_shared", + jars = [ + "//external:jar/org/scalameta/semanticdb_shared_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/com/thesamet/scalapb:scalapb_runtime", + "//3rdparty/jvm/org/scala_lang:scala_library", + ":scalameta" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + +scala_import( + name = "trees", + jars = [ + "//external:jar/org/scalameta/trees_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library", + ":common" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/slf4j/BUILD b/3rdparty/jvm/org/slf4j/BUILD new file mode 100644 index 00000000..61f443b9 --- /dev/null +++ b/3rdparty/jvm/org/slf4j/BUILD @@ -0,0 +1,10 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +java_import( + name = "slf4j_api", + jars = [ + "//external:jar/org/slf4j/slf4j_api" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/jvm/org/typelevel/BUILD b/3rdparty/jvm/org/typelevel/BUILD new file mode 100644 index 00000000..62fc4add --- /dev/null +++ b/3rdparty/jvm/org/typelevel/BUILD @@ -0,0 +1,13 @@ +load("@rules_scala3//rules:scala.bzl", "scala_import") +scala_import( + name = "paiges_core", + jars = [ + "//external:jar/org/typelevel/paiges_core_2_13" + ], + runtime_deps = [ + "//3rdparty/jvm/org/scala_lang:scala_library" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) diff --git a/3rdparty/workspace.bzl b/3rdparty/workspace.bzl index b88ca2f7..a9f0a85d 100644 --- a/3rdparty/workspace.bzl +++ b/3rdparty/workspace.bzl @@ -39,14 +39,77 @@ def jar_artifact_callback(hash): def list_dependencies(): return [ + {"artifact":"ch.epfl.scala:scalafix-cli_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-cli_3.5.1/0.13.0/scalafix-cli_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_cli_3_5_1","actual":"@ch_epfl_scala_scalafix_cli_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_cli_3_5_1"}, + {"artifact":"ch.epfl.scala:scalafix-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-core_2.13/0.13.0/scalafix-core_2.13-0.13.0.jar","name":"ch_epfl_scala_scalafix_core_2_13","actual":"@ch_epfl_scala_scalafix_core_2_13//jar","bind": "jar/ch/epfl/scala/scalafix_core_2_13"}, + {"artifact":"ch.epfl.scala:scalafix-interfaces:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-interfaces/0.13.0/scalafix-interfaces-0.13.0.jar","name":"ch_epfl_scala_scalafix_interfaces","actual":"@ch_epfl_scala_scalafix_interfaces//jar","bind": "jar/ch/epfl/scala/scalafix_interfaces"}, + {"artifact":"ch.epfl.scala:scalafix-reflect_2.13.15:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-reflect_2.13.15/0.13.0/scalafix-reflect_2.13.15-0.13.0.jar","name":"ch_epfl_scala_scalafix_reflect_2_13_15","actual":"@ch_epfl_scala_scalafix_reflect_2_13_15//jar","bind": "jar/ch/epfl/scala/scalafix_reflect_2_13_15"}, + {"artifact":"ch.epfl.scala:scalafix-rules_3.5.1:0.13.0","url":"https://repo1.maven.org/maven2/ch/epfl/scala/scalafix-rules_3.5.1/0.13.0/scalafix-rules_3.5.1-0.13.0.jar","name":"ch_epfl_scala_scalafix_rules_3_5_1","actual":"@ch_epfl_scala_scalafix_rules_3_5_1//jar","bind": "jar/ch/epfl/scala/scalafix_rules_3_5_1"}, {"artifact":"com.github.scopt:scopt_3:4.1.0","url":"https://repo1.maven.org/maven2/com/github/scopt/scopt_3/4.1.0/scopt_3-4.1.0.jar","name":"com_github_scopt_scopt_3","actual":"@com_github_scopt_scopt_3//jar","bind": "jar/com/github/scopt/scopt_3"}, + {"artifact":"com.google.code.findbugs:jsr305:3.0.2","url":"https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar","name":"com_google_code_findbugs_jsr305","actual":"@com_google_code_findbugs_jsr305//jar","bind": "jar/com/google/code/findbugs/jsr305"}, + {"artifact":"com.google.code.gson:gson:2.10.1","url":"https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar","name":"com_google_code_gson_gson","actual":"@com_google_code_gson_gson//jar","bind": "jar/com/google/code/gson/gson"}, + {"artifact":"com.google.errorprone:error_prone_annotations:2.3.4","url":"https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar","name":"com_google_errorprone_error_prone_annotations","actual":"@com_google_errorprone_error_prone_annotations//jar","bind": "jar/com/google/errorprone/error_prone_annotations"}, + {"artifact":"com.google.guava:failureaccess:1.0.1","url":"https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar","name":"com_google_guava_failureaccess","actual":"@com_google_guava_failureaccess//jar","bind": "jar/com/google/guava/failureaccess"}, + {"artifact":"com.google.guava:guava:30.1-jre","url":"https://repo1.maven.org/maven2/com/google/guava/guava/30.1-jre/guava-30.1-jre.jar","name":"com_google_guava_guava","actual":"@com_google_guava_guava//jar","bind": "jar/com/google/guava/guava"}, + {"artifact":"com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava","url":"https://repo1.maven.org/maven2/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar","name":"com_google_guava_listenablefuture","actual":"@com_google_guava_listenablefuture//jar","bind": "jar/com/google/guava/listenablefuture"}, + {"artifact":"com.google.j2objc:j2objc-annotations:1.3","url":"https://repo1.maven.org/maven2/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar","name":"com_google_j2objc_j2objc_annotations","actual":"@com_google_j2objc_j2objc_annotations//jar","bind": "jar/com/google/j2objc/j2objc_annotations"}, + {"artifact":"com.google.protobuf:protobuf-java:3.19.6","url":"https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.19.6/protobuf-java-3.19.6.jar","name":"com_google_protobuf_protobuf_java","actual":"@com_google_protobuf_protobuf_java//jar","bind": "jar/com/google/protobuf/protobuf_java"}, + {"artifact":"com.googlecode.java-diff-utils:diffutils:1.3.0","url":"https://repo1.maven.org/maven2/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar","name":"com_googlecode_java_diff_utils_diffutils","actual":"@com_googlecode_java_diff_utils_diffutils//jar","bind": "jar/com/googlecode/java_diff_utils/diffutils"}, + {"artifact":"com.googlecode.javaewah:JavaEWAH:1.1.13","url":"https://repo1.maven.org/maven2/com/googlecode/javaewah/JavaEWAH/1.1.13/JavaEWAH-1.1.13.jar","name":"com_googlecode_javaewah_JavaEWAH","actual":"@com_googlecode_javaewah_JavaEWAH//jar","bind": "jar/com/googlecode/javaewah/JavaEWAH"}, + {"artifact":"com.lihaoyi:fansi_2.13:0.5.0","url":"https://repo1.maven.org/maven2/com/lihaoyi/fansi_2.13/0.5.0/fansi_2.13-0.5.0.jar","name":"com_lihaoyi_fansi_2_13","actual":"@com_lihaoyi_fansi_2_13//jar","bind": "jar/com/lihaoyi/fansi_2_13"}, + {"artifact":"com.lihaoyi:sourcecode_2.13:0.4.2","url":"https://repo1.maven.org/maven2/com/lihaoyi/sourcecode_2.13/0.4.2/sourcecode_2.13-0.4.2.jar","name":"com_lihaoyi_sourcecode_2_13","actual":"@com_lihaoyi_sourcecode_2_13//jar","bind": "jar/com/lihaoyi/sourcecode_2_13"}, + {"artifact":"com.martiansoftware:nailgun-server:0.9.1","url":"https://repo1.maven.org/maven2/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar","name":"com_martiansoftware_nailgun_server","actual":"@com_martiansoftware_nailgun_server//jar","bind": "jar/com/martiansoftware/nailgun_server"}, + {"artifact":"com.thesamet.scalapb:lenses_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/lenses_2.13/0.11.15/lenses_2.13-0.11.15.jar","name":"com_thesamet_scalapb_lenses_2_13","actual":"@com_thesamet_scalapb_lenses_2_13//jar","bind": "jar/com/thesamet/scalapb/lenses_2_13"}, + {"artifact":"com.thesamet.scalapb:scalapb-runtime_2.13:0.11.15","url":"https://repo1.maven.org/maven2/com/thesamet/scalapb/scalapb-runtime_2.13/0.11.15/scalapb-runtime_2.13-0.11.15.jar","name":"com_thesamet_scalapb_scalapb_runtime_2_13","actual":"@com_thesamet_scalapb_scalapb_runtime_2_13//jar","bind": "jar/com/thesamet/scalapb/scalapb_runtime_2_13"}, + {"artifact":"com.typesafe:config:1.4.3","url":"https://repo1.maven.org/maven2/com/typesafe/config/1.4.3/config-1.4.3.jar","name":"com_typesafe_config","actual":"@com_typesafe_config//jar","bind": "jar/com/typesafe/config"}, + {"artifact":"io.get-coursier:interface:1.0.20","url":"https://repo1.maven.org/maven2/io/get-coursier/interface/1.0.20/interface-1.0.20.jar","name":"io_get_coursier_interface","actual":"@io_get_coursier_interface//jar","bind": "jar/io/get_coursier/interface"}, + {"artifact":"io.github.java-diff-utils:java-diff-utils:4.12","url":"https://repo1.maven.org/maven2/io/github/java-diff-utils/java-diff-utils/4.12/java-diff-utils-4.12.jar","name":"io_github_java_diff_utils_java_diff_utils","actual":"@io_github_java_diff_utils_java_diff_utils//jar","bind": "jar/io/github/java_diff_utils/java_diff_utils"}, + {"artifact":"net.java.dev.jna:jna:5.15.0","url":"https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.15.0/jna-5.15.0.jar","name":"net_java_dev_jna_jna","actual":"@net_java_dev_jna_jna//jar","bind": "jar/net/java/dev/jna/jna"}, {"artifact":"net.sf.jopt-simple:jopt-simple:5.0.4","url":"https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar","name":"net_sf_jopt_simple_jopt_simple","actual":"@net_sf_jopt_simple_jopt_simple//jar","bind": "jar/net/sf/jopt_simple/jopt_simple"}, + {"artifact":"org.apache.commons:commons-lang3:3.14.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar","name":"org_apache_commons_commons_lang3","actual":"@org_apache_commons_commons_lang3//jar","bind": "jar/org/apache/commons/commons_lang3"}, {"artifact":"org.apache.commons:commons-math3:3.6.1","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.6.1/commons-math3-3.6.1.jar","name":"org_apache_commons_commons_math3","actual":"@org_apache_commons_commons_math3//jar","bind": "jar/org/apache/commons/commons_math3"}, + {"artifact":"org.apache.commons:commons-text:1.12.0","url":"https://repo1.maven.org/maven2/org/apache/commons/commons-text/1.12.0/commons-text-1.12.0.jar","name":"org_apache_commons_commons_text","actual":"@org_apache_commons_commons_text//jar","bind": "jar/org/apache/commons/commons_text"}, + {"artifact":"org.checkerframework:checker-qual:3.5.0","url":"https://repo1.maven.org/maven2/org/checkerframework/checker-qual/3.5.0/checker-qual-3.5.0.jar","name":"org_checkerframework_checker_qual","actual":"@org_checkerframework_checker_qual//jar","bind": "jar/org/checkerframework/checker_qual"}, + {"artifact":"org.eclipse.jgit:org.eclipse.jgit:5.13.3.202401111512-r","url":"https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/5.13.3.202401111512-r/org.eclipse.jgit-5.13.3.202401111512-r.jar","name":"org_eclipse_jgit_org_eclipse_jgit","actual":"@org_eclipse_jgit_org_eclipse_jgit//jar","bind": "jar/org/eclipse/jgit/org_eclipse_jgit"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j/0.20.1/org.eclipse.lsp4j-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.generator:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.generator/0.20.1/org.eclipse.lsp4j.generator-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_generator","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_generator//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_generator"}, + {"artifact":"org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.20.1","url":"https://repo1.maven.org/maven2/org/eclipse/lsp4j/org.eclipse.lsp4j.jsonrpc/0.20.1/org.eclipse.lsp4j.jsonrpc-0.20.1.jar","name":"org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc","actual":"@org_eclipse_lsp4j_org_eclipse_lsp4j_jsonrpc//jar","bind": "jar/org/eclipse/lsp4j/org_eclipse_lsp4j_jsonrpc"}, + {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib/2.28.0/org.eclipse.xtend.lib-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib"}, + {"artifact":"org.eclipse.xtend:org.eclipse.xtend.lib.macro:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.28.0/org.eclipse.xtend.lib.macro-2.28.0.jar","name":"org_eclipse_xtend_org_eclipse_xtend_lib_macro","actual":"@org_eclipse_xtend_org_eclipse_xtend_lib_macro//jar","bind": "jar/org/eclipse/xtend/org_eclipse_xtend_lib_macro"}, + {"artifact":"org.eclipse.xtext:org.eclipse.xtext.xbase.lib:2.28.0","url":"https://repo1.maven.org/maven2/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.28.0/org.eclipse.xtext.xbase.lib-2.28.0.jar","name":"org_eclipse_xtext_org_eclipse_xtext_xbase_lib","actual":"@org_eclipse_xtext_org_eclipse_xtext_xbase_lib//jar","bind": "jar/org/eclipse/xtext/org_eclipse_xtext_xbase_lib"}, + {"artifact":"org.jline:jline:3.26.3","url":"https://repo1.maven.org/maven2/org/jline/jline/3.26.3/jline-3.26.3.jar","name":"org_jline_jline","actual":"@org_jline_jline//jar","bind": "jar/org/jline/jline"}, + {"artifact":"org.jline:jline-native:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-native/3.27.0/jline-native-3.27.0.jar","name":"org_jline_jline_native","actual":"@org_jline_jline_native//jar","bind": "jar/org/jline/jline_native"}, + {"artifact":"org.jline:jline-reader:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-reader/3.27.0/jline-reader-3.27.0.jar","name":"org_jline_jline_reader","actual":"@org_jline_jline_reader//jar","bind": "jar/org/jline/jline_reader"}, + {"artifact":"org.jline:jline-terminal:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal/3.27.0/jline-terminal-3.27.0.jar","name":"org_jline_jline_terminal","actual":"@org_jline_jline_terminal//jar","bind": "jar/org/jline/jline_terminal"}, + {"artifact":"org.jline:jline-terminal-jna:3.27.0","url":"https://repo1.maven.org/maven2/org/jline/jline-terminal-jna/3.27.0/jline-terminal-jna-3.27.0.jar","name":"org_jline_jline_terminal_jna","actual":"@org_jline_jline_terminal_jna//jar","bind": "jar/org/jline/jline_terminal_jna"}, + {"artifact":"org.lz4:lz4-java:1.8.0","url":"https://repo1.maven.org/maven2/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar","name":"org_lz4_lz4_java","actual":"@org_lz4_lz4_java//jar","bind": "jar/org/lz4/lz4_java"}, {"artifact":"org.openjdk.jmh:jmh-core:1.37","url":"https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-core/1.37/jmh-core-1.37.jar","name":"org_openjdk_jmh_jmh_core","actual":"@org_openjdk_jmh_jmh_core//jar","bind": "jar/org/openjdk/jmh/jmh_core"}, {"artifact":"org.openjdk.jmh:jmh-generator-asm:1.37","url":"https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-asm/1.37/jmh-generator-asm-1.37.jar","name":"org_openjdk_jmh_jmh_generator_asm","actual":"@org_openjdk_jmh_jmh_generator_asm//jar","bind": "jar/org/openjdk/jmh/jmh_generator_asm"}, {"artifact":"org.openjdk.jmh:jmh-generator-bytecode:1.37","url":"https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-bytecode/1.37/jmh-generator-bytecode-1.37.jar","name":"org_openjdk_jmh_jmh_generator_bytecode","actual":"@org_openjdk_jmh_jmh_generator_bytecode//jar","bind": "jar/org/openjdk/jmh/jmh_generator_bytecode"}, {"artifact":"org.openjdk.jmh:jmh-generator-reflection:1.37","url":"https://repo1.maven.org/maven2/org/openjdk/jmh/jmh-generator-reflection/1.37/jmh-generator-reflection-1.37.jar","name":"org_openjdk_jmh_jmh_generator_reflection","actual":"@org_openjdk_jmh_jmh_generator_reflection//jar","bind": "jar/org/openjdk/jmh/jmh_generator_reflection"}, {"artifact":"org.ow2.asm:asm:9.0","url":"https://repo1.maven.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar","name":"org_ow2_asm_asm","actual":"@org_ow2_asm_asm//jar","bind": "jar/org/ow2/asm/asm"}, + {"artifact":"org.scala-lang.modules:scala-asm:9.7.0-scala-2","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-asm/9.7.0-scala-2/scala-asm-9.7.0-scala-2.jar","name":"org_scala_lang_modules_scala_asm","actual":"@org_scala_lang_modules_scala_asm//jar","bind": "jar/org/scala_lang/modules/scala_asm"}, + {"artifact":"org.scala-lang.modules:scala-collection-compat_2.13:2.12.0","url":"https://repo1.maven.org/maven2/org/scala-lang/modules/scala-collection-compat_2.13/2.12.0/scala-collection-compat_2.13-2.12.0.jar","name":"org_scala_lang_modules_scala_collection_compat_2_13","actual":"@org_scala_lang_modules_scala_collection_compat_2_13//jar","bind": "jar/org/scala_lang/modules/scala_collection_compat_2_13"}, + {"artifact":"org.scala-lang:scala3-compiler_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.6.1/scala3-compiler_3-3.6.1.jar","name":"org_scala_lang_scala3_compiler_3","actual":"@org_scala_lang_scala3_compiler_3//jar","bind": "jar/org/scala_lang/scala3_compiler_3"}, + {"artifact":"org.scala-lang:scala3-interfaces:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-interfaces/3.6.1/scala3-interfaces-3.6.1.jar","name":"org_scala_lang_scala3_interfaces","actual":"@org_scala_lang_scala3_interfaces//jar","bind": "jar/org/scala_lang/scala3_interfaces"}, + {"artifact":"org.scala-lang:scala3-presentation-compiler_3:3.5.1","url":"https://repo1.maven.org/maven2/org/scala-lang/scala3-presentation-compiler_3/3.5.1/scala3-presentation-compiler_3-3.5.1.jar","name":"org_scala_lang_scala3_presentation_compiler_3","actual":"@org_scala_lang_scala3_presentation_compiler_3//jar","bind": "jar/org/scala_lang/scala3_presentation_compiler_3"}, + {"artifact":"org.scala-lang:scala-compiler:2.13.15","url":"https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.13.15/scala-compiler-2.13.15.jar","name":"org_scala_lang_scala_compiler","actual":"@org_scala_lang_scala_compiler//jar","bind": "jar/org/scala_lang/scala_compiler"}, + {"artifact":"org.scala-lang:scalap:2.13.12","url":"https://repo1.maven.org/maven2/org/scala-lang/scalap/2.13.12/scalap-2.13.12.jar","name":"org_scala_lang_scalap","actual":"@org_scala_lang_scalap//jar","bind": "jar/org/scala_lang/scalap"}, + {"artifact":"org.scala-lang:tasty-core_3:3.6.1","url":"https://repo1.maven.org/maven2/org/scala-lang/tasty-core_3/3.6.1/tasty-core_3-3.6.1.jar","name":"org_scala_lang_tasty_core_3","actual":"@org_scala_lang_tasty_core_3//jar","bind": "jar/org/scala_lang/tasty_core_3"}, + {"artifact":"org.scala-sbt:compiler-interface:1.9.6","url":"https://repo1.maven.org/maven2/org/scala-sbt/compiler-interface/1.9.6/compiler-interface-1.9.6.jar","name":"org_scala_sbt_compiler_interface","actual":"@org_scala_sbt_compiler_interface//jar","bind": "jar/org/scala_sbt/compiler_interface"}, + {"artifact":"org.scala-sbt:util-interface:1.9.8","url":"https://repo1.maven.org/maven2/org/scala-sbt/util-interface/1.9.8/util-interface-1.9.8.jar","name":"org_scala_sbt_util_interface","actual":"@org_scala_sbt_util_interface//jar","bind": "jar/org/scala_sbt/util_interface"}, + {"artifact":"org.scalameta:common_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/common_2.13/4.10.1/common_2.13-4.10.1.jar","name":"org_scalameta_common_2_13","actual":"@org_scalameta_common_2_13//jar","bind": "jar/org/scalameta/common_2_13"}, + {"artifact":"org.scalameta:metaconfig-core_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-core_2.13/0.13.0/metaconfig-core_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_core_2_13","actual":"@org_scalameta_metaconfig_core_2_13//jar","bind": "jar/org/scalameta/metaconfig_core_2_13"}, + {"artifact":"org.scalameta:metaconfig-pprint_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-pprint_2.13/0.13.0/metaconfig-pprint_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_pprint_2_13","actual":"@org_scalameta_metaconfig_pprint_2_13//jar","bind": "jar/org/scalameta/metaconfig_pprint_2_13"}, + {"artifact":"org.scalameta:metaconfig-typesafe-config_2.13:0.13.0","url":"https://repo1.maven.org/maven2/org/scalameta/metaconfig-typesafe-config_2.13/0.13.0/metaconfig-typesafe-config_2.13-0.13.0.jar","name":"org_scalameta_metaconfig_typesafe_config_2_13","actual":"@org_scalameta_metaconfig_typesafe_config_2_13//jar","bind": "jar/org/scalameta/metaconfig_typesafe_config_2_13"}, + {"artifact":"org.scalameta:mtags-interfaces:1.3.2","url":"https://repo1.maven.org/maven2/org/scalameta/mtags-interfaces/1.3.2/mtags-interfaces-1.3.2.jar","name":"org_scalameta_mtags_interfaces","actual":"@org_scalameta_mtags_interfaces//jar","bind": "jar/org/scalameta/mtags_interfaces"}, + {"artifact":"org.scalameta:parsers_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/parsers_2.13/4.10.1/parsers_2.13-4.10.1.jar","name":"org_scalameta_parsers_2_13","actual":"@org_scalameta_parsers_2_13//jar","bind": "jar/org/scalameta/parsers_2_13"}, + {"artifact":"org.scalameta:scalameta_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/scalameta_2.13/4.10.1/scalameta_2.13-4.10.1.jar","name":"org_scalameta_scalameta_2_13","actual":"@org_scalameta_scalameta_2_13//jar","bind": "jar/org/scalameta/scalameta_2_13"}, + {"artifact":"org.scalameta:semanticdb-scalac_2.13.15:4.12.0","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac_2.13.15/4.12.0/semanticdb-scalac_2.13.15-4.12.0.jar","name":"org_scalameta_semanticdb_scalac_2_13_15","actual":"@org_scalameta_semanticdb_scalac_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_2_13_15"}, + {"artifact":"org.scalameta:semanticdb-scalac-core_2.13.15:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-scalac-core_2.13.15/4.10.1/semanticdb-scalac-core_2.13.15-4.10.1.jar","name":"org_scalameta_semanticdb_scalac_core_2_13_15","actual":"@org_scalameta_semanticdb_scalac_core_2_13_15//jar","bind": "jar/org/scalameta/semanticdb_scalac_core_2_13_15"}, + {"artifact":"org.scalameta:semanticdb-shared_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/semanticdb-shared_2.13/4.10.1/semanticdb-shared_2.13-4.10.1.jar","name":"org_scalameta_semanticdb_shared_2_13","actual":"@org_scalameta_semanticdb_shared_2_13//jar","bind": "jar/org/scalameta/semanticdb_shared_2_13"}, + {"artifact":"org.scalameta:trees_2.13:4.10.1","url":"https://repo1.maven.org/maven2/org/scalameta/trees_2.13/4.10.1/trees_2.13-4.10.1.jar","name":"org_scalameta_trees_2_13","actual":"@org_scalameta_trees_2_13//jar","bind": "jar/org/scalameta/trees_2_13"}, + {"artifact":"org.slf4j:slf4j-api:1.7.36","url":"https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar","name":"org_slf4j_slf4j_api","actual":"@org_slf4j_slf4j_api//jar","bind": "jar/org/slf4j/slf4j_api"}, + {"artifact":"org.typelevel:paiges-core_2.13:0.4.4","url":"https://repo1.maven.org/maven2/org/typelevel/paiges-core_2.13/0.4.4/paiges-core_2.13-0.4.4.jar","name":"org_typelevel_paiges_core_2_13","actual":"@org_typelevel_paiges_core_2_13//jar","bind": "jar/org/typelevel/paiges_core_2_13"}, ] def maven_dependencies(callback = jar_artifact_callback): diff --git a/BUILD b/BUILD index b3d98dc7..8289c2e2 100644 --- a/BUILD +++ b/BUILD @@ -1,8 +1,6 @@ load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") load("@rules_scala3//rules:scala.bzl", "configure_zinc_scala") -load("@rules_scala3//scala3:toolchain.bzl", "scala_toolchain") load("@rules_scala3//rules/scalafix:scalafix_runner.bzl", "scalafix_runner") -load('//scala3:repositories.bzl', _default_scalacopts = 'GLOBAL_SCALACOPTS') filegroup( name = "dependencies", @@ -18,10 +16,15 @@ scala_deps( scalafix_runner( name = "run_scalafix", - toolchain = "//:scalafix_toolchain", - targets = ["//..."], + targets = [ + "//scala/common/sbt-testing:common", + "//scala/common/worker:worker", + "//scala/workers/jacoco/instrumenter:instrumenter", + ], ) +scala_version = "3.6.2-RC1" + runtime_classpath_3 = [ "@scala3_library//jar", "@scala_library_2_13//jar", @@ -34,14 +37,6 @@ compiler_classpath_3 = runtime_classpath_3 + [ "@scala_asm//jar", ] -scala_version = "3.6.2-RC1" - -scalac_scalafix_opts = [ - "-Wunused:all", - "-Ywarn-unused", - "-Xsemanticdb" -] - configure_zinc_scala( name = "zinc_3", compiler_bridge = "@scala3_sbt_bridge//jar", @@ -51,21 +46,3 @@ configure_zinc_scala( visibility = ["//visibility:public"], ) -scala_toolchain( - name = "scalafix_toolchain_impl", - compiler_bridge = "@scala3_sbt_bridge//jar", - compiler_classpath = compiler_classpath_3, - enable_semanticdb = True, - global_scalacopts = _default_scalacopts + scalac_scalafix_opts, - runtime_classpath = runtime_classpath_3, - scala_version = scala_version, - semanticdb_bundle_in_jar = True, -) - -toolchain( - name = "scalafix_toolchain", - toolchain = ":scalafix_toolchain_impl", - toolchain_type = "//scala3:toolchain_type", - visibility = ["//visibility:public"], -) - diff --git a/Dependencies.scala b/Dependencies.scala index 54450131..9642271e 100644 --- a/Dependencies.scala +++ b/Dependencies.scala @@ -27,5 +27,7 @@ object Dependencies: "org.openjdk.jmh" % "jmh-generator-bytecode" % jmhV, "org.openjdk.jmh" % "jmh-generator-reflection" % jmhV, "org.openjdk.jmh" % "jmh-generator-asm" % jmhV, - "com.github.scopt" %% "scopt" % "4.1.0" + "com.github.scopt" %% "scopt" % "4.1.0", + "ch.epfl.scala" % "scalafix-cli_3.5.1" % "0.13.0", + "org.scalameta" % "semanticdb-scalac_2.13.15" % "4.12.0" ) diff --git a/WORKSPACE b/WORKSPACE index 193b8e01..c4ecbf96 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -68,7 +68,9 @@ load("//rules/scala:init.bzl", "rules_scala3_init") rules_scala3_init() -scala_register_toolchains(default_compiler = "bootstrap") +scala_register_toolchains() + +register_toolchains("@rules_scala3//rules/scalafix:scalafix_toolchain") load("//mezel_compatibility:repositories.bzl", "mezel_compatibility_repository") diff --git a/rules/scalafix/BUILD b/rules/scalafix/BUILD index e69de29b..fcf98e2b 100644 --- a/rules/scalafix/BUILD +++ b/rules/scalafix/BUILD @@ -0,0 +1,60 @@ +load("@rules_scala3//rules:scala.bzl", "scala_binary") +load("@rules_scala3//scala3:toolchain.bzl", "scala_toolchain") +load('@rules_scala3//scala3:repositories.bzl', _default_scalacopts = 'GLOBAL_SCALACOPTS') + +scala_version = "3.6.2-RC1" + +scalac_scalafix_opts = [ + "-Wunused:all", + "-Ywarn-unused", + "-Xsemanticdb" +] + +runtime_classpath_3 = [ + "@scala3_library//jar", + "@scala_library_2_13//jar", +] + +compiler_classpath_3 = runtime_classpath_3 + [ + "@scala3_compiler//jar", + "@scala3_interfaces//jar", + "@scala_tasty_core_3//jar", + "@scala_asm//jar", +] + +scala_binary( + name = "bin", + srcs = glob(include = ["*.scala"]), + main_class = "rules_scala3.rules.scalafix.Main", + visibility = ["//visibility:public"], + deps = ["//3rdparty/jvm/ch/epfl/scala:scalafix_cli"], +) + +toolchain_type( + name = "scalafix_toolchain_type", + visibility = ["//visibility:public"], +) + +scala_toolchain( + name = "scalafix_toolchain_impl", + compiler_bridge = "@scala3_sbt_bridge//jar", + compiler_classpath = compiler_classpath_3, + enable_semanticdb = True, + global_scalacopts = _default_scalacopts + scalac_scalafix_opts, + runtime_classpath = runtime_classpath_3, + scala_version = scala_version, + semanticdb_bundle_in_jar = True, +) + +toolchain( + name = "scalafix_toolchain", + toolchain = ":scalafix_toolchain_impl", + toolchain_type = "@rules_scala3//rules/scalafix:scalafix_toolchain_type", + visibility = ["//visibility:public"], +) + +filegroup( + name = "bzl", + srcs = glob(["**/*.bzl"]), + visibility = ["//rules:__pkg__"], +)