Skip to content

Commit 630251c

Browse files
committed
web: extract to a separate module
1 parent a31cd0c commit 630251c

File tree

9 files changed

+52
-79
lines changed

9 files changed

+52
-79
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ All configuration data is stored in the `config.edn` file.
3434

3535
### Running
3636

37-
To start the game server web interface, run the following command in your shell:
37+
To start the game server web interface, run the following shell command:
3838

3939
```console
40-
$ ./gradlew run --args swagger
40+
$ ./gradlew web:run
4141
```
4242

4343
To start the socket server (deprecated), run the following shell command:

build.gradle.kts

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,5 @@
1-
import com.stehno.gradle.natives.ext.Platform
2-
import dev.clojurephant.plugin.clojure.tasks.ClojureSourceSet
3-
import org.gradle.api.internal.HasConvention // clojurephant still depends on conventions
4-
51
plugins {
6-
application
7-
id("dev.clojurephant.clojure") version "0.6.0"
2+
id("dev.clojurephant.clojure") version "0.6.0" apply false
83
id("dev.clojurephant.clojurescript") version "0.6.0" apply false
94
id("com.stehno.natives") version "0.3.1" apply false
105
}
11-
12-
// Dependencies
13-
repositories {
14-
mavenCentral()
15-
maven {
16-
name = "clojars"
17-
url = uri("https://repo.clojars.org")
18-
}
19-
}
20-
21-
dependencies {
22-
implementation("clj-liquibase:clj-liquibase:0.5.2")
23-
implementation("clj-tuple:clj-tuple:0.2.2")
24-
implementation("com.h2database:h2:1.3.173")
25-
implementation("crypto-password:crypto-password:0.1.3")
26-
implementation("crypto-random:crypto-random:1.2.0")
27-
implementation("log4j:log4j:1.2.17")
28-
implementation("metosin:compojure-api:0.16.0")
29-
implementation("metosin:ring-http-response:0.5.0")
30-
implementation("metosin:ring-swagger-ui:2.0.17")
31-
implementation("metosin:ring-swagger:0.13.0")
32-
implementation("org.clojure:clojure-contrib:1.2.0")
33-
implementation("org.clojure:clojure:1.10.3")
34-
implementation("org.clojure:data.json:0.2.2")
35-
implementation("org.clojure:tools.logging:0.2.3")
36-
implementation("org.flatland:ordered:1.5.7")
37-
implementation("org.lwjgl.lwjgl:lwjgl:2.9.1")
38-
implementation(project("core"))
39-
implementation(project("server"))
40-
testRuntimeOnly("org.ajoberstar:jovial:0.3.0")
41-
}
42-
43-
// Compilation
44-
val hyperspaceMainClass = "hyperspace.main"
45-
version = "1.0.0-SNAPSHOT"
46-
47-
@Suppress("DEPRECATION") // clojurephant still depends on conventions
48-
val SourceSet.clojure: SourceDirectorySet
49-
get() = (this as HasConvention).convention.getPlugin<ClojureSourceSet>().clojure
50-
51-
sourceSets {
52-
main {
53-
clojure.srcDir("src")
54-
}
55-
test {
56-
clojure.srcDir("test")
57-
}
58-
}
59-
60-
clojure.builds.named("main") {
61-
aotAll()
62-
}
63-
64-
// Testing
65-
tasks.withType<Test> {
66-
useJUnitPlatform()
67-
}
68-
69-
// Running
70-
application {
71-
mainClass.set(hyperspaceMainClass)
72-
}

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
rootProject.name = "hyperspace"
2-
include("client", "core", "server", "web:frontend")
2+
include("client", "core", "server", "web", "web:frontend")

src/hyperspace/main.clj

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

web/build.gradle.kts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugins {
2+
application
3+
id("dev.clojurephant.clojure")
4+
}
5+
6+
// Dependencies
7+
repositories {
8+
mavenCentral()
9+
maven {
10+
name = "clojars"
11+
url = uri("https://repo.clojars.org")
12+
}
13+
}
14+
15+
dependencies {
16+
implementation("clj-liquibase:clj-liquibase:0.5.2")
17+
implementation("clj-tuple:clj-tuple:0.2.2")
18+
implementation("com.h2database:h2:1.3.173")
19+
implementation("crypto-password:crypto-password:0.1.3")
20+
implementation("crypto-random:crypto-random:1.2.0")
21+
implementation("log4j:log4j:1.2.17")
22+
implementation("metosin:compojure-api:0.16.0")
23+
implementation("metosin:ring-http-response:0.5.0")
24+
implementation("metosin:ring-swagger-ui:2.0.17")
25+
implementation("metosin:ring-swagger:0.13.0")
26+
implementation("org.clojure:clojure:1.10.3")
27+
implementation("org.flatland:ordered:1.5.7")
28+
implementation(project(":server"))
29+
}
30+
31+
// Compilation
32+
val hyperspaceMainClass = "hyperspace.web.main"
33+
version = "1.0.0-SNAPSHOT"
34+
35+
clojure.builds.named("main") {
36+
aotAll()
37+
}
38+
39+
// Running
40+
application {
41+
mainClass.set(hyperspaceMainClass)
42+
}
File renamed without changes.
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(ns hyperspace.web.main
2+
(:require [hyperspace.swagger.server :as swagger])
3+
(:gen-class))
4+
5+
(defn -main []
6+
(swagger/start))

0 commit comments

Comments
 (0)