SBT - Run task to set SettingKey

So my general problem is that I want to set the version key based on the result of the task. However, the version key is installed before the task starts. From what I understand, I cannot change the key value after setting it, so I cannot change that in my task.

I want to execute the task as a dependency on the publish task and change the value for the version. I feel like there must be a way to do this, but I don't have any clues at the moment. Any help would be greatly appreciated.

+3


source to share


1 answer


The sbt-release plugin does this by writing an sbt file in the project root containing the correct version. Maybe you can use this plugin: https://github.com/sbt/sbt-release



If you can't use it, you can check the source code to see the strategy the creator used.

+1


source







All Articles