Skip to content
This repository has been archived by the owner on Nov 16, 2017. It is now read-only.

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
taig committed Aug 28, 2015
1 parent 289cab2 commit 59e339e
Show file tree
Hide file tree
Showing 10 changed files with 109 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
target/
9 changes: 9 additions & 0 deletions README.md
@@ -0,0 +1,9 @@
# Sbt Scalariform

> Scalariform auto plugin with custom formatting settings
## Installation

````
addSbtPlugin( "io.taig" %% "sbt-scalariform" % "1.0.0" )
````
32 changes: 10 additions & 22 deletions build.sbt
@@ -1,23 +1,11 @@
lazy val commonSettings = Seq(
organization := "org.scala-sbt",
version := "0.1.0"
)
addSbtPlugin( "org.scalariform" % "sbt-scalariform" % "1.4.0" )

lazy val root = (project in file(".")).
settings(
commonSettings ++
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0") ++
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.1")
: _*).
settings(
sbtPlugin := true,
name := "sbt-houserules",
description := "sbt plugin for enforcing sbt house rules.",
licenses := Seq("Apache v2" -> url("https://github.com/sbt/sbt-houserules/blob/master/LICENSE")),
publishMavenStyle := false,
publishTo := {
if (isSnapshot.value) Some(Resolver.sbtPluginRepo("snapshots"))
else Some(Resolver.sbtPluginRepo("releases"))
},
credentials += Credentials(Path.userHome / ".ivy2" / ".sbtcredentials")
)
name := "SbtScalariform"

normalizedName := "sbt-scalariform"

organization := "io.taig"

sbtPlugin := true

version := "1.0.0"
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.13.7
sbt.version=0.13.9
3 changes: 3 additions & 0 deletions project/plugins.sbt
@@ -0,0 +1,3 @@
addSbtPlugin( "com.jsuereth" % "sbt-pgp" % "1.0.0" )

addSbtPlugin( "org.xerial.sbt" % "sbt-sonatype" % "0.5.0" )
49 changes: 49 additions & 0 deletions sonatype.sbt
@@ -0,0 +1,49 @@
description := "Scalariform auto plugin with custom formatting settings"

homepage := Some( url( "https://github.com/taig/sbtscalariform" ) )

licenses := Seq( "MIT" -> url( "https://raw.githubusercontent.com/taig/sbtscalariform/master/LICENSE" ) )

organizationHomepage := Some( url( "http://taig.io" ) )

pomExtra := {
<issueManagement>
<url>https://github.com/taig/sbtscalariform/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<developers>
<developer>
<id>Taig</id>
<name>Niklas Klein</name>
<email>mail@taig.io</email>
<url>http://taig.io/</url>
</developer>
</developers>
}

pomIncludeRepository := { _ => false }

publishArtifact in Test := false

publishMavenStyle := true

publishTo <<= version ( version => {
val url = Some( "https://oss.sonatype.org/" )

if( version.endsWith( "SNAPSHOT" ) ) {
url.map( "snapshot" at _ + "content/repositories/snapshots" )
}
else {
url.map( "release" at _ + "service/local/staging/deploy/maven2" )
}
} )

scmInfo := Some(
ScmInfo(
url( "https://github.com/taig/sbtscalariform" ),
"scm:git:git://github.com/taig/sbtscalariform.git",
Some( "scm:git:git@github.com:taig/sbtscalariform.git" )
)
)

startYear := Some( 2015 )
36 changes: 36 additions & 0 deletions src/main/scala/io/taig/FormatPlugin.scala
@@ -0,0 +1,36 @@
package io.taig

import com.typesafe.sbt.SbtScalariform.{ScalariformKeys, scalariformSettings}
import sbt._

import scalariform.formatter.preferences._

object FormatPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin

override def trigger = allRequirements

override def projectSettings: Seq[Def.Setting[_]] = scalariformSettings ++ Seq(
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference( AlignParameters, true )
.setPreference( AlignArguments, true )
.setPreference( AlignSingleLineCaseStatements, true )
.setPreference( CompactControlReadability, true )
.setPreference( CompactStringConcatenation, false )
.setPreference( DoubleIndentClassDeclaration, true )
.setPreference( FormatXml, false )
.setPreference( IndentLocalDefs, false )
.setPreference( IndentPackageBlocks, true )
.setPreference( IndentSpaces, 4 )
.setPreference( IndentWithTabs, false )
.setPreference( MultilineScaladocCommentsStartOnFirstLine, false )
.setPreference( PlaceScaladocAsterisksBeneathSecondAsterisk, false )
.setPreference( PreserveSpaceBeforeArguments, true )
.setPreference( RewriteArrowSymbols, true )
.setPreference( SpaceBeforeColon, false )
.setPreference( SpaceInsideBrackets, false )
.setPreference( SpaceInsideParentheses, true )
.setPreference( SpacesWithinPatternBinders, true )
.setPreference( SpacesAroundMultiImports, true )
)
}
16 changes: 0 additions & 16 deletions src/main/scala/sbt/houserules/BuildPlugin.scala

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/scala/sbt/houserules/FormatPlugin.scala

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/scala/sbt/houserules/GitVersionPlugin.scala

This file was deleted.

0 comments on commit 59e339e

Please sign in to comment.