Skip to content

Commit

Permalink
Make it possible to release built the always online peer
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshgnacknak committed Feb 21, 2024
1 parent b735d7e commit 3ae5658
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,12 @@ docker-compose -f docker-compose-dev.yml up -d --build peer-dev
docker run --rm -v "$PWD/dist:/app/dist" reform-peer-dev:latest npm run build # Might also be called reform_peer-dev:latest
docker-compose -f docker-compose-dev.yml down
```

## Release Builds

Always Online Peer

```bash
sbt reformJVM/assembly
java -jar src/jvm/target/scala-3.3.0/reform-assembly-0.1.0-SNAPSHOT.jar
```
6 changes: 6 additions & 0 deletions peer/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ lazy val reform = crossProject(JSPlatform, JVMPlatform)
"org.xerial" % "sqlite-jdbc" % "3.41.0.0",
"com.auth0" % "java-jwt" % "4.3.0",
),
assembly / mainClass := Some("de.tu_darmstadt.informatik.st.reform.Main")
)
.settings(
resolvers += "jitpack".at("https://jitpack.io"),
Expand Down Expand Up @@ -92,3 +93,8 @@ inThisBuild(
semanticdbVersion := scalafixSemanticdb.revision,
),
)

ThisBuild / assemblyMergeStrategy := {
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case _ => MergeStrategy.first
}
2 changes: 2 additions & 0 deletions peer/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.1.5")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.0")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.security.Principal
import javax.security.auth.Subject

// https://github.com/eclipse/jetty.project/blob/jetty-11.0.14/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/BasicAuthenticator.java#L50
@main def runServer(): Unit = {
def runServer(): Unit = {
val registry = Registry()
val indexedDb = SqliteDB(Globals.ALWAYS_ONLINE_PEER_DATABASE_PATH)
val _ = Repositories()(using registry, indexedDb)
Expand Down Expand Up @@ -126,3 +126,10 @@ import javax.security.auth.Subject
println(s"listening on ws://localhost:$port$path")
server.join()
}

object Main {

def main(args: Array[String]): Unit = {
runServer();
}
}

0 comments on commit 3ae5658

Please sign in to comment.