Skip to content

Commit

Permalink
add basic play and smithy structure
Browse files Browse the repository at this point in the history
  • Loading branch information
MoeQuadrat committed Oct 19, 2022
1 parent d5d185f commit 108150c
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 89 deletions.
1 change: 1 addition & 0 deletions .bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"sbt","version":"1.7.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/moritzlintterer/.sdkman/candidates/java/11.0.16.1-zulu/zulu-11.jdk/Contents/Home/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/moritzlintterer/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.4167.29/IntelliJ IDEA.app.plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/Users/moritzlintterer/Library/Application%20Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/222.4167.29/IntelliJ%20IDEA.app.plugins/Scala/launcher/sbt-launch.jar"]}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# smithy4play-example
25 changes: 25 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.13.10"

lazy val root = (project in file("."))
.enablePlugins(Smithy4sCodegenPlugin, PlayScala)
.dependsOn(api)
.settings(
scalaVersion := Dependencies.scalaVersion,
GithubConfig.settings,
name := "smithy4play-example",
scalacOptions += "-Ymacro-annotations",
libraryDependencies ++= Dependencies.list,
)

lazy val api = (project in file("modules/api"))
.enablePlugins(Smithy4sCodegenPlugin)
.settings(
scalaVersion := Dependencies.scalaVersion,
libraryDependencies ++= Dependencies.list,
GithubConfig.settings,
Compile / smithy4sInputDir := (ThisBuild / baseDirectory).value / "modules" / "api-definition" / "src" / "main" / "resources" / "META-INF" / "smithy",
Compile / smithy4sOutputDir := (ThisBuild / baseDirectory).value / "modules" / "api" / "src" / "main" / "scala"
)
lazy val apiDefinition = project in file("modules/api-definition")
4 changes: 0 additions & 4 deletions conf/routes
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@

-> / de.innfactory.smithy4play.AutoRouter


GET / de.BA.preview.controller.PreviewPlay.index
GET /index de.BA.preview.controller.PreviewPlay.index2
11 changes: 11 additions & 0 deletions modules/api-definition/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
val releaseVersion = "0.0.1"

lazy val apiDefinition = (project in file("."))
.enablePlugins(Smithy4sCodegenPlugin)
.settings(
name := "api-definition",
scalaVersion := Dependencies.scalaVersion,
version := releaseVersion,
GithubConfig.settings,
libraryDependencies += "com.disneystreaming.smithy4s" % "smithy4s-protocol" % "0.16.2"
)
5 changes: 5 additions & 0 deletions modules/api-definition/project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sbt._

object Dependencies {
val scalaVersion = "2.13.8"
}
21 changes: 21 additions & 0 deletions modules/api-definition/project/GithubConfig.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import sbt.Credentials
import sbt.Keys.credentials
import sbtghpackages.GitHubPackagesPlugin.autoImport.{githubOwner, githubRepository}

object GithubConfig {
private val token = sys.env.getOrElse("GITHUB_TOKEN", "")

val settings = Seq(
githubOwner := "innFactory",
githubRepository := "bootstrap-play2",
credentials :=
Seq(
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"innFactory",
token
)
)
)
}
1 change: 1 addition & 0 deletions modules/api-definition/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.6.2
2 changes: 2 additions & 0 deletions modules/api-definition/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.16.5")
Empty file.
85 changes: 0 additions & 85 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,103 +4,18 @@ import sbt._
object Dependencies {

val scalaVersion = "2.13.8"
val akkaVersion = "2.6.19"
val akkaManagementVersion = "1.1.3"

val akkaTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion
val akkaHttp = "com.typesafe.akka" %% "akka-http" % "10.2.9"
val akka = "com.typesafe.akka" %% "akka-actor" % akkaVersion
val akkaDiscovery = "com.typesafe.akka" %% "akka-discovery" % akkaVersion
val akkaManagementClusterHttp =
"com.lightbend.akka.management" %% "akka-management-cluster-http" % akkaManagementVersion
val akkaManagementClusterBootstrap =
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % akkaManagementVersion
val akkaDiscoveryKubernetes =
"com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % akkaManagementVersion
val akkaClusterShardingTyped = "com.typesafe.akka" %% "akka-cluster-sharding-typed" % akkaVersion
// https://github.com/akka/akka/issues/29351
val akkaJackson = "com.typesafe.akka" %% "akka-serialization-jackson" % akkaVersion
val akkaStreams = "com.typesafe.akka" %% "akka-stream" % akkaVersion
val akkaSpray = "com.typesafe.akka" %% "akka-http-spray-json" % "10.2.9"

// innFactory Utils
val scalaUtil = "de.innfactory.scala-utils" %% "scala-utils" % "2.0.1"
val smithy4play = "de.innfactory" %% "smithy4play" % "0.2.3-HOTFIX"

// Prod
val slickPg = "com.github.tminglei" %% "slick-pg" % "0.20.4"
val slickPgPlayJson = "com.github.tminglei" %% "slick-pg_play-json" % "0.20.4"
val slickPgJts = "com.github.tminglei" %% "slick-pg_jts" % "0.20.4"
val slickJodaMapper = "com.github.tototoshi" %% "slick-joda-mapper" % "2.4.2"
val playJson = "com.typesafe.play" %% "play-json" % "2.9.2"
val playJsonJoda = "com.typesafe.play" %% "play-json-joda" % "2.9.2"
val slick = "com.typesafe.slick" %% "slick" % "3.3.3"
val slickCodegen = "com.typesafe.slick" %% "slick-codegen" % "3.3.3"
val slickHikaricp = "com.typesafe.slick" %% "slick-hikaricp" % "3.3.3"
val hikariCP = "com.zaxxer" % "HikariCP" % "5.0.1"
val joda = "joda-time" % "joda-time" % "2.11.0"
val postgresql = "org.postgresql" % "postgresql" % "42.5.0"
val cats = "org.typelevel" %% "cats-core" % "2.8.0"
val chimney = "io.scalaland" %% "chimney" % "0.6.2"
val jodaJackson = "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4"

// Test
val playAhcWS = "com.typesafe.play" %% "play-ahc-ws" % "2.8.16" % Test
val scalatestPlus = "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test

// opentelemetry
val opentelemetryApi = "io.opentelemetry" % "opentelemetry-api" % "1.18.0"
val opentelemetryBom = "io.opentelemetry" % "opentelemetry-bom" % "1.18.0"

val sl4j = "org.slf4j" % "slf4j-api" % "1.7.35"
val sharedDeps = "com.google.cloud" % "google-cloud-shared-dependencies" % "3.0.1"
val logback = "ch.qos.logback" % "logback-classic" % "1.2.11"
val logbackCore = "ch.qos.logback" % "logback-core" % "1.2.11"

val nimbusJwt = "com.nimbusds" % "nimbus-jose-jwt" % "9.15.2"

val firebase = "com.google.firebase" % "firebase-admin" % "8.1.0"

lazy val list = Seq(
scalaUtil,
sl4j,
chimney,
sharedDeps,
logback,
logbackCore,
akkaHttp,
akka,
akkaTyped,
akkaJackson,
akkaClusterShardingTyped,
akkaManagementClusterBootstrap,
akkaManagementClusterHttp,
akkaDiscoveryKubernetes,
akkaDiscovery,
akkaSpray,
guice,
slickPg,
slickPgPlayJson,
slickJodaMapper,
playJson,
playJsonJoda,
slick,
slickCodegen,
slickHikaricp,
hikariCP,
joda,
postgresql,
scalatestPlus,
playAhcWS,
slickPgJts,
akkaStreams,
cats,
smithy4play,
ws,
opentelemetryApi,
opentelemetryBom,
nimbusJwt,
firebase,
jodaJackson
)
}
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version = 1.7.2
3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.15")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.3")
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.16.1")

0 comments on commit 108150c

Please sign in to comment.