Code Monkey home page Code Monkey logo

sbt-project-graph's Introduction

sbt-project-graph

sbt-project-graph is an sbt plugin to help visualise inter-project dependencies.

Inspired by sbt-dependency-graph.

Setup

sbt-project-graph is an informational plugin and isn't ever a requirement of any build.

Therefore it is recommended to install it as a global plugin so that it's always available.

To do so, add it to ~/.sbt/0.13/plugins/plugins.sbt or ~/.sbt/1.0/plugins/plugins.sbt (or both; create the files if necessary) as such:

addSbtPlugin("com.dwijnand" % "sbt-project-graph" % "0.4.0")

As sbt-project-graph is an auto plugin that is all that is required.

Tasks

  • projectsGraphDot: Creates target/projects-graph.dot with the project graph. See DOT.
  • projectsGraphSvg: Creates target/projects-graph.svg with the project graph. Requires graphviz.
  • projectsGraphPng: Creates target/projects-graph.png with the project graph. Requires graphviz.

Licence

Copyright 2015 Dale Wijnand

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

sbt-project-graph's People

Contributors

dwijnand avatar scala-steward avatar swsnr avatar xuwei-k avatar vlfig avatar

Stargazers

Yoonjae Jeon avatar Juju avatar Felix Rath avatar Øyvind Raddum Berg avatar Nikolaos Dymitriadis avatar Weldhapi avatar Denis Mikhaylov avatar John S avatar sudotty avatar Nigel Benns avatar Hinse ter Schuur avatar Kamil Podsiadło avatar Jeff Carpenter avatar Stan Sobolev avatar Mehmet Akif Tütüncü avatar Marcin Szałomski avatar Rikito Taniguchi avatar Chris Kipp avatar Philipp Dörfler avatar ebigram avatar Michael Corrado avatar Nacho Castillo avatar timothy avatar Jakub Kozłowski avatar Igo Brilhante avatar Ben Hutchison avatar  avatar Takuji Shimokawa avatar  avatar Doug Roper avatar Pepijn Looije avatar Tomofumi Tanaka avatar Giuseppe Crinò avatar  avatar Matthias Brandt avatar KITAGAWA Yasutaka avatar Taro L. Saito avatar Taeguk Kwon avatar Ruslans Tarasovs avatar Ludovic Claude avatar  avatar Shunsuke Tadokoro avatar  avatar Danilo Faria avatar Erica Ehrhardt avatar maxmc avatar YUSUKE IZAWA avatar John Wass avatar Muki Seiler avatar Nathan Kleyn avatar Artsiom Chuiko avatar Ivan Jager avatar  avatar Viktor Podzigun avatar Michal Zdzinski avatar Alexander v. Buchholtz avatar Manu Zhang avatar TzeKei Lee avatar Emil Dafinov avatar Shane Delmore avatar Jose Luis Diaz avatar Naftoli Gugenheim avatar Amynov Islam Methyl Ogly avatar LukaG avatar Joseph Price avatar >>= avatar Alexey Alekhin avatar Pedro Furlanetto avatar Ivano Pagano avatar SwhGo_oN avatar Zava avatar ak avatar  avatar Fabio avatar Jacek Laskowski avatar Thomas Lockney avatar

Watchers

Jacek Laskowski avatar  avatar  avatar Oto Petřík avatar  avatar

sbt-project-graph's Issues

NSEE when project dependsOn an external ProjectRef

java.util.NoSuchElementException: key not found: utilTesting
	at scala.collection.MapLike$class.default(MapLike.scala:228)
	at scala.collection.AbstractMap.default(Map.scala:58)
	at scala.collection.MapLike$class.apply(MapLike.scala:141)
	at scala.collection.AbstractMap.apply(Map.scala:58)
	at com.dwijnand.sbtprojectgraph.Node$$anonfun$1.apply(Node.scala:10)
	at com.dwijnand.sbtprojectgraph.Node$$anonfun$1.apply(Node.scala:10)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.immutable.Set$Set3.foreach(Set.scala:115)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
	at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
	at scala.collection.SetLike$class.map(SetLike.scala:93)
	at scala.collection.AbstractSet.map(Set.scala:47)
	at com.dwijnand.sbtprojectgraph.Node$.create(Node.scala:10)
	at com.dwijnand.sbtprojectgraph.Node$$anonfun$2.apply(Node.scala:11)
	at com.dwijnand.sbtprojectgraph.Node$$anonfun$2.apply(Node.scala:11)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
	at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
	at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
	at scala.collection.SetLike$class.map(SetLike.scala:93)
	at scala.collection.AbstractSet.map(Set.scala:47)
	at com.dwijnand.sbtprojectgraph.Node$.create(Node.scala:11)
	at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1$$anonfun$3.apply(SbtProjectGraphPlugin.scala:28)
	at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1$$anonfun$3.apply(SbtProjectGraphPlugin.scala:28)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
	at scala.collection.AbstractTraversable.map(Traversable.scala:105)
	at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1.apply(SbtProjectGraphPlugin.scala:28)
	at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1.apply(SbtProjectGraphPlugin.scala:11)

NoSuchElementException when using ProjectReference

Either RootProject or ProjectRef.

Example setup:

lazy val app = project in file(".") dependsOn (a, b, c)

val a = project
val b = RootProject(file("../b"))
val c = ProjectRef(file("../c"), "c")

Stack:

java.util.NoSuchElementException: key not found: b
    at scala.collection.MapLike$class.default(MapLike.scala:228)
    at scala.collection.AbstractMap.default(Map.scala:58)
    at scala.collection.MapLike$class.apply(MapLike.scala:141)
    at scala.collection.AbstractMap.apply(Map.scala:58)
    at com.dwijnand.sbtprojectgraph.Node$$anonfun$1.apply(Node.scala:10)
    at com.dwijnand.sbtprojectgraph.Node$$anonfun$1.apply(Node.scala:10)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.immutable.Set$Set3.foreach(Set.scala:115)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractSet.scala$collection$SetLike$$super$map(Set.scala:47)
    at scala.collection.SetLike$class.map(SetLike.scala:93)
    at scala.collection.AbstractSet.map(Set.scala:47)
    at com.dwijnand.sbtprojectgraph.Node$.create(Node.scala:10)
    at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1$$anonfun$3.apply(SbtProjectGraphPlugin.scala:28)
    at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1$$anonfun$3.apply(SbtProjectGraphPlugin.scala:28)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1.apply(SbtProjectGraphPlugin.scala:28)
    at com.dwijnand.sbtprojectgraph.SbtProjectGraphPlugin$$anonfun$1.apply(SbtProjectGraphPlugin.scala:11)
    at sbt.Command$$anonfun$command$1$$anonfun$apply$1.apply(Command.scala:30)

Include aggregate?

Hi,

thanks for this plugin; really helps to give an overview over complex builds!

Currently it just considers classpath dependencies, ie, dependsOn, tho. Could it also include task dependencies, ie, aggregate? In a complex build setup this also helps to understand what gets build.

Are ProjectRef's to other, external SBT projects supported?

I have a SBT project containing a scala.js Cross Project.

Both the JS and JVM sub-projects depend upon the JS/JVM parts of another (external) cross-project at a relative file path. They do this by creating ProjectRefs, eg ProjectRef(file("../time", "TimeJVM").

What I observed when I generated & viewed the dot file was that these dependencies were missing.

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.