david-wiles / sbt-installer   0.1.2

Apache License 2.0 GitHub

SBT plugin which automatically installs a project locally

Scala versions: 2.12
sbt plugins: 1.0

sbt-installer

An SBT plugin which allows you to install an executable program into your path directly.

Pre-requisites

  • SBT 1.0.0 or higher
  • If default install locations are used, the ~/.local/bin directory must be in your path.

You can setup your machine to use the by running:

curl -sLk https://raw.githubusercontent.com/david-wiles/sbt-installer/main/scripts/setup.sh | sh -

This file is located at scripts/setup.sh in this repository if you wish to inspect it.

Usage (JVM)

Add the following to your project/plugins.sbt file:

addSbtPlugin("net.davidwiles" % "sbt-installer" % "0.1.2")

Then, in your build.sbt file, add one of the following:

enablePlugins(AssemblyInstallerPlugin)

or

enablePlugins(TarballInstallerPlugin)

Now, you can run sbt install to install your program into your path.

By default, and executable file will be written to $HOME/.local/bin. You can change this by setting the installDir setting key:

install / installExecutableLocation := new File("/usr/local/bin")

You can also change the name of the executable file by setting the installExecutableName setting key:

install / installExecutableName := "my-program"

By default, the jar files will be installed to $HOME/.local/opt/my-program. You can change this by setting the installLocation setting key:

install / installLocation := new File("/usr/local/opt")

Usage (Native)

Add the following to your project/plugins.sbt file:

addSbtPlugin("net.davidwiles" % "sbt-native-installer" % "0.1.2")

Then, in your build.sbt file, add the following:

enablePlugins(NativeInstallerPlugin)

License

This project uses the Apache 2.0 license. See the LICENSE file for more details.