Skip to content

Commit a22b4d2

Browse files
committed
reörg project
use sbt 13, and update build file split scratch code off into subproject and clean up dependencies move library into root src dir insert Apache license header in each file update package naming scheme from aws.wrap to com.pellucid.wrap
1 parent 3b3afa6 commit a22b4d2

File tree

22 files changed

+467
-255
lines changed

22 files changed

+467
-255
lines changed

LICENSE

Lines changed: 167 additions & 177 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
# A Scala Wrapper for AWS Java SDK Async Clients

README.textile

Lines changed: 0 additions & 24 deletions
This file was deleted.

project/Build.scala

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

2+
import scala.language.postfixOps
3+
24
import sbt._
3-
import sbt.Keys._
4-
import sbt.Project.Initialize
5+
import Keys._
6+
57

6-
object AWSBuild extends Build {
8+
object AWSWrapBuild extends Build {
79

810
lazy val buildSettings = Seq(
9-
organization := "aws",
11+
organization := "com.pellucid",
1012
version := "0.5-SNAPSHOT",
1113
scalaVersion := "2.10.2",
1214
scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked"),
@@ -17,21 +19,40 @@ object AWSBuild extends Build {
1719
super.settings ++
1820
buildSettings
1921

20-
lazy val wrap = Project(
21-
id = "wrap",
22-
base = file("wrap"),
22+
lazy val awsWrap = Project(
23+
id = "aws-wrap",
24+
base = file("."),
2325
settings =
24-
Defaults.defaultSettings ++
26+
commonSettings ++
2527
Publish.settings ++
2628
Seq(
27-
resolvers ++= Seq(
28-
"typesafe" at "http://repo.typesafe.com/typesafe/releases",
29-
"sonatype" at "http://oss.sonatype.org/content/repositories/releases"
30-
),
31-
libraryDependencies ++= Dependencies.wrap
29+
libraryDependencies ++= Dependencies.awsWrap
30+
)
31+
)
32+
33+
lazy val scratch = Project(
34+
id = "scratch",
35+
base = file("scratch"),
36+
dependencies = Seq(awsWrap),
37+
settings =
38+
commonSettings ++
39+
Seq(
40+
libraryDependencies ++= Dependencies.scratch,
41+
publish := (),
42+
publishLocal := ()
3243
)
44+
3345
)
3446

47+
lazy val commonSettings =
48+
Defaults.defaultSettings ++
49+
Seq(
50+
resolvers ++= Seq(
51+
"typesafe" at "http://repo.typesafe.com/typesafe/releases",
52+
"sonatype" at "http://oss.sonatype.org/content/repositories/releases"
53+
)
54+
)
55+
3556
}
3657

3758
object Dependencies {
@@ -42,6 +63,8 @@ object Dependencies {
4263
val jodaTime = "2.2"
4364
val jodaConvert = "1.3.1"
4465

66+
val slf4j = "1.7.5"
67+
4568
val logback = "1.0.13"
4669
}
4770

@@ -52,12 +75,15 @@ object Dependencies {
5275
val jodaTime = "joda-time" % "joda-time" % V.jodaTime
5376
val jodaConvert = "org.joda" % "joda-convert" % V.jodaConvert
5477

78+
val slf4j = "org.slf4j" % "slf4j-api" % V.slf4j
79+
5580
val logback = "ch.qos.logback" % "logback-classic" % V.logback
5681
}
5782

5883
import Compile._
5984

60-
val wrap = Seq(awsJavaSDK, jodaTime, jodaConvert, logback)
85+
val awsWrap = Seq(awsJavaSDK, slf4j)
86+
val scratch = Seq(awsJavaSDK, jodaTime, jodaConvert, logback)
6187

6288
}
6389

@@ -69,7 +95,7 @@ object Publish {
6995
)
7096

7197
// "AWS" at "http://pellucidanalytics.github.com/aws/repository/"
72-
def localPublishTo: Initialize[Option[Resolver]] = {
98+
def localPublishTo: Def.Initialize[Option[Resolver]] = {
7399
version { v: String =>
74100
val localPublishRepo = "../datomisca-repo/"
75101
if (v.trim endsWith "SNAPSHOT")

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.12.4
1+
sbt.version=0.13.0-RC5

wrap/src/main/resources/logback.xml renamed to scratch/src/main/resources/logback.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<logger name="com.amazonaws" level="INFO"/>
1010
<logger name="org.apache.http" level="INFO"/>
1111

12-
<logger name="aws.wrap" level="DEBUG"/>
12+
<logger name="com.pellucid.wrap" level="DEBUG"/>
1313

1414
<root level="DEBUG">
1515
<appender-ref ref="STDOUT" />

wrap/src/main/scala/dynamodb/Scratch.scala renamed to scratch/src/main/scala/Scratch.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

2-
package aws.wrap.dynamodb
2+
package scratch
3+
4+
import com.pellucid.wrap.dynamodb._
35

46
import scala.collection.JavaConverters._
57
import scala.concurrent._

wrap/src/main/scala/dynamodb/ConcurrentBatchWriter.scala renamed to src/main/scala/dynamodb/ConcurrentBatchWriter.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package aws.wrap.dynamodb
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap.dynamodb
218

319
import java.{util => ju}
420
import java.util.{concurrent => juc}

wrap/src/main/scala/dynamodb/SingleThreadedBatchWriter.scala renamed to src/main/scala/dynamodb/SingleThreadedBatchWriter.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package aws.wrap.dynamodb
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap.dynamodb
218

319
import java.{util => ju}
420
import java.util.Random

wrap/src/main/scala/dynamodb/conditions.scala renamed to src/main/scala/dynamodb/conditions.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package aws.wrap.dynamodb
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap.dynamodb
218

319
import scala.collection.JavaConverters._
420

wrap/src/main/scala/dynamodb/dynamodb.scala renamed to src/main/scala/dynamodb/dynamodb.scala

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
2-
package aws.wrap
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap
318
package dynamodb
419

520
import scala.concurrent.{Future, ExecutionContext}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap.dynamodb
18+
19+
20+
/**
21+
* A value could not be converted to an [[http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/AttributeValue.html AttributeValue]]
22+
*
23+
* @param message
24+
* the exception message
25+
* @see [[http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/AttributeValue.html AWS Java SDK]]
26+
*/
27+
class AttributeValueConversionException(message: String) extends RuntimeException(message)

wrap/src/main/scala/dynamodb/mapper.scala renamed to src/main/scala/dynamodb/mapper.scala

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package aws.wrap
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap
218
package dynamodb
319

420
import scala.concurrent.{Future, ExecutionContext}
@@ -113,7 +129,7 @@ trait DynamoDBSerializer[T] {
113129
* The key is represented as a map.
114130
*
115131
* @param hashKey
116-
* An value that is convertable to an [[aws.wrap.dynamodb.AttributeValue AttributeValue]].
132+
* An value that is convertable to an [[com.pellucid.wrap.dynamodb.AttributeValue AttributeValue]].
117133
* @return a map from attribute names to attribute values.
118134
*/
119135
def makeKey[K](hashKey: K)(implicit conv: K => AttributeValue): Map[String, AttributeValue] =
@@ -125,9 +141,9 @@ trait DynamoDBSerializer[T] {
125141
* The key is represented as a map.
126142
*
127143
* @param hashKey
128-
* An value that is convertable to an [[aws.wrap.dynamodb.AttributeValue AttributeValue]].
144+
* An value that is convertable to an [[com.pellucid.wrap.dynamodb.AttributeValue AttributeValue]].
129145
* @param rangeKey
130-
* An value that is convertable to an [[aws.wrap.dynamodb.AttributeValue AttributeValue]].
146+
* An value that is convertable to an [[com.pellucid.wrap.dynamodb.AttributeValue AttributeValue]].
131147
* @return a map from attribute names to attribute values.
132148
*/
133149
def makeKey[K1, K2](

wrap/src/main/scala/dynamodb/package.scala renamed to src/main/scala/dynamodb/package.scala

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116

2-
package aws.wrap
17+
package com.pellucid.wrap
318

419
import scala.collection.JavaConverters._
520

wrap/src/main/scala/dynamodb/schema.scala renamed to src/main/scala/dynamodb/schema.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package aws.wrap.dynamodb
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid.wrap.dynamodb
218

319
import com.amazonaws.services.dynamodbv2.model.{
420
AttributeDefinition, KeySchemaElement, KeyType,

wrap/src/main/scala/package.scala renamed to src/main/scala/package.scala

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
2-
package aws
1+
/*
2+
* Copyright 2013 Pellucid Analytics
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.pellucid
318

419
import scala.concurrent.{Future, Promise}
520
import java.util.concurrent.{Future => JFuture}
@@ -22,7 +37,7 @@ package object wrap {
2237
}
2338

2439
@inline
25-
private[aws] def wrapAsyncMethod[Request <: AmazonWebServiceRequest, Result](
40+
private[pellucid] def wrapAsyncMethod[Request <: AmazonWebServiceRequest, Result](
2641
f: (Request, AsyncHandler[Request, Result]) => JFuture[Result],
2742
request: Request
2843
): Future[Result] = {
@@ -32,7 +47,7 @@ package object wrap {
3247
}
3348

3449
@inline
35-
private[aws] def wrapVoidAsyncMethod[Request <: AmazonWebServiceRequest](
50+
private[pellucid] def wrapVoidAsyncMethod[Request <: AmazonWebServiceRequest](
3651
f: (Request, AsyncHandler[Request, Void]) => JFuture[Void],
3752
request: Request
3853
): Future[Unit] = {

0 commit comments

Comments
 (0)