Skip to content

Commit cfc7f02

Browse files
authored
Add Scalatra 3.0 examples (#85)
1 parent 49ce414 commit cfc7f02

File tree

182 files changed

+50834
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+50834
-12
lines changed

.github/workflows/scala.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,22 @@ jobs:
1212
strategy:
1313
matrix:
1414
test_dir:
15-
- 2.8/async/akka-examples
16-
- 2.8/deployment/scalatra-heroku
17-
- 2.8/formats/scalatra-forms
18-
- 2.8/http/authentication-demo
19-
- 2.8/http/scalatra-gzip
20-
- 2.8/http/scalatra-http-demo
21-
- 2.8/http/scentry-auth-demo
22-
- 2.8/persistence/scalatra-slick
23-
- 2.8/persistence/scalatra-squeryl
24-
- 2.8/views/scalatra-twirl
25-
- 2.8/swagger-example
15+
- 3.0/async/pekko-examples
16+
- 3.0/formats/scalatra-forms
17+
- 3.0/http/authentication-demo
18+
- 3.0/http/scalatra-gzip
19+
- 3.0/http/scalatra-http-demo
20+
- 3.0/http/scentry-auth-demo
21+
- 3.0/persistence/scalatra-slick
22+
- 3.0/persistence/scalatra-squeryl
23+
- 3.0/views/scalatra-twirl
24+
- 3.0/swagger-example
2625
steps:
2726
- uses: actions/checkout@v2
2827
- name: Set up JDK 1.8
2928
uses: actions/setup-java@v1
3029
with:
31-
java-version: 1.8
30+
java-version: 11
3231
- name: Run tests
3332
env:
3433
TEST_DIR: ${{ matrix.test_dir }}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## generic files to ignore
2+
*~
3+
*.lock
4+
*.DS_Store
5+
*.swp
6+
*.out
7+
8+
# rails specific
9+
*.sqlite3
10+
config/database.yml
11+
log/*
12+
tmp/*
13+
14+
# java specific
15+
*.class
16+
17+
# python specific
18+
*.pyc
19+
20+
# xcode/iphone specific
21+
build/*
22+
*.pbxuser
23+
*.mode2v3
24+
*.mode1v3
25+
*.perspective
26+
*.perspectivev3
27+
*~.nib
28+
29+
# akka specific
30+
logs/*
31+
32+
# sbt specific
33+
target/
34+
project/boot
35+
lib_managed/*
36+
project/build/target
37+
project/build/lib_managed
38+
project/build/src_managed
39+
project/plugins/lib_managed
40+
project/plugins/target
41+
project/plugins/src_managed
42+
project/plugins/project
43+
44+
core/lib_managed
45+
core/target
46+
pubsub/lib_managed
47+
pubsub/target
48+
49+
# eclipse specific
50+
.metadata
51+
jrebel.lic
52+
.settings
53+
.classpath
54+
.project
55+
56+
.ensime*
57+
*.sublime-*
58+
.cache
59+
60+
# intellij
61+
*.eml
62+
*.iml
63+
*.ipr
64+
*.iws
65+
.*.sw?
66+
.idea
67+
68+
# paulp script
69+
/.lib/

3.0/async/pekko-examples/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# pekko-examples #
2+
3+
Corresponds to the guide at [http://scalatra.org/guides/3.0/async/pekko.html](http://scalatra.org/guides/3.0/async/pekko.html)
4+
5+
## Build & Run ##
6+
7+
```sh
8+
$ git clone https://github.com/scalatra/scalatra-website-examples.git
9+
$ cd scalatra-website-examples/3.0/async/pekko-examples
10+
$ chmod +x sbt
11+
$ ./sbt ~jetty:start
12+
```
13+
14+
First, open [http://localhost:8080/ask](http://localhost:8080/ask) in your browser. You'll see the "question and answer" in the browser.
15+
16+
Second, Open [http://localhost:8080/](http://localhost:8080/) in your browser. You'll see the "question and answer" in your terminal.

3.0/async/pekko-examples/build.sbt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
organization := "com.example"
2+
name := "Pekko Examples"
3+
version := "0.1.0-SNAPSHOT"
4+
scalaVersion := "3.3.1"
5+
6+
val ScalatraVersion = "3.0.0"
7+
8+
libraryDependencies ++= Seq(
9+
"org.apache.pekko" %% "pekko-actor" % "1.0.0" cross(CrossVersion.for3Use2_13),
10+
"org.apache.pekko" %% "pekko-http" % "1.0.0" cross(CrossVersion.for3Use2_13),
11+
"org.scalaj" %% "scalaj-http" % "2.4.2" cross(CrossVersion.for3Use2_13),
12+
"ch.qos.logback" % "logback-classic" % "1.4.11" % Provided,
13+
"org.scalatra" %% "scalatra-jakarta" % ScalatraVersion,
14+
"org.scalatra" %% "scalatra-specs2-jakarta" % ScalatraVersion % "test",
15+
"org.eclipse.jetty" % "jetty-webapp" % "11.0.15" % "provided",
16+
"jakarta.servlet" % "jakarta.servlet-api" % "5.0.0" % "provided"
17+
)
18+
19+
enablePlugins(JettyPlugin)
20+
21+
Jetty / containerLibs := Seq("org.eclipse.jetty" % "jetty-runner" % "11.0.15" intransitive())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.9.6
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
2+
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

0 commit comments

Comments
 (0)