際際滷

際際滷Share a Scribd company logo
1
sbtのマルチ
プロジェクトは
いいぞ2016-10-08(Sat) / @yoshiyoshifujii
2 . 1
こんにちは
Yoshitaka Fujii
Software Engineer
Scala / Java / Python / Typescript
Scala v廉Summit 2016 Sta
@yoshiyoshifujii
3
書晩のおsbtのマルチプロジェクトの措いところをごB初
sbtのマルチプロジェクトにしてみた
4
sbt
聞ってますか`?
5
マルチプロジェク
トにしてますか`?
6
eO議にされてま
すか`?
7
eO議な試喘箭lazy val root = (project in file(".")).
enablePlugins(ReleasePlugin).
aggregate(core,jwt,awsCore,awsS3,awsDynamoDB,awsSQS,awsKinesis,awsLambda4ApiGateway,awsLambda4K
settings(commonSettings: _*).
settings(publishSettings: _*).
settings(
name := "modules-lambda"
)
lazy val core = (project in file("core")).
enablePlugins(ReleasePlugin).
settings(commonSettings: _*).
settings(publishSettings: _*).
settings(
description := "Common modules.",
name := "modules-lambda-core",
libraryDependencies ++= coreDeps
)
lazy val jwt = (project in file("jwt")).
enablePlugins(ReleasePlugin).
dependsOn(core).
8
いいと房うところ
9
かんたん
build.sbt
lazy val root = (project in file("./root"))
lazy val sample = (project in file("./sample"))
sbt
$ sbt
>
directories
$ ls -l
root/
sample/
10
11
いつマルチプロジェクトにするの?
児云いつでも
あえてい欧襪覆
何瞳晒(common, util, io, ...)
DDDのコンテキストや鹿sをモジュ`ル晒
IDEAでまとめてシ
12
やってみた
seratch/AWScala
13
yoshiyoshifujii/AWScala
14
Build.scala
lazy val root = Project("root", file("."), settings = mainSettings)
lazy val mainSettings = Seq(
organization := "com.github.seratch",
name := "awscala",
version := "0.5.6",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.11.8", "2.10.6"),
publishMavenStyle := true,
resolvers += "spray repo" at "http://repo.spray.io",
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-java-sdk-iam" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-sts" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-ec2" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-s3" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-sqs" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-emr" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-redshift" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-dynamodb" % awsJavaSdkVersion,
"com.amazonaws" % "aws-java-sdk-simpledb" % awsJavaSdkVersion,
"joda-time" % "joda-time" % "2.9.4",
"org.joda" % "joda-convert" % "1.8.1",
15
16
蛍裂とO
岷和にsrcがあるシングルプロジェクト撹
AWSのSDKに弼?と卆贋している
S3だけ聞いたくてもEC2が息れなくついてくる
S3だけとかDynamoDBだけとかにしたい
Build.scala
lazy val root = Project("root", file(".")).
aggregate(awscalaCore,
awscalaS3,
awscalaDynamoDBv2,
awscalaSQS,
awscalaEC2,
awscalaEMR,
awscalaIAM,
awscalaRedshift,
awscalaSimpleDB,
awscalaSTS)
lazy val commonSettings = Seq(
organization := "com.github.seratch",
version := "0.6.0-SNAPSHOT",
scalaVersion := "2.11.8",
crossScalaVersions := Seq("2.11.8", "2.10.6"),
publishMavenStyle := true,
resolvers += "spray repo" at "http://repo.spray.io",
sbtPlugin := false,
transitiveClassifiers in Global := Seq(Artifact.SourceClassifier),
incOptions := incOptions.value.withNameHashing(true),
17
18
やったこと
rootは畠プロジェクトのまとめ叨
ディレクトリにAWSサ`ビスごとのディレクトリを恬った
それらをマルチプロジェクトにした
で をg佩するとAWSサ`ビスg了のjarになる
19
卆贋vSを恷m晒できる
build.sbt
"com.github.seratch" %% "awscala-s3" % awscalaVersion
"com.github.seratch" %% "awscala-dynamodbv2" % awscalaVersion
"com.github.seratch" %% "awscala-sqs" % awscalaVersion
20
參貧です

More Related Content

皆恢岳のマルチフ?ロシ?ェクトはいいそ?