summaryrefslogtreecommitdiff
path: root/project/build/BuildInfoEnvironment.scala
blob: fc1c436c33399b83f70c1a6b1d9fbbd23b207d44 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sbt._
trait BuildInfoEnvironment {
  self : Project =>
  def buildInfoEnvironmentLocation: Path
  /**
   * Environment for storing properties that
   * 1) need to be saved across sbt session
   * 2) Are local to a layer
   * Used to save the last version of the compiler used to build the layer (for discarding it's product if necessary)
   */
  lazy val layerEnvironment = new BasicEnvironment {
    // use the project's Logger for any properties-related logging
    def log = self.log

    // the properties file will be read/stored 
    def envBackingPath = buildInfoEnvironmentLocation
    // define some properties
    lazy val lastCompilerVersion: Property[String] = propertyOptional[String]("")
  } 

}