sbt-buildinfo

sbt-buildinfo generated object cannot be referenced

纵然是瞬间 提交于 2019-12-24 09:48:09
问题 I'm using the aforementioned sbt plugin to get the version of the app I'm working on. The project has sub-modules. Here is the main build.sbt ... lazy val abandon = (project in file(".")). aggregate(base, cli, gui). dependsOn(base, cli, gui). enablePlugins(BuildInfoPlugin). settings(commonSettings: _*). settings( name := "abandon", fork in run := true, buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "co.uproot.abandon" ) lazy val base =

How to access SBT settings from Java code in PlayFramework?

孤人 提交于 2019-12-23 12:23:59
问题 I have a PlayFramework application, and there is a name and version in the build.sbt . If I run the play console, I can access this information by typing name or version . How can I get this information from Java code inside the application? I can't seem to find any useful methods in Play.application() and I have not been able to find this in the documentation. 回答1: For this you can use the SBT plugin BuildInfo: Add to project/plugins.sbt: addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.2

How to not watch a file for changes in Play Framework

折月煮酒 提交于 2019-12-19 09:37:10
问题 On a Play Framework 2.2 project that is using sbt-buildinfo to create a BuildInfo.scala file when the project is compiled, how can build.sbt be configured so that Play Framework won't watch the BuildInfo.scala file for changes, and won't restart the server if that file changes? For instance, if a session is started with: $ sbt ~run and the server starts in development mode, and then in another terminal window another sbt session is started (to run another subproject, or just to run other sbt

IntelliJ Idea sbt managed source file

邮差的信 提交于 2019-12-18 14:16:32
问题 I am using sbt-buildinfo plugin that generates Scala source from my build definitions, allowing me to reference project name, version, etc. from my Scala code. It does this by generating a file BuiltInfo.scala with the following contents: package hello case object BuildInfo { val name = "helloworld" val version = "0.1-SNAPSHOT" val scalaVersion = "2.10.3" val sbtVersion = "0.13.2" } in target/scala-2.10/src_managed/main/sbt-buildinfo/BuildInfo.scala . Everything compiles and I can reference

Can the runtime of a Heroku app know it's commit id?

限于喜欢 提交于 2019-12-06 00:44:00
问题 I'd like the runtime of my Heroku app (Play/Scala, running on Heroku Cedar) to be able to report to me which git commit it was built from. Heroku apps are generally built by the slug compiler on Heroku's infrastructure - unfortunately, the slug compiler does this as an early part of this build process: Remove unused files, including .git directories, .gitmodules files, anything in log and tmp, and anything specified in a top-level .slugignore file. ...so the Git information is no longer

Can I access my Scala app's name and version (as set in SBT) from code?

回眸只為那壹抹淺笑 提交于 2019-12-03 02:10:06
问题 I am building an app with SBT (0.11.0) using a Scala build definition like so: object MyAppBuild extends Build { import Dependencies._ lazy val basicSettings = Seq[Setting[_]]( organization := "com.my", version := "0.1", description := "Blah", scalaVersion := "2.9.1", scalacOptions := Seq("-deprecation", "-encoding", "utf8"), resolvers ++= Dependencies.resolutionRepos ) lazy val myAppProject = Project("my-app-name", file(".")) .settings(basicSettings: _*) [...] I'm packaging a .jar at the end

IntelliJ Idea sbt managed source file

时间秒杀一切 提交于 2019-11-30 11:03:16
I am using sbt-buildinfo plugin that generates Scala source from my build definitions, allowing me to reference project name, version, etc. from my Scala code. It does this by generating a file BuiltInfo.scala with the following contents: package hello case object BuildInfo { val name = "helloworld" val version = "0.1-SNAPSHOT" val scalaVersion = "2.10.3" val sbtVersion = "0.13.2" } in target/scala-2.10/src_managed/main/sbt-buildinfo/BuildInfo.scala . Everything compiles and I can reference those vals. However, IntelliJ Idea doesn't recognize BuildInfo.scala as a managed source file, so that