SBT: add support for unified docs (#284)

Unified documentation can be generated with the sbt unidoc command.
This commit is contained in:
pschord 2019-10-21 16:29:36 -04:00 committed by GitHub
parent 88f4ef293b
commit 33e4f2b35e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -1,4 +1,4 @@
# PlanetSide Login Server [![Build Status](https://travis-ci.org/psforever/PSF-LoginServer.svg?branch=master)](https://travis-ci.org/psforever/PSF-LoginServer) [![Code coverage](https://codecov.io/gh/psforever/PSF-LoginServer/coverage.svg?branch=master)](https://codecov.io/gh/psforever/PSF-LoginServer/) # PlanetSide Login Server [![Build Status](https://travis-ci.org/psforever/PSF-LoginServer.svg?branch=master)](https://travis-ci.org/psforever/PSF-LoginServer) [![Code coverage](https://codecov.io/gh/psforever/PSF-LoginServer/coverage.svg?branch=master)](https://codecov.io/gh/psforever/PSF-LoginServer/) [![Documentation](https://img.shields.io/badge/documentation-master-lightgrey)](https://psforever.github.io/docs/master/index.html)
This project contains the code to run and manage the login and world server roles for PlanetSide 1. This project contains the code to run and manage the login and world server roles for PlanetSide 1.
The login server and world server are currently combined for ease of contributing. The login server and world server are currently combined for ease of contributing.
@ -53,6 +53,11 @@ sbt pslogin/run
``` ```
This will clone the repository and SBT will compile and run the login server. Note: SBT is quite slow at starting up. It's recommended you have an open SBT console in order to avoid this startup time. This will clone the repository and SBT will compile and run the login server. Note: SBT is quite slow at starting up. It's recommended you have an open SBT console in order to avoid this startup time.
### Generating Documentation
Using SBT, you can generate documentation for both the common and pslogin projects using `sbt unidoc`.
Current documentation is available at [https://psforever.github.io/docs/master/index.html](https://psforever.github.io/docs/master/index.html)
## Running the Server ## Running the Server
To run a headless, non-interactive server, run To run a headless, non-interactive server, run

View file

@ -3,6 +3,20 @@ lazy val commonSettings = Seq(
version := "1.0.2-SNAPSHOT", version := "1.0.2-SNAPSHOT",
scalaVersion := "2.11.8", scalaVersion := "2.11.8",
scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-language:postfixOps"), scalacOptions := Seq("-unchecked", "-feature", "-deprecation", "-encoding", "utf8", "-language:postfixOps"),
// scaladoc flags: https://github.com/scala/scala/blob/2.11.x/src/scaladoc/scala/tools/nsc/doc/Settings.scala
// Trick taken from https://groups.google.com/d/msg/scala-user/mxV9ok7J_Eg/kt-LnsrD0bkJ
scalacOptions in (Compile,doc) <<= baseDirectory map {
bd => Seq(
"-groups",
"-implicits",
"-doc-title", "PSF-LoginServer - ",
"-doc-version", "master",
"-doc-footer", "Copyright PSForever",
// For non unidoc builds, you may need bd.getName before the template parameter
"-doc-source-url", "https://github.com/psforever/PSF-LoginServer/blob/master/€{FILE_PATH}.scala",
"-sourcepath", bd.getAbsolutePath // needed for scaladoc relative source paths
)
},
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.4.4", "com.typesafe.akka" %% "akka-actor" % "2.4.4",
@ -40,6 +54,7 @@ lazy val psloginPackSettings = packAutoSettings ++ Seq(
lazy val root = (project in file(".")). lazy val root = (project in file(".")).
settings(commonSettings: _*). settings(commonSettings: _*).
enablePlugins(ScalaUnidocPlugin).
settings(psloginPackSettings: _*). settings(psloginPackSettings: _*).
aggregate(pslogin, common) aggregate(pslogin, common)

View file

@ -2,3 +2,5 @@ logLevel := Level.Warn
addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.7.9") addSbtPlugin("org.xerial.sbt" % "sbt-pack" % "0.7.9")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")
// https://github.com/sbt/sbt-unidoc
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.2")