Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ http_archive(
urls = ["https://github.com/google/protobuf/archive/0038ff49af882463c2af9049356eed7df45c3e8e.zip"],
)

load("//rules/scala:workspace.bzl", "scala_repositories", "scala_register_toolchains")
load("//rules/scala:workspace.bzl", "scala_register_toolchains", "scala_repositories")

scala_repositories()

scala_register_toolchains()

load("//rules/scalafmt:workspace.bzl", "scalafmt_repositories", "scalafmt_default_config")
load("//rules/scalafmt:workspace.bzl", "scalafmt_default_config", "scalafmt_repositories")

scalafmt_repositories()

scalafmt_default_config(".scalafmt.conf")

load(
"//rules/scala_proto:workspace.bzl",
"scala_proto_repositories",
"scala_proto_register_toolchains",
"scala_proto_repositories",
)

scala_proto_repositories()
Expand Down
23 changes: 23 additions & 0 deletions docs/stardoc/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,29 @@ Zinc configuration.
</table>


<a name="#ScalaRulePhase"></a>
## ScalaRulePhase

A Scala compiler plugin

### Fields

<table class="params-table">
<colgroup>
<col class="col-param" />
<col class="col-description" />
</colgroup>
<tbody>
<tr id="#ScalaRulePhase_phases">
<td><code>phases</code></td>
<td>
<p>the phases to add</p>
</td>
</tr>
</tbody>
</table>


<a name="#ZincInfo"></a>
## ZincInfo

Expand Down
7 changes: 7 additions & 0 deletions rules/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ ZincConfiguration = provider(
},
)

ScalaRulePhase = provider(
doc = "A Scala compiler plugin",
fields = {
"phases": "the phases to add",
},
)

def _declare_zinc_configuration_implementation(ctx):
return [ZincConfiguration(
compiler_bridge = ctx.files.compiler_bridge,
Expand Down
2 changes: 1 addition & 1 deletion rules/rules_scala/private/compat.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ load(
)
load(
"//rules:scala.bzl",
_scala_library = "scala_library",
_scala_binary = "scala_binary",
_scala_library = "scala_library",
_scala_test = "scala_test",
)
load(
Expand Down
2 changes: 1 addition & 1 deletion rules/scala/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//rules:scala.bzl", "scala_library", "scala_binary", "scala_deps_toolchain", "scala_runner_toolchain")
load("//rules:scala.bzl", "scala_binary", "scala_deps_toolchain", "scala_library", "scala_runner_toolchain")
load("//rules:scalac.bzl", "scalac_binary", "scalac_library")
load("//rules:scalafmt.bzl", "scala_format_test")

Expand Down
9 changes: 4 additions & 5 deletions rules/scala/deps/DepsRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ object DepsRunner extends SimpleMain {
parser
}

protected[this] def work(args: Array[String]) = {
protected[this] def work(args: Array[String]): Unit = {
val namespace = argParser.parseArgs(args)

val label = namespace.getString("label").tail
Expand Down Expand Up @@ -75,11 +75,10 @@ object DepsRunner extends SimpleMain {
println(s"buildozer 'add deps $depLabel' $label")
}

if (add.nonEmpty || remove.nonEmpty) {
sys.exit(1)
if (add.isEmpty && remove.isEmpty) {
try Files.createFile(namespace.get[File]("success").toPath)
catch { case _: FileAlreadyExistsException => }
}

try Files.createFile(namespace.get[File]("success").toPath)
catch { case _: FileAlreadyExistsException => }
}
}
Loading