Skip to content

Learn you an SBT for fun and profit – Scala Days 2014 example project

Notifications You must be signed in to change notification settings

dwestheide/learn-you-an-sbt-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the example project used in my Scala Days 2014 talk Learn you an SBT for fun and profit.

The Hipster Coffee Shop is a web shop that sells overpriced coffee to Berlin hipsters. Their manager wants to have decent release notes for every release of their web application, so the SBT build contains some custom functionality for generating them from the Git history as a markdown file that contains the list of tickets closed in the release, some diff stats, and a list of the contributors to the release.

Usage

Call show releaseNotesGenerate_ and pass in a valid Git tag for a release to look at the generates release notes.

Call the releaseNotesDump task and pass in a valid Git tag for a release to write release notes into a markdown file.

The directory into which release notes are written can be configured by providing a setting for the releaseNotesDir setting key.

The file name of the generated markdown file can be changed by providing a setting for the releaseNotesFileName setting key.

The release notes functionality is implemented as an SBT autoplugin, and the sole purpose of this project is to demonstrate how to provide custom setting keys and task keys in SBT, how to implement your own tasks, using the File, IO, and Process APIs as well as parser combinators, and how to provide that functionality as an SBT auto plugin.

The functionality of the plugin is not usable in a generic way, as it makes strong assumptions about the format of release tags and about Git commit messages for closed tickets. A real-world version would likely allow configuring these things, too, and fetch the actual ticket description from an issue tracker.

To allow you to play around with this quickly, the release notes functionality is not a separate SBT project. Rather, the release notes auto plugin is simply part of the build project, under project/src/main/scala/releasenotes.

About

Learn you an SBT for fun and profit – Scala Days 2014 example project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages