Skip to content

Update #6

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Apr 25, 2025
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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

# Scala Steward: Reformat with scalafmt 3.8.0
00d482c75c16b0791a717e6374de4adf225f8af1

# Scala Steward: Reformat with scalafmt 3.8.6
9556ab3724f06bc35adc5f6a1cc4d21043fb3525
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ jobs:
java-version: "21"
distribution: 'temurin'

- uses: sbt/setup-sbt@v1

- name: restore cache
uses: ./.github/actions/scala_restore_cache
with:
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=3.8.3
version=3.9.2
style = defaultWithAlign
maxColumn = 100
assumeStandardLibraryStripMargin = true
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sbt-protoc
==========
[![CI](https://github.com/thesamet/sbt-protoc/workflows/CI/badge.svg)](https://github.com/thesamet/sbt-protoc/actions?query=workflow%3ACI)

This plugin uses protoc to generate code from proto files. This SBT plugin is
meant to supersede
[sbt-protobuf](https://github.com/sbt/sbt-protobuf/) and
Expand Down
2 changes: 1 addition & 1 deletion examples/scalapb-crossproject/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.5
sbt.version=1.10.7
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.5
sbt.version=1.10.7
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4")

credentials += Credentials(Path.userHome / ".m2" / ".credentials")
resolvers += "internal.repo.read" at "https://nexus.whisk-dev.com/repository/whisk-maven-group/"
addSbtPlugin("com.whisk" % "whisk-sbt-plugin" % "2024.10.29-2357")
addSbtPlugin("com.whisk" % "whisk-sbt-plugin" % "2025.04.09-3153")
12 changes: 6 additions & 6 deletions src/main/scala/sbtprotoc/ProtocPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ object ProtocPlugin extends AutoPlugin {
s"""PB.protocVersion must contain a dot-separated version number. For example: "3.13.0". Got: '${PB.protocVersion.value}'"""
)
}
("com.google.protobuf" % "protoc" % version) asProtocBinary (),
("com.google.protobuf" % "protoc" % version) asProtocBinary ()
},
PB.protocExecutable := {
scala.concurrent.Await.result(
Expand Down Expand Up @@ -465,7 +465,7 @@ object ProtocPlugin extends AutoPlugin {

targets.flatMap {
case Target(DescriptorSetGenerator(), outputFile, _) => Seq(outputFile)
case Target(_, outputDirectory, _) => outputDirectory.allPaths.get
case Target(_, outputDirectory, _) => outputDirectory.allPaths.get()
}.toSet
} else if (schemas.nonEmpty && targets.isEmpty) {
log.info("Protobufs files found, but PB.targets is empty.")
Expand Down Expand Up @@ -552,7 +552,8 @@ object ProtocPlugin extends AutoPlugin {
sources
.toSet[File]
.flatMap(srcDir =>
(srcDir ** (toInclude -- toExclude)).get
(srcDir ** (toInclude -- toExclude))
.get()
.map(_.getAbsoluteFile)
) match {
case protos if protos.nonEmpty =>
Expand Down Expand Up @@ -622,8 +623,7 @@ object ProtocPlugin extends AutoPlugin {
{ (_, prevValue) =>
def stampClasspath(files: Seq[File]) =
// artifact paths can be JARs or directories, so a recursive stamp is needed
FileInfo.hash(files.toSet[File].allPaths.get.toSet)

FileInfo.hash(files.toSet[File].allPaths.get().toSet)
if (prevValue == null) {
// first time this classpath is requested since the start of sbt
val resolved = resolver(artifact)
Expand Down Expand Up @@ -711,7 +711,7 @@ object ProtocPlugin extends AutoPlugin {
val sandboxedArtifactsStamps =
stampedClassLoadersByArtifact.values.map(_._1).toSeq
val inputStamp =
FileInfo.hash(schemas ++ arguments.includePaths.allPaths.get)
FileInfo.hash(schemas ++ arguments.includePaths.allPaths.get())
cachedCompile((arguments, sandboxedArtifactsStamps :+ inputStamp)).toSeq
}
}
Expand Down
Loading