summaryrefslogtreecommitdiff
path: root/project/Build.scala
blob: 1542f8f8bb949e08aa0d879ca38985022b888012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import sbt._
import sbt.Keys._
import xml.Group
import aether._

object Build extends sbt.Build {

  lazy val buildSettings = Defaults.defaultSettings ++ Aether.aetherPublishSettings ++ Seq(
    organization := "io.trygvis",
    scalaVersion := "2.10.0",
//    crossScalaVersions := Seq("2.9.1", "2.9.2", "2.10.0"),
    scalacOptions := Seq("-deprecation"),
    publishTo <<= (version) apply {
      (v: String) => if (v.trim().endsWith("SNAPSHOT")) Some(Resolvers.sonatypeNexusSnapshots) else Some(Resolvers.sonatypeNexusStaging)
    },
    pomIncludeRepository := { x => false },
    credentials += Credentials(Path.userHome / ".sbt" / ".credentials")
  )

  lazy val root = Project(
    id = "collection-json-explorer",
    base = file("."),
    settings = buildSettings ++ Seq(
      description := "Collection+JSON Explorer",
      name := "collection-json-explorer",
      libraryDependencies += "net.hamnaberg.rest" %% "scala-json-collection" % "2.1-SNAPSHOT",
      libraryDependencies += "net.databinder" %% "unfiltered-filter" % "0.6.8",
      libraryDependencies += "net.databinder" %% "unfiltered-directives" % "0.6.8",
      libraryDependencies += "net.databinder" %% "unfiltered-jetty" % "0.6.8",
      libraryDependencies += "net.databinder" %% "unfiltered-netty" % "0.6.8",
      libraryDependencies <+= scalaVersion { sv =>
          val ver = if (sv.startsWith("2.10")) "1.13" else "1.12.3"
          "org.specs2" %% "specs2" % ver % "test"
      }/*,
      manifestSetting*/
      ) ++ mavenCentralFrouFrou
    )

    object Resolvers {
      val sonatypeNexusSnapshots = "Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
      val sonatypeNexusStaging = "Sonatype Nexus Staging" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"
    }

    /*
    lazy val manifestSetting = packageOptions <+= (name, version, organization) map {
      (title, version, vendor) =>
        Package.ManifestAttributes(
          "Created-By" -> "Simple Build Tool",
          "Built-By" -> System.getProperty("user.name"),
          "Build-Jdk" -> System.getProperty("java.version"),
          "Specification-Title" -> title,
          "Specification-Version" -> version,
          "Specification-Vendor" -> vendor,
          "Implementation-Title" -> title,
          "Implementation-Version" -> version,
          "Implementation-Vendor-Id" -> vendor,
          "Implementation-Vendor" -> vendor
        )
    }
    */

    // Things we care about primarily because Maven Central demands them
    lazy val mavenCentralFrouFrou = Seq(
//      homepage := Some(new URL("http://github.com/hamnis/scala-collection-json/")),
      startYear := Some(2013),
      licenses := Seq(("Apache 2", new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")))/*,
      pomExtra <<= (pomExtra, name, description) {(pom, name, desc) => pom ++ Group(
        <scm>
          <url>http://github.com/hamnis/scala-collection-json</url>
          <connection>scm:git:git://github.com/hamnis/scala-collection-json.git</connection>
          <developerConnection>scm:git:git@github.com:hamnis/scala-collection-json.git</developerConnection>
        </scm>
        <developers>
          <developer>
            <id>hamnis</id>
            <name>Erlend Hamnaberg</name>
            <url>http://twitter.com/hamnis</url>
          </developer>
        </developers>
      )}
      */
    )
  }