Skip to content

Commit 3d65fa7

Browse files
committed
Merge branch 'feature/java-scala-0.2.1'
2 parents 8649e7f + 0bd6c5c commit 3d65fa7

File tree

6 files changed

+53
-18
lines changed

6 files changed

+53
-18
lines changed

java-scala/CHANGELOG

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.2.1 (2014-07-16)
2+
--------------------------
3+
Updated build process for local Maven publishing (#72)
4+
Bumped SBT to 0.13.2 (#73)
5+
Added support for Scala 2.10.4 and 2.11.1 (#75)
6+
17
Version 0.2.0 (2014-07-02)
28
--------------------------
39
Added configurable list of domains which should count as "internal" (#18)

java-scala/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ Then add into your project's `pom.xml`:
6060
```xml
6161
<dependency>
6262
<groupId>com.snowplowanalytics</groupId>
63-
<artifactId>referer-parser</artifactId>
64-
<version>0.3.0</version>
63+
<artifactId>referer-parser_2.11</artifactId>
64+
<version>0.2.1</version>
6565
</dependency>
6666
```
6767

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

120120
// Dependency
121-
val refererParser = "com.snowplowanalytics" % "referer-parser" % "0.3.0"
121+
val refererParser = "com.snowplowanalytics" %% "referer-parser" % "0.2.1"
122122
```
123123

124124
## Contributing

java-scala/project/BuildSettings.scala

+11-2
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,26 @@ object BuildSettings {
2222
// Basic settings for our app
2323
lazy val basicSettings = Seq[Setting[_]](
2424
organization := "com.snowplowanalytics",
25-
version := "0.2.0",
25+
version := "0.2.1",
2626
description := "Library for extracting marketing attribution data from referer URLs",
2727
scalaVersion := "2.9.1",
28+
crossScalaVersions := Seq("2.9.1", "2.10.4", "2.11.1"),
2829
scalacOptions := Seq("-deprecation", "-encoding", "utf8"),
2930
resolvers ++= Dependencies.resolutionRepos
3031
)
3132

3233
// Publish settings
3334
// TODO: update with ivy credentials etc when we start using Nexus
3435
lazy val publishSettings = Seq[Setting[_]](
35-
crossPaths := false
36+
// Enables publishing to maven repo
37+
publishMavenStyle := true,
38+
39+
publishTo <<= version { version =>
40+
val basePath = "target/repo/%s".format {
41+
if (version.trim.endsWith("SNAPSHOT")) "snapshots/" else "releases/"
42+
}
43+
Some(Resolver.file("Local Maven repository", file(basePath)) transactional())
44+
}
3645
)
3746

3847
lazy val buildSettings = basicSettings ++ publishSettings

java-scala/project/Dependencies.scala

+20-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@
1515
*/
1616

1717
import sbt._
18+
import Keys._
1819

1920
object Dependencies {
2021
val resolutionRepos = Seq(
21-
ScalaToolsSnapshots,
2222
"SnowPlow Analytics Maven repo" at "http://maven.snplow.com/releases/"
2323
)
2424

2525
object V {
2626
val yaml = "1.10"
2727
val http = "4.3.3"
28-
val specs2 = "1.12.1"
28+
object specs2 {
29+
val _29 = "1.12.1"
30+
val _210 = "1.14"
31+
val _211 = "2.3.13"
32+
}
2933
val scalaCheck = "1.10.0"
3034
val scalaUtil = "0.1.0"
3135
val junit = "4.11"
@@ -36,12 +40,25 @@ object Dependencies {
3640
object Libraries {
3741
val yaml = "org.yaml" % "snakeyaml" % V.yaml
3842
val httpClient = "org.apache.httpcomponents" % "httpclient" % V.http
39-
val specs2 = "org.specs2" %% "specs2" % V.specs2 % "test"
43+
object specs2 {
44+
val _29 = "org.specs2" %% "specs2" % V.specs2._29 % "test"
45+
val _210 = "org.specs2" %% "specs2" % V.specs2._210 % "test"
46+
val _211 = "org.specs2" %% "specs2" % V.specs2._211 % "test"
47+
}
4048
val junit = "junit" % "junit" % V.junit % "test"
4149
val json = "org.json" % "json" % V.json % "test"
4250
val scalaCheck = "org.scalacheck" %% "scalacheck" % V.scalaCheck % "test"
4351
val scalaUtil = "com.snowplowanalytics" % "scala-util" % V.scalaUtil % "test"
4452
val json4sJackson = "org.json4s" %% "json4s-jackson" % V.json4s % "test"
4553
val json4sScalaz = "org.json4s" %% "json4s-scalaz" % V.json4s % "test"
4654
}
55+
56+
def onVersion[A](all: Seq[A] = Seq(), on29: => Seq[A] = Seq(), on210: => Seq[A] = Seq(), on211: => Seq[A] = Seq()) =
57+
scalaVersion(v => all ++ (if (v.contains("2.9.")) {
58+
on29
59+
} else if (v.contains("2.10.")) {
60+
on210
61+
} else {
62+
on211
63+
}))
4764
}

java-scala/project/RefererParserBuild.scala

+12-9
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ object RefererParserBuild extends Build {
3131
lazy val project = Project("referer-parser", file("."))
3232
.settings(buildSettings: _*)
3333
.settings(
34-
libraryDependencies ++= Seq(
35-
Libraries.yaml,
36-
Libraries.httpClient,
37-
Libraries.specs2,
38-
Libraries.scalaCheck,
39-
Libraries.scalaUtil,
40-
Libraries.junit,
41-
Libraries.json,
42-
Libraries.json4sJackson
34+
libraryDependencies <++= Dependencies.onVersion(
35+
all = Seq(
36+
Libraries.yaml,
37+
Libraries.httpClient,
38+
Libraries.scalaCheck,
39+
Libraries.scalaUtil,
40+
Libraries.junit,
41+
Libraries.json,
42+
Libraries.json4sJackson),
43+
on29 = Seq(Libraries.specs2._29),
44+
on210 = Seq(Libraries.specs2._210),
45+
on211 = Seq(Libraries.specs2._211)
4346
)
4447
)
4548
}

java-scala/project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.11.3
1+
sbt.version=0.13.2

0 commit comments

Comments
 (0)