Giter VIP home page Giter VIP logo

sbt-fresh's Introduction

sbt-fresh

sbt-fresh is a plugin for sbt to scaffold an opinionated fresh sbt project: it creates an sbt build according to established best practices, creates a useful package object for the root package, initializes a Git repository, creates an initial commit, etc.

Notice: The build definition created by sbt-fresh is incompatible with the -Yno-adapted-args scalac option.

Requirements: sbt 1.0 or higher

Add sbt-fresh to your global plugins definition, which most probably resides under ~/.sbt/1.0/plugins/plugins.sbt:

addSbtPlugin("de.heikoseeberger" % "sbt-fresh" % "<latest-version>")

You can define the following settings in your global build definition, which most probably sits at ~/.sbt/1.0/build.sbt:

import de.heikoseeberger.sbtfresh.license.License // Only needed for `freshLicense` setting

freshOrganization     := "doe.john"        // Organization – "default" by default
freshAuthor           := "John Doe"        // Author – value of "user.name" system property or "default" by default
freshLicense          := Some(License.mit) // Optional license – `apache20` by default
freshSetUpGit         := false             // Initialize a Git repo and create an initial commit – `true` by default
freshSetUpTravis      := true              // Configure Travis for Continuous Integration - `false` by default
freshSetUpWartremover := true              // Include the sbt wartremover (http://www.wartremover.org) plugin - `false` by default

Other settings which probably shouldn't be set globally:

freshName := ??? // Name – name of build directory by default; doesn't make much sense as a permanent setting

In order to scaffold a fresh sbt project, just start sbt in an empty directory. Then call the fresh command, optionally passing one or more of the following arguments (hit tab for auto completion) which override the respective settings:

  • organization
  • name
  • author
  • license
  • setUpGit
  • setUpTravis
  • setUpWartremover

Example:

sbt> fresh license=bsd3 setUpGit=false setUpTravis=false

The following values are available for the license argument:

  • apache20
  • agpl3
  • bsd2
  • bsd3
  • gpl3
  • lgpl3
  • mit

Layout

sbt-fresh creates a project with the following layout:

+ .gitignore
+ .scalafmt.conf
+ build.sbt                      // build settings
+ LICENSE                        // license file (Apache by default)
+ NOTICE
+ project
--+ build.properties             // sbt version
--+ plugins.sbt                  // sbt-git, sbt-header, sbt-scalafmt
+ README.md
+ src
--+ main
----+ scala
------+ package.scala            // type aliases repointing `Seq` and friends to immutable

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.

License

This code is open source software licensed under the Apache 2.0 License.

sbt-fresh's People

Contributors

hseeberger avatar scala-steward avatar jan0sch avatar 1015bit avatar strobe avatar britter avatar branislavlazic avatar dschmitz avatar bblaine avatar cbcoutinho avatar rockjam avatar odd avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.