Name: sbt-package-dist
Owner: Twitter, Inc.
Owner: Twitter Archive
Description: sbt 11 plugin codifying best practices for building, packaging, and publishing
Created: 2012-03-27 22:15:14.0
Updated: 2018-03-31 00:59:39.0
Pushed: 2015-05-09 10:49:03.0
Size: 8933
Language: Scala
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
sbt-package-dist is a plugin for sbt 0.11 which attempts to codify best practices for building, packaging, and publishing libraries and servers. It adds the following features:
build.properties
fileSee https://github.com/harrah/xsbt/wiki/Plugins for information on adding plugins. In general, you'll need to add the following to your project/plugins.sbt file:
addSbtPlugin("com.twitter" % "sbt-package-dist" % "1.0.0")
sbt-package-dist is a collection of many different mixins. Each mixin provides a set of SBT Settings, Tasks and/or Commands that your project can use. The way an SBT project “uses” these extensions is by adding them to the project's settings map. There are two ways to include settings into your build definition.
If you want to include all of the settings:
import com.twitter.sbt._
seq(StandardProject.newSettings: _*)
If you want to include only a specific mixin's settings, you can specify just the one(s) you want:
import com.twitter.sbt._
seq(GitProject.gitSettings: _*)
In your scala build definition, just extend the settings of any defined projects:
import sbt._
import Keys._
import com.twitter.sbt._
object MyProject extends Build {
lazy val root = Project(
id = "my-project",
base = file("."),
settings = StandardProject.newSettings
)
}
Standard project provides the following plugins you can extend:
Aggregates a “reasonable” set of mixins into a single plugin. Currently included are:
Sets up a default set of maven repos used in most Twitter projects. If the
SBT_PROXY_REPO
environment variable is set, it uses a proxy repo instead.
Using a proxy repo may be useful when building in an environment where sbt
can't access the internet.
Publishes artifacts to an “artifactory” (optionally with credentials) instead
of the default publishing target. This mixin only takes effect if
artifactoryResolver
is set.
Publishes artifacts to a subversion repo, if one is set. Settings of interest are:
Adds various settings and commands for dealing with git-based projects, including:
Uses GitProject
to write a build.properties
file containing information
about the environment used to produce a jar. Includes the name, version, build
name (usually a timestamp), git revision, git branch, and the last few
commits.
Just works around a bug in sbt to prevent scaladoc from blowing up.
Generates a deployable zip file of a server, containing:
build.properties
)lib/
scripts/
config/
Provides commands to modify the current project version, including:
These commands look in build.sbt
and project/*.scala
files for a current
version string and replace it with the updated version. After this is done,
the command reloads the project, which should now have the updated version.
Provides commands for publishing a release. The primary command is release-
publish
, which does the following in sequence: