alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (BuildInfoEnvironment.scala)

This example Scala source code file (BuildInfoEnvironment.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

basicenvironment, basicenvironment, buildinfoenvironment, buildinfoenvironment, path, path, project, project, property

The Scala BuildInfoEnvironment.scala source code

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]("")
  } 

}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala BuildInfoEnvironment.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.