-
Notifications
You must be signed in to change notification settings - Fork 124
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
Generate version.conf file in runtime jar #1132
Conversation
@@ -23,7 +23,7 @@ lazy val codegen = Project(id = akkaGrpcCodegenId, base = file("codegen")) | |||
val file = assembly.value | |||
Assemblies.mkBatAssembly(file) | |||
}, | |||
buildInfoKeys ++= BuildInfoKey.ofN(organization, name, version, scalaVersion, sbtVersion), | |||
buildInfoKeys ++= Seq[BuildInfoKey](organization, name, version, scalaVersion, sbtVersion), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice to fix this warning :)
project/VersionGenerator.scala
Outdated
object VersionGenerator { | ||
|
||
val settings: Seq[Setting[_]] = inConfig(Compile)( | ||
Seq(resourceGenerators += generateVersion(resourceManaged, _ / "version.conf", """|akka.grpc.version = "%s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I guess :)
The generated
Of course it is possible to fix this by choosing the 'append' strategy, but since apparently AFAICT we're not doing this yet for any of the other sattelite projects yet, perhaps we should consider if we want to let them clash like this? |
I said the same when we added it to Alpakka Kafka. |
// Should no longer be needed from Akka 2.6.6, which includes | ||
// d2afff6bfc29baf0fb03f531fbe3af40a97fd39f | ||
assemblyMergeStrategy in assembly := { | ||
assembly / assemblyMergeStrategy := { | ||
case PathList("google", "protobuf", "field_mask.proto") => | ||
// The only difference is in a comment, so we could also just pick | ||
// one, but we don't need it anyway so better to be deterministic: | ||
MergeStrategy.discard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove this while at it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really a fan of introducing additional required configuration when creating an assembly.
Where is this version.conf used? Couldn't we choose names so we can avoid name clashes on the classpath?
Thanks for pushing back. I should have done that in the Alpakka Kafka case as well. The file is used by other tools when a project produces a fat-jar so that the jar manifest files can't be used to detect the originating version of the libraries. |
Add a
version.conf
file to make the Akka gRPC version available outside of class files.This complements the generated
akka.grpc.gen.BuildInfo
class.