Skip to content

Commit

Permalink
Fixed sonatype plugin. Standardise versioning for all modules. Make c…
Browse files Browse the repository at this point in the history
…ore as root module.
  • Loading branch information
yangzai committed Dec 9, 2018
1 parent b22eaf7 commit 19df756
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -143,4 +143,5 @@ fabric.properties
.idea/httpRequests

# Project Specific
.idea
/.idea
/sonatype.sbt
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -2,20 +2,20 @@

## Concise and typesafe annotation constants for suppressing warnings from [WartRemover](https://github.com/wartremover/wartremover)

|Suppressor|WartRemover|Contrib|
|----------|-----------|-------|
|0.1.0 |2.7.3 |1.2.4 |


### SBT Setup
If only the standard `Warts` are required:
```scala
libraryDependencies += "io.github.yangzai" %% "wartremover-suppressor-core" % "2.3.7-SNAPSHOT"
```

If only the `ContribWarts` are required:
```scala
libraryDependencies += "io.github.yangzai" %% "wartremover-suppressor-contrib" % "1.2.4-SNAPSHOT"
libraryDependencies += "io.github.yangzai" %% "wartremover-suppressor" % "0.1.0"
```

Otherwise, if both are required:
If `ContribWarts` are also required:
```scala
libraryDependencies += "io.github.yangzai" %% "wartremover-suppressor" % "0.1.0-SNAPSHOT"
libraryDependencies += "io.github.yangzai" %% "wartremover-suppressor-contrib" % "0.1.0"
```

### Example
Expand Down
21 changes: 10 additions & 11 deletions build.sbt
@@ -1,23 +1,22 @@
ThisBuild / organization := "io.github.yangzai"
ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.12.8"
ThisBuild / crossScalaVersions := Seq(scalaVersion.value, "2.11.12")
ThisBuild / crossScalaVersions += "2.11.12"

ThisBuild / wartremoverErrors ++= Warts.all

lazy val core = project in file("suppressor-core") settings(
name := "wartremover-suppressor-core",
version := "2.3.7-SNAPSHOT"
name := "wartremover-suppressor-core"
)

lazy val contrib = project in file("suppressor-contrib") dependsOn core settings(
name := "wartremover-suppressor-contrib",
version := "1.2.4-SNAPSHOT"
name := "wartremover-suppressor-contrib"
)

lazy val root = project in file(".") dependsOn(core, contrib) enablePlugins SbtOsgi settings(
name := "wartremover-suppressor",
version := "0.1.0-SNAPSHOT",
osgiSettings,
OsgiKeys.exportPackage := Seq("org.wartremover.suppressor.*;-split-package:=merge-first"),
OsgiKeys.privatePackage := Seq.empty
lazy val root = project in file(".") aggregate(core, contrib) dependsOn core settings(
name := "wartremover-suppressor"
)

useGpg := true
ThisBuild / publishTo := sonatypePublishTo.value
4 changes: 2 additions & 2 deletions project/plugins.sbt
@@ -1,3 +1,3 @@
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.3.7")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.4")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
6 changes: 6 additions & 0 deletions sonatype.sbt.sample
@@ -0,0 +1,6 @@
publishMavenStyle := true

licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))

import xerial.sbt.Sonatype._
sonatypeProjectHosting := ???
Expand Up @@ -14,7 +14,7 @@ object Wart {
final val Equals = prefix + "Equals"
final val ExplicitImplicitTypes = prefix + "ExplicitImplicitTypes"
final val FinalCaseClass = prefix + "FinalCaseClass"
final val FinalVal = prefix + "FinalVal"
final val FinalVal = "org.wartremover.warts.FinalVal" //used in current module
final val ForbidInference = prefix + "ForbidInference"
final val ImplicitConversion = prefix + "ImplicitConversion"
final val ImplicitParameter = prefix + "ImplicitParameter"
Expand Down

0 comments on commit 19df756

Please sign in to comment.