Skip to content

Commit

Permalink
Merge branch 'feature/java-scala-0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderdean committed Jul 16, 2014
2 parents 8649e7f + 0bd6c5c commit 3d65fa7
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 18 deletions.
6 changes: 6 additions & 0 deletions java-scala/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version 0.2.1 (2014-07-16)
--------------------------
Updated build process for local Maven publishing (#72)
Bumped SBT to 0.13.2 (#73)
Added support for Scala 2.10.4 and 2.11.1 (#75)

Version 0.2.0 (2014-07-02)
--------------------------
Added configurable list of domains which should count as "internal" (#18)
Expand Down
6 changes: 3 additions & 3 deletions java-scala/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ Then add into your project's `pom.xml`:
```xml
<dependency>
<groupId>com.snowplowanalytics</groupId>
<artifactId>referer-parser</artifactId>
<version>0.3.0</version>
<artifactId>referer-parser_2.11</artifactId>
<version>0.2.1</version>
</dependency>
```

Expand Down Expand Up @@ -118,7 +118,7 @@ Add this to your SBT config:
val snowplowRepo = "SnowPlow Repo" at "http://maven.snplow.com/releases/"

// Dependency
val refererParser = "com.snowplowanalytics" % "referer-parser" % "0.3.0"
val refererParser = "com.snowplowanalytics" %% "referer-parser" % "0.2.1"
```

## Contributing
Expand Down
13 changes: 11 additions & 2 deletions java-scala/project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@ object BuildSettings {
// Basic settings for our app
lazy val basicSettings = Seq[Setting[_]](
organization := "com.snowplowanalytics",
version := "0.2.0",
version := "0.2.1",
description := "Library for extracting marketing attribution data from referer URLs",
scalaVersion := "2.9.1",
crossScalaVersions := Seq("2.9.1", "2.10.4", "2.11.1"),
scalacOptions := Seq("-deprecation", "-encoding", "utf8"),
resolvers ++= Dependencies.resolutionRepos
)

// Publish settings
// TODO: update with ivy credentials etc when we start using Nexus
lazy val publishSettings = Seq[Setting[_]](
crossPaths := false
// Enables publishing to maven repo
publishMavenStyle := true,

publishTo <<= version { version =>
val basePath = "target/repo/%s".format {
if (version.trim.endsWith("SNAPSHOT")) "snapshots/" else "releases/"
}
Some(Resolver.file("Local Maven repository", file(basePath)) transactional())
}
)

lazy val buildSettings = basicSettings ++ publishSettings
Expand Down
23 changes: 20 additions & 3 deletions java-scala/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@
*/

import sbt._
import Keys._

object Dependencies {
val resolutionRepos = Seq(
ScalaToolsSnapshots,
"SnowPlow Analytics Maven repo" at "http://maven.snplow.com/releases/"
)

object V {
val yaml = "1.10"
val http = "4.3.3"
val specs2 = "1.12.1"
object specs2 {
val _29 = "1.12.1"
val _210 = "1.14"
val _211 = "2.3.13"
}
val scalaCheck = "1.10.0"
val scalaUtil = "0.1.0"
val junit = "4.11"
Expand All @@ -36,12 +40,25 @@ object Dependencies {
object Libraries {
val yaml = "org.yaml" % "snakeyaml" % V.yaml
val httpClient = "org.apache.httpcomponents" % "httpclient" % V.http
val specs2 = "org.specs2" %% "specs2" % V.specs2 % "test"
object specs2 {
val _29 = "org.specs2" %% "specs2" % V.specs2._29 % "test"
val _210 = "org.specs2" %% "specs2" % V.specs2._210 % "test"
val _211 = "org.specs2" %% "specs2" % V.specs2._211 % "test"
}
val junit = "junit" % "junit" % V.junit % "test"
val json = "org.json" % "json" % V.json % "test"
val scalaCheck = "org.scalacheck" %% "scalacheck" % V.scalaCheck % "test"
val scalaUtil = "com.snowplowanalytics" % "scala-util" % V.scalaUtil % "test"
val json4sJackson = "org.json4s" %% "json4s-jackson" % V.json4s % "test"
val json4sScalaz = "org.json4s" %% "json4s-scalaz" % V.json4s % "test"
}

def onVersion[A](all: Seq[A] = Seq(), on29: => Seq[A] = Seq(), on210: => Seq[A] = Seq(), on211: => Seq[A] = Seq()) =
scalaVersion(v => all ++ (if (v.contains("2.9.")) {
on29
} else if (v.contains("2.10.")) {
on210
} else {
on211
}))
}
21 changes: 12 additions & 9 deletions java-scala/project/RefererParserBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ object RefererParserBuild extends Build {
lazy val project = Project("referer-parser", file("."))
.settings(buildSettings: _*)
.settings(
libraryDependencies ++= Seq(
Libraries.yaml,
Libraries.httpClient,
Libraries.specs2,
Libraries.scalaCheck,
Libraries.scalaUtil,
Libraries.junit,
Libraries.json,
Libraries.json4sJackson
libraryDependencies <++= Dependencies.onVersion(
all = Seq(
Libraries.yaml,
Libraries.httpClient,
Libraries.scalaCheck,
Libraries.scalaUtil,
Libraries.junit,
Libraries.json,
Libraries.json4sJackson),
on29 = Seq(Libraries.specs2._29),
on210 = Seq(Libraries.specs2._210),
on211 = Seq(Libraries.specs2._211)
)
)
}
2 changes: 1 addition & 1 deletion java-scala/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.11.3
sbt.version=0.13.2

0 comments on commit 3d65fa7

Please sign in to comment.