Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 2.19 KB

README.adoc

File metadata and controls

72 lines (54 loc) · 2.19 KB

Scalariform Gradle Plugin

Build Status

This plugin will add tasks that will allow you to automatically reformat your source code using the Scalariform formatter.

Usage

This plugin is available through the Gradle plugin exchange. This means that there are a few different usage scenarios listed below.

Gradle 2.1 and above

In your build.gradle file add:

plugins {
    id "com.github.hierynomus.scalariform" version "0.4.0"
}

Gradle 1.x/2.0, latest license-gradle-plugin

In your build.gradle file add:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.hierynomus.gradle.plugins:scalariform-gradle-plugin:0.4.0"
  }
}

apply plugin: "com.github.hierynomus.scalariform"

Functionality

For each source set configured in your project, this plugin will add a format<SourceSetName>Scala Scalariform task.

Furthermore the plugin will configure a formatAllScala task that depends on all the configured Scalariform tasks.

You can configure the formatter using the following snippet:

plugins {
  id "com.github.hierynomus.scalariform" version "0.4.0"
}

scalariform {
  alignParameters = true
  alignSingleLineCaseStatements = true
}

For a complete listing of all possible configuration options, please consult the Scalariform documentation.

Release Notes

v0.2.0 (2017-04-14)

  • Upgraded to scalariform 0.2.0 which has a new maintainer. === v0.1.3 (2016-11-23)

  • Tweaked loglevel to keep output of Gradle build cleaner

  • Merged #4: Fix for SourceSet filtering

v0.1.2 (2016-06-27)

  • Merged #1: Fix for scala.MatchError.