GithubHelp home page GithubHelp logo

gsechaud / sbt-doge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbt/sbt-doge

0.0 0.0 0.0 318 KB

sbt plugin to aggregate tasks across subprojects and their crossScalaVersions

Scala 100.00%

sbt-doge's Introduction

sbt-doge

sbt-doge is a sbt plugin to aggregate across crossScalaVersions for multi-project builds, which I call partial cross building.

sbt-doge

Current implementation of + cross building operator does not take in account for the crossScalaVersions of the sub projects. Until that's fixed, here's an alternative implementation of it.

setup

This is an auto plugin, so you need sbt 0.13.5+. Put this in project/doge.sbt:

addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5")

usage

First, define a multi-project build with a root project aggregating some child projects:

def commonSettings: Seq[Def.Setting[_]] = Seq(
  organization := "com.example.doge",
  version := "0.1-SNAPSHOT"
)

lazy val rootProj = (project in file(".")).
  aggregate(libProj, fooPlugin).
  settings(commonSettings: _*)

lazy val libProj = (project in file("lib")).
  settings(commonSettings: _*).
  settings(
    name := "foo-lib",
    scalaVersion := "2.11.1",
    crossScalaVersions := Seq("2.11.1", "2.10.4")
  )

lazy val fooPlugin =(project in file("sbt-foo")).
  dependsOn(libProj).
  settings(commonSettings: _*).
  settings(
    name := "sbt-foo",
    sbtPlugin := true,
    scalaVersion := "2.10.4",
    crossScalaVersions := Seq("2.10.4")
  )

Next run this from the root project:

> ;so clean; such test; very publishLocal

sbt-doge will break the above into the following commands and executes them:

> wow 2.11.1
> libProj/clean
> wow 2.10.4
> libProj/clean
> fooPlugin/clean
> wow 2.10.4
> wow 2.11.1
> libProj/test
> wow 2.10.4
> libProj/test
> fooPlugin/test
> wow 2.10.4
> wow 2.11.1
> libProj/publishLocal
> wow 2.10.4
> libProj/publishLocal
> fooPlugin/publishLocal
> wow 2.10.4

It is looking into aggregate of the current project, and for each aggregated project, running a loop for each crossScalaVersions and executing the passed in command. The currently supported prefixes are: much, so, such, and very.

wow is a better implementation of ++ that only affects the aggregated projects.

CrossPerProjectPlugin

CrossPerProjectPlugin overrides sbt's + and ++ commands and uses doge's implementation that aggregates command respecting crossScalaVersions at each subproject. It is not a triggered plugin and so must be enabled using enablePlugins(CrossPerProjectPlugin).

can now be written as

> ;+ clean; + test; + publishLocal

strict aggregation

sbt-doge adds strict aggregation command plz. plz 2.11.5 compile will aggregate only the subproject that contains 2.11.5 in crossScalaVersions. The alias for plz command is +++ for CrossPerProjectPlugin.

sbt-doge's People

Contributors

benmccann avatar dwijnand avatar eed3si9n avatar jroper 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.