- Update default protoc to 3.21.7
- For nix-os: support executing statically linked protoc (for versions >=3.23.0)
- Update default protoc to 3.19.2.
- Add option
PB.manifestProcessing
(defaults to true) that allows you to opt-opt of the manifest processing feature of sbt-protoc that automatically adds option protos as a source file to protoc.
PB.targets
directories are no longer added tomanagedSourceDirectories
as the underlying bug in intellij which prompted that change has been fixed in IntelliJ 2021.1.1.
- This version is published to maven instead of bintray.
- Reduce the amount of artifact resolution & stamping (#227)
- Honor
cacheArtifactResolution := false
(#226) - Don't run protoc with only Scalapb-Options-Proto sources (#225)
- Add
PB.targets
directories tomanagedSourceDirectories
so that IDEs are aware of the generated sources in them and can provide autocompletion etc. - Update default version of protoc to 3.15.6
- Compile protos brought by
ProtobufSrcConfig
only once per project (#219) - Better cache invalidation (#217)
- A plugin downloaded from a maven repository and injected via
asProtocPlugin()
can now be used in several PB.targets (#220) - Protos referenced in the
ScalaPB-Options-Proto
manifest attribute in JARs included asProtobufConfig
are now automatically added toprotoSources
, allowing seamless integration with third-party JARs containing code generated by ScalaPB and compiled with different options that the current project (see scalapb/scalapb-validate#70)
- don't inherit parent configs' values for targets/protocOptions (c9ed1c2)
PB.runProtoc
has been changed to aTaskKey[ProtocRunner]
which can customize how protoc is being invoked. The default implementation runsPB.protocExecutable
which in turns downloads and caches protoc executable from Maven. The version can be controlled withPB.protocVersion
. If you want to run a locally installed protoc, it is suggested to customizePB.protocExecutable
directly. See also ProtocRunner source.
- Avoid unnecessary warnings by do not passing non-existant directories to protoc (#197)
-
protoc executable is now cached under the user cache directory. The path used is platform dependent:
- Linux/BSD/SOLARIS:
$XDG_CACHE_HOME/protocbridge/v1
or$HOME/.cache/protocbridge/v1
- Windows:
{FOLDERID_LocalApplicationData}/protocbridge/protocbridge/cache
- OS X:
$HOME/Library/Caches/com.thesamet.scalapb/protocbridge/protocbridge/v1
The value is computed using the directories library and can be overridden by setting
PROTOC_CACHE
environment variable or theprotoc.cache
system property. If both are set, then the environment variable takes precedence. - Linux/BSD/SOLARIS:
- The
protobuf
source directory is now part ofunmanagedSourceDirectories
so that your IDE will take it as a part of your project andunmanagedResourceDirectories
so that the.proto
files will be packed into the resulting JAR.
- Dependency on protoc-jar has been removed. By default, the dependency on a protoc executable is provided through SBT's dependency management. Read below.
- New task key:
protocExecutable: TaskKey[File]
returns a path to a protoc executable. By default this task downloads this file from the maven location specified byprotocDependency
. You can override this task to return a locally installed protoc. - New setting:
protocDependency: SettingKey[ModuleID]
- provides a maven artifact to be downloaded byprotocExecutable
. Defaults to a protoc version matched byPB.protocVersion
. PB.protocVersion
used to have a-v
prefix. This is no longer required and a deprecation warning is issued. The version number is expected to be in x.y.z format (protocjar accepted a format without dots which is no longer supported).runProtoc
has been changed to aTaskKey[Seq[String] => Int]
. The default implementation runsprotocExecutable
with the provided arguments and returns it exit code. SBT's logging facilities are provided to the protoc process. Update: In 1.0.0-RC5,PB.runProtoc
signature had changed again. See changelog entry above.- NixOS workarounds: if the environment variable
NIX_CC
is present (usally ormally provided bynix-shell
), it is used to locate a dynamic linker (by reading$NIX_CC/nix-support/dynamic-linker
). The located dynamic linker is used to runprotoc
as well as downloaded native plugins, for seamless development experience in nix-shell. See #505 and shell.nix. - Deprecated and ignored setting key pythonExe has been removed.
- In earlier versions, if you wanted to generate
.proto
files for theTest
configuration (for protos under src/test/protobuf) you had to include a line likeinConfig(Test)(sbtprotoc.ProtocPlugin.protobufConfigSettings)
. This line is no longer necessary, and in fact cause an error if the protos in Test depend on the Protos in compile.
- Added support for generating descriptor sets.
- Fixed race condition when one project depends on unpacked dependencies from another project.
- Add new configuration protobuf-src that adds the unpacked protos in protoSources
- Updated protoc-jar to 3.11.4