Let's say I am creating an SBT project called Y which is using the package X in an SBT build:
libraryDependencies = Seq(
"org.something" %% "X" % XVersion
)
I've learned that X contains a minor bug, which the developer is working on (thank you!). The code of X (built with SBT) is available to clone and I know how to hot-fix this issue while the developer works on it.
Here's what I would love to be able to do:
- Clone
Xto~/code/X - Create the hot-fix by just editing the code
- In the
build.sbtfor my own projectY, replace"org.something" %% "X" % XVersionwith a link to~/code/Xso that my own code is compiled with the hot-fix.
Is there a general way to do this? There's a good chance this is described in the SBT Docs, I'd be happy for a pointer - there's a lot of docs with new terminology.
Example in point (but the question is about the general case): This build file for a package I'm trying to hot-fix is complex, and I'd love to have a way of hot-fixing without requiring to understand this build file fully.
CodePudding user response:
You can edit the dependency code and then run sbt publishLocal which will create a new local version of the dependency with the changes applied, you can then edit your build.sbt to use that new version and that is all you need for a local setup
If you have some CI pipeline or you deeply your code you would need to do more things but this is the basic idea.
