sbt/sbt-structure

Name: sbt-structure

Owner: sbt

Description: SBT plugin to collect information about project structure

Forked from: JetBrains/sbt-structure

Created: 2016-05-18 19:33:56.0

Updated: 2016-05-18 19:33:57.0

Pushed: 2016-05-18 19:34:34.0

Homepage: null

Size: 27030

Language: Scala

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

sbt-structure

Download Build Status

This plugin is designed to allow one extract complete structure of SBT build in XML format. It is used in Intellij Scala plugin in order to support importing arbitrary SBT projects into IDEA.

It consists of two parts:

Usage
Core

Add to your build.sbt

lvers += Resolver.url("jb-bintray", url("http://dl.bintray.com/jetbrains/sbt-plugins"))(Resolver.ivyStylePatterns)

aryDependencies += "org.jetbrains" %% "sbt-structure-core" % "4.1.0" // or later version

Then run extractor or get XML of the structure any other way and deserialize it:

rt org.jetbrains.sbt._
rt org.jetbrains.sbt.XmlSerializer._

structureXml: Elem = XML.load(...)
structure: Either[Throwable, StructureData] = structureXml.deserialize[StructureData]
Extractor

Extractor is run in several steps:

Here is an example of how to run extractor from SBT REPL:

t SettingKey[Option[File]]("sbt-structure-output-file") := Some(file("structure.xml"))
t SettingKey[String]("sbt-structure-options") := "prettyPrint download"
ply -cp <path-to-extractor-jar> org.jetbrains.sbt.CreateTasks
*:dump-structure

sbt-structure-options contains space-separated list of options. sbt-structure-output-file points to a file where structure will be written; if it is set to None then structure will be dump into stdout.

Available options to set in sbt-structure-options:

Development notes

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.