Skip to content

Commit

Permalink
Fixup / standardize documentation for individual plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Schaake committed Nov 8, 2014
1 parent 355e810 commit b4df102
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 53 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The AI2 SBT plugins are intended to minimize build boilerplate accross projects.
- `WebServicePlugin` - for web service applications
- `WebappPlugin` - for web applications

Documentation for individual plugins can be found in the [docs](docs/) directory.

# Usage

Expand Down
20 changes: 9 additions & 11 deletions docs/core-settings.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# allenai-sbt-core-settings

This plugin provides core settings to projects including:
**Required by**: all Archetype plugins

**Requires**: `StylePlugin` && `VersionInjectorPlugin`

**Note**: `CoreSettingsPlugin` is implicitly applied to all projects via its `trigger` setting. This means you do not need to explicitly enable this plugin.

The `CoreSettingsPlugin` provides core settings to projects including:

- Setting `conflictManager := ConflictManager.strict`
- Adds slf4j dependencies and resolves common slf4j conflicts
- Provides `CoreSettings.Dependencies` object with many common (and versioned) dependencies
- Enables the `StylePlugin` and `VersionInjectorPlugin`

To use, add the following to your projects `project/plugins.sbt` file:

```scala
addSbtPlugin("org.allenai.plugins" % "allenai-sbt-core-settings" % VERSION)
```

where `VERSION` is the current version available on BinTray.

See `sbt-core-settings-tester/build.sbt` and `sbt-core-settings-tester/project/plugins.sbt` for usage.

## Tip: define a `project/Dependencies.scala` file

Enabling the `allenai-sbt-core-settings` provides your build classpath with `org.allenai.sbt.core.CoreDependencies`. If your project will have additional depdencies (most likely), you should define your own `Dependencies` build object that extends the `CoreDependencies` trait:
The `CoreSettingsPlugin` provides your build classpath with `org.allenai.plugins.CoreDependencies`. If your project will have additional depdencies (most likely), you should define your own `Dependencies` build object that extends the `CoreDependencies` trait:

```scala
// in project/Dependencies.scala
import org.allenai.sbt.CoreDependencies
import org.allenai.plugins.CoreDependencies

import sbt._
import sbt.Keys._
Expand Down
14 changes: 5 additions & 9 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ sbt-deploy

**Boss**: Jesse

**Required by**: `WebServicePlugin` && `WebappPlugin`

**Wraps**: [`sbt-native-packager`](https://github.com/sbt/sbt-native-packager)

A plugin for deploying applications to a machine using [Typesafe Config](https://github.com/typesafehub/config) for
configuration.

Expand All @@ -12,15 +16,7 @@ pushing to EC2 hosts, and restarting your service.
deploy
------

### installation

Add the plugin to your project:
```
// In project/plugins.sbt
addSbtPlugin("org.allenai.plugins" % "allenai-sbt-deploy" % VERSION
```
Substitute `VERSION` with the latest version for the plugin on [bintray](https://bintray.com/allenai/sbt-plugins).

### configuration
Enable the deploy plugin, which will provide default settings:
```
// In your project's build.sbt
Expand Down
13 changes: 4 additions & 9 deletions docs/node-js.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# SBT NodeJS plugin

This plugin provides the ability to manage building a Node.js application from SBT. The primary use case is to allow client-side development to occur in a complete isolation from SBT using Node.js build tools (such as Gulp.js). The only requirement is to have `npm` (Node Package Manager) on your PATH. `npm` is included with every Node.js installation.

## Installation
**Required by**: `WebappPlugin`

Add the following to your `project/plugins.sbt`:
**Note**: you most likely want to enable the `WebappPlugin` archetype for your project instead of enabling the `NodeJsPlugin` directly.

```
addSbtPlugin("org.allenai.plugins" % "allenai-sbt-node-js" % VERSION)
```
Substitute `VERSION` with the latest version for the plugin on [bintray](https://bintray.com/allenai/sbt-plugins).
This plugin provides the ability to manage building a Node.js application from SBT. The primary use case is to allow client-side development to occur in a complete isolation from SBT using Node.js build tools (such as Gulp.js). The only requirement is to have `npm` (Node Package Manager) on your PATH. `npm` is included with every Node.js installation.

Enable the plugin for your project in `build.sbt`:
## Installation

```
val myProject = project.in(file(".")).enablePlugins(NodeJsPlugin)
Expand Down
13 changes: 5 additions & 8 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# allenai-sbt-release

AutoPlugin that wraps [sbt-release](https://github.com/sbt/sbt-release) providing a custom versioning scheme.
AutoPlugin that provides a custom versioning scheme.

## Installation
**Required by**: `LibraryPlugin`

Add the plugin to your project:
```
// In project/plugins.sbt
addSbtPlugin("org.allenai.plugins" % "allenai-sbt-release" % VERSION
```
Substitute `VERSION` with the latest version for the plugin on [bintray](https://bintray.com/allenai/sbt-plugins).
**Wraps**: [sbt-release](https://github.com/sbt/sbt-release)

## Installation

Enable the plugin for your **root** project in `build.sbt`:

Expand Down
13 changes: 10 additions & 3 deletions docs/style.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
sbt-style
==========

A plugin for formatting Scala code and checking Scala style. Auto-formatting is done with [scalariform](https://github.com/mdr/scalariform), and other style checking is done with [scalastyle](http://www.scalastyle.org/).
**Required by**: `CoreSettings`

Installing this plugin will make a project's `compile` task depend on the format and style checker.
**Wraps**:

- [scalariform](https://github.com/mdr/scalariform) for auto-formatting
- [scalastyle](http://www.scalastyle.org/) for style checking

**Note**: This plugin is auto-enabled as part of `CoreSettings`

Enabling this plugin will make a project's `compile` task depend on the format and style checker.

## Disabling warnings
To disable format warnings and auto-formatting for a block of code, bound it in these special comments:
Expand Down Expand Up @@ -113,4 +120,4 @@ misformatted files, or files that don't compile, you will need to correct them b
### Code Style Settings for IntelliJ
This [jar file](https://github.com/allenai/sbt-plugins/blob/master/sbt-style/settings/AI2CodeStyleSettingsForIntelliJ.jar) contains
settings for IntelliJ that conform as closely as possible to the formatting conventions of this
plugin. To use them, choose File->Import Settings and select the jar file.
plugin. To use them, choose File->Import Settings and select the jar file.
17 changes: 4 additions & 13 deletions docs/version-injector.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
sbt-version-injector
====================

**Required by**: `CoreSettings`

**Note**: This plugin is auto-enabled as part of `CoreSettings`

SBT plugin that generates resource files for extracting version information.

- `artifact.conf`
Expand All @@ -14,16 +18,3 @@ You can access the generated resource values within your Scala application like

val artifactVersion = artifactConf.getString("version")
val gitVersion = gitConf.getString("describe")

## Installation

The plugin is an AutoPlugin which requires SBT version 0.13.5 or later.

To install, add the following to your `project/plugins.sbt`:

```scala
addSbtPlugin("org.allenai.plugins" % "allenai-sbt-version-injector" % VERSION)
```
Substitute `VERSION` with the latest version for the plugin on [bintray](https://bintray.com/allenai/sbt-plugins).

The plugin is set to be auto-enabled for every project, so you don't have to explicitly enable it in `build.sbt`.

0 comments on commit b4df102

Please sign in to comment.