Giter Site home page Giter Site logo

Comments (5)

jsuereth avatar jsuereth commented on September 13, 2024

No :(. version in sbt is a "Setting" which means it's only generated on load/reload.

I recommend making a release script which will ensure a reload/cleaned project.

commands += Command.command("release") { state =>
   "reload" :: "test" :: "publishSigned" :: state
}

from sbt-git.

lukens avatar lukens commented on September 13, 2024

Thanks, I will look at doing something like that.

from sbt-git.

aradke avatar aradke commented on September 13, 2024

I would love to have this automatically be updated too.

In the meantime, instead of using git to directly tag the version, I use sbt to tag and refresh the project. This way sbt will grab then grab the most recent version.

commands += Command.single("tag"){case (state,versionTag) => 
   println(s"Commiting a git annotated tag of v$versionTag, and refreshing the project ")
   s"git tag -a -m v$versionTag v$versionTag" :: "reload" ::  state
}

Then using the interactive sbt console to make a tag keeps sbt in sync for future commands:

> tag 0.1.0

However, the version is still not refreshed for local changes until a new tag is made. In this case, a release command that includes the refresh command as suggested by @jsuereth may be better.

from sbt-git.

luckyrandom avatar luckyrandom commented on September 13, 2024

The following commands, which override the default task, work well for me.

Command.command("package") {
    state => {
      println("==== Reload & package ====")
      "reload" :: "compile:package" :: state
    }
  }
Command.command("assembly") {
    state => {
      println("==== Reload & assembly ====")
      "reload" :: "*:assembly" :: state
    }
  }

from sbt-git.

dwijnand avatar dwijnand commented on September 13, 2024

I would love this too. But version isn't going to become a task.

from sbt-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.