Skip to content

Commit

Permalink
Add Scalatra 3.0 examples (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe authored Oct 8, 2023
1 parent 49ce414 commit cfc7f02
Show file tree
Hide file tree
Showing 182 changed files with 50,834 additions and 12 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ jobs:
strategy:
matrix:
test_dir:
- 2.8/async/akka-examples
- 2.8/deployment/scalatra-heroku
- 2.8/formats/scalatra-forms
- 2.8/http/authentication-demo
- 2.8/http/scalatra-gzip
- 2.8/http/scalatra-http-demo
- 2.8/http/scentry-auth-demo
- 2.8/persistence/scalatra-slick
- 2.8/persistence/scalatra-squeryl
- 2.8/views/scalatra-twirl
- 2.8/swagger-example
- 3.0/async/pekko-examples
- 3.0/formats/scalatra-forms
- 3.0/http/authentication-demo
- 3.0/http/scalatra-gzip
- 3.0/http/scalatra-http-demo
- 3.0/http/scentry-auth-demo
- 3.0/persistence/scalatra-slick
- 3.0/persistence/scalatra-squeryl
- 3.0/views/scalatra-twirl
- 3.0/swagger-example
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Run tests
env:
TEST_DIR: ${{ matrix.test_dir }}
Expand Down
69 changes: 69 additions & 0 deletions 3.0/async/pekko-examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## generic files to ignore
*~
*.lock
*.DS_Store
*.swp
*.out

# rails specific
*.sqlite3
config/database.yml
log/*
tmp/*

# java specific
*.class

# python specific
*.pyc

# xcode/iphone specific
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.perspective
*.perspectivev3
*~.nib

# akka specific
logs/*

# sbt specific
target/
project/boot
lib_managed/*
project/build/target
project/build/lib_managed
project/build/src_managed
project/plugins/lib_managed
project/plugins/target
project/plugins/src_managed
project/plugins/project

core/lib_managed
core/target
pubsub/lib_managed
pubsub/target

# eclipse specific
.metadata
jrebel.lic
.settings
.classpath
.project

.ensime*
*.sublime-*
.cache

# intellij
*.eml
*.iml
*.ipr
*.iws
.*.sw?
.idea

# paulp script
/.lib/
16 changes: 16 additions & 0 deletions 3.0/async/pekko-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pekko-examples #

Corresponds to the guide at [http://scalatra.org/guides/3.0/async/pekko.html](http://scalatra.org/guides/3.0/async/pekko.html)

## Build & Run ##

```sh
$ git clone https://github.com/scalatra/scalatra-website-examples.git
$ cd scalatra-website-examples/3.0/async/pekko-examples
$ chmod +x sbt
$ ./sbt ~jetty:start
```

First, open [http://localhost:8080/ask](http://localhost:8080/ask) in your browser. You'll see the "question and answer" in the browser.

Second, Open [http://localhost:8080/](http://localhost:8080/) in your browser. You'll see the "question and answer" in your terminal.
21 changes: 21 additions & 0 deletions 3.0/async/pekko-examples/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
organization := "com.example"
name := "Pekko Examples"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.3.1"

val ScalatraVersion = "3.0.0"

libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-actor" % "1.0.0" cross(CrossVersion.for3Use2_13),
"org.apache.pekko" %% "pekko-http" % "1.0.0" cross(CrossVersion.for3Use2_13),
"org.scalaj" %% "scalaj-http" % "2.4.2" cross(CrossVersion.for3Use2_13),
"ch.qos.logback" % "logback-classic" % "1.4.11" % Provided,
"org.scalatra" %% "scalatra-jakarta" % ScalatraVersion,
"org.scalatra" %% "scalatra-specs2-jakarta" % ScalatraVersion % "test",
"org.eclipse.jetty" % "jetty-webapp" % "11.0.15" % "provided",
"jakarta.servlet" % "jakarta.servlet-api" % "5.0.0" % "provided"
)

enablePlugins(JettyPlugin)

Jetty / containerLibs := Seq("org.eclipse.jetty" % "jetty-runner" % "11.0.15" intransitive())
1 change: 1 addition & 0 deletions 3.0/async/pekko-examples/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.9.6
2 changes: 2 additions & 0 deletions 3.0/async/pekko-examples/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
Loading

0 comments on commit cfc7f02

Please sign in to comment.