Skip to content

Commit

Permalink
Adjust wrong formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed Apr 12, 2024
1 parent c85c6ee commit 1840f85
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import sbt.librarymanagement.{IvyFileConfiguration, PublishConfiguration}
import com.typesafe.sbt.packager.Compat._

/**
* TODO write tests for the SettingsHelper TODO document methods properly TODO document the sbt internal stuff that is
* used
* - TODO write tests for the SettingsHelper
* - TODO document methods properly
* - TODO document the sbt internal stuff that is used
*/
object SettingsHelper {

Expand Down
4 changes: 3 additions & 1 deletion src/main/scala/com/typesafe/sbt/PackagerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import sbt.Keys.{name, normalizedName, packageBin, streams}
*
* Currently you can choose between
*
* <ul> <li>JavaAppPackaging</li> <li>JavaServerPackaging</li> <li>AkkaAppPackging</li> </ul>
* - JavaAppPackaging
* - JavaServerPackaging
* - AkkaAppPackging
*
* ==Configuration==
*
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/com/typesafe/sbt/packager/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ trait NativePackagerKeys {
}

/**
* This Keys object can be used for <ul> <li>non autoplugin builds</li> <li>import single keys, which are not inside
* the autoImport</li> </ul>
* This Keys object can be used for
* - non autoplugin builds
* - import single keys, which are not inside the autoImport
*
* ==Non autoplugin builds==
*
Expand Down
13 changes: 4 additions & 9 deletions src/main/scala/com/typesafe/sbt/packager/Stager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ object Stager {
* create a cache and sync files if needed
*
* @param config
* \- create a configuration specific cache directory
* create a configuration specific cache directory
* @param cacheDirectory
* \- e.g. streams.value.cacheDirectory
* e.g. streams.value.cacheDirectory
* @param stageDirectory
* \- staging directory
* staging directory
* @param mappings
* \- staging content
*
* @example
* {{{
*
* }}}
* staging content
*/
def stageFiles(config: String)(cacheDirectory: File, stageDirectory: File, mappings: Seq[(File, String)]): File = {
val cache = cacheDirectory / ("packager-mappings-" + config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import sbt._
import com.typesafe.sbt.packager.archetypes.systemloader.ServerLoader._

/**
* Loads scripts from the resource path that are associated with <ul> <li>an archetype</li> <li>a
* sbt.Configuration</li> </ul>
* Loads scripts from the resource path that are associated with
* - an archetype
* - a sbt.Configuration
*
* @example
* {{{
Expand All @@ -27,15 +28,15 @@ object JavaServerBashScript {

/**
* @param script
* \- script name
* script name
* @param templateName
* \- DebianPlugin.Names for maintainer scripts and "start"
* DebianPlugin.Names for maintainer scripts and "start"
* @param loader
* \- which startup system
* which startup system
* @param replacements
* \- default replacements
* default replacements
* @param template
* \- if specified, it will override the default one
* if specified, it will override the default one
*/
def apply(
script: String,
Expand Down Expand Up @@ -74,9 +75,9 @@ object JavaServerLoaderScript {
* The functions script resides in "[archetype]/[loader]/functions"
*
* @param loader
* \- Upstart, SystemV, SystemD
* Upstart, SystemV, SystemD
* @param script
* \- default is "functions"
* default is "functions"
* @return
* functions - addService/stopService with resolved variables
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ trait MaintainerScriptHelper {
* Use this method to override preexisting configurations with custom file definitions.
*
* @example
* {{{ import DebianConstants._ maintainerScripts in Debian := maintainerScriptsFromDirectory(
* sourceDirectory.value / DebianSource / DebianMaintainerScripts, Seq(Preinst, Postinst, Prerm, Postrm) ) }}}
* {{{
* import DebianConstants._
* maintainerScripts in Debian := maintainerScriptsFromDirectory(
* sourceDirectory.value / DebianSource / DebianMaintainerScripts, Seq(Preinst, Postinst, Prerm, Postrm)
* )
* }}}
* @param dir
* from where to load files
* @param scripts
* \- a list of script names that should be used
* a list of script names that should be used
* @return
* filename to content mapping
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.typesafe.sbt.packager.archetypes
/**
* This object provides methods to generate scripts from templates. This involves
*
* <ol> <li>procesing - replacing a placeholders with actual values</li> <li>TODO: validating - check the script if
* there are no remaining placeholders</li> </ol>
* 1. procesing - replacing a placeholders with actual values
* 1. TODO: validating - check the script if there are no remaining placeholders
*
* @example
* a bash script can be generated like this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import sbt.Keys.sourceDirectory
import sbt._

// format: off
/**
* ==Java Application==
*
Expand All @@ -21,20 +22,36 @@ import sbt._
*
* #!/usr/bin/env sh
*
* realpath () { ( TARGET_FILE="$1"
* realpath () {
* (
* TARGET_FILE="$1"
*
* cd "$(dirname "$TARGET_FILE")" TARGET_FILE=$(basename "$TARGET_FILE")
* cd "$(dirname "$TARGET_FILE")"
* TARGET_FILE=$(basename "$TARGET_FILE")
*
* COUNT=0 while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ] do TARGET_FILE=$(readlink "$TARGET_FILE") cd "$(dirname
* "$TARGET_FILE")" TARGET_FILE=$(basename "$TARGET_FILE") COUNT=$(($COUNT + 1)) done
* COUNT=0
* while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ]
* do
* TARGET_FILE=$(readlink "$TARGET_FILE")
* cd "$(dirname "$TARGET_FILE")"
* TARGET_FILE=$(basename "$TARGET_FILE")
* COUNT=$(($COUNT + 1))
* done
*
* if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then cd "$TARGET_FILE" TARGET_FILEPATH= else
* TARGET_FILEPATH=/$TARGET_FILE fi
* if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then
* cd "$TARGET_FILE"
* TARGET_FILEPATH=
* else
* TARGET_FILEPATH=/$TARGET_FILE
* fi
*
* echo "$(pwd -P)/$TARGET_FILE" ) }
* echo "$(pwd -P)/$TARGET_FILE"
* )
* }
*
* real_script_path="$(realpath "$0")" app_home="$(realpath "$(dirname "$real_script_path")")" lib_dir="$(realpath
* "${app_home}/../lib")"
* real_script_path="$(realpath "$0")"
* app_home="$(realpath "$(dirname "$real_script_path")")"
* lib_dir="$(realpath "${app_home}/../lib")"
*
* ${{template_declares}}
*
Expand All @@ -52,6 +69,7 @@ import sbt._
* enablePlugins(AshScriptPlugin)
* }}}
*/
// format: on
object AshScriptPlugin extends AutoPlugin {

override def requires = JavaAppPackaging && BashStartScriptPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ trait CommonStartScriptGenerator {

/**
* @param mainClass
* \- Main class added to the java command
* Main class added to the java command
* @param config
* \- Config data for this script
* Config data for this script
* @param targetDir
* \- Target directory for this script
* Target directory for this script
* @return
* File pointing to the created main script
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ package object systemloader {
/**
* Create the linuxPackageMapping for the systemloader start-script/conffile
* @param scriptName
* \- optional name from `linuxStartScriptName.value`
* optional name from `linuxStartScriptName.value`
* @param script
* \- file with contents from ` linuxMakeStartScript.value`
* file with contents from ` linuxMakeStartScript.value`
* @param location
* \- target destination from `defaultLinuxStartScriptLocation.value`
* target destination from `defaultLinuxStartScriptLocation.value`
* @param isConf
* \- if the start script should be registered as a config file
* if the start script should be registered as a config file
*/
def startScriptMapping(
scriptName: Option[String],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import sbt._
*
* ==Requirements==
*
* You need the debian dpkg toolchain installed. This includes <ul> <li>fakeroot</li> <li>dpkg-deb</li>
* <li>dpkg-genchanges</li> </ul>
* You need the debian dpkg toolchain installed. This includes
* - fakeroot
* - dpkg-deb
* - dpkg-genchanges
*
* @example
* Enable the plugin in the `build.sbt`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ trait DebianPluginLike {
* While adding the chown commands it checks if the users and groups have valid names.
*
* @param mappings
* \- all mapped files
* all mapped files
* @param streams
* \- logging
* logging
* @return
* (CHOWN_REPLACEMENT -> ".. list of chown commands")
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ object DockerPlugin extends AutoPlugin {

/**
* @param dockerBaseDirectory
* , the installation directory
* the installation directory
*/
private final def makeWorkdir(dockerBaseDirectory: String): CmdLike =
Cmd("WORKDIR", dockerBaseDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ trait CmdLike {
* Executable command
*
* @example
* {{{ ExecCmd("RUN", "chown", "-R", daemonUser, ".") }}}
* {{{ExecCmd("RUN", "chown", "-R", daemonUser, ".")}}}
*
* @example
* {{{ ExecCmd("ENTRYPOINT", "bin/%s" format execScript), }}}
* {{{ExecCmd("ENTRYPOINT", "bin/%s" format execScript),}}}
*
* @example
* {{{ ExecCmd("CMD") }}}
* {{{ExecCmd("CMD")}}}
*
* @example
* {{{ ExecCmd("VOLUME", exposedVolumes: _*) }}}
* {{{ExecCmd("VOLUME", exposedVolumes: _*)}}}
*/
case class ExecCmd(cmd: String, args: String*) extends CmdLike {
def makeContent: String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ object JDKPackagerAntHelper {
}

/**
* Locate the generated packge. TODO: replace with something significantly more intelligent.
* Locate the generated packge.
* - TODO: replace with something significantly more intelligent.
* @param output
* output directory
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trait LinuxMappingDSL {

/**
* @param dir
* \- use some directory, e.g. target.value
* use some directory, e.g. target.value
* @param files
*/
def packageTemplateMapping(files: String*)(dir: File = new File(sys.props("java.io.tmpdir"))) =
Expand All @@ -20,7 +20,7 @@ trait LinuxMappingDSL {
* @see
* #mapDirectoryAndContents
* @param dirs
* \- directories to map
* directories to map
*/
def packageDirectoryAndContentsMapping(dirs: (File, String)*) =
LinuxPackageMapping(mapDirectoryAndContents(dirs: _*))
Expand All @@ -29,7 +29,7 @@ trait LinuxMappingDSL {
* This method includes files and directories.
*
* @param dirs
* \- directories to map
* directories to map
*/
def mapDirectoryAndContents(dirs: (File, String)*): Seq[(File, String)] =
for {
Expand Down
10 changes: 6 additions & 4 deletions src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,12 @@ object LinuxPlugin extends AutoPlugin {
/**
* Maps linux file format from the universal from the conventions:
*
* `<project>/src/linux` files are mapped directly into linux packages. `<universal>` files are placed under
* `/usr/share/<package-name>` `<universal>/bin` files are given symlinks in `/usr/bin` `<universal>/conf` directory
* is given a symlink to `/etc/<package-name>` Files in `conf/` or `etc/` directories are automatically marked as
* configuration. `../man/...1` files are automatically compressed into .gz files.
* - `<project>/src/linux` files are mapped directly into linux packages.
* - `<universal>` files are placed under `/usr/share/<package-name>`
* - `<universal>/bin` files are given symlinks in `/usr/bin`
* - `<universal>/conf` directory is given a symlink to `/etc/<package-name>`
* - Files in `conf/` or `etc/` directories are automatically marked as configuration.
* - `../man/...1` files are automatically compressed into .gz files.
*/
def mapGenericMappingsToLinux(mappings: Seq[(File, String)], user: String, group: String)(
rename: String => String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import com.typesafe.sbt.packager.sourceDateEpoch
*
* ==Requirements==
*
* <ul> <li>Windows System</li> <li>Wix Toolset ([[http://wixtoolset.org/]]) installed </ul>
* - Windows System
* - Wix Toolset ([[http://wixtoolset.org/]]) installed
*
* @example
* Enable the plugin in the `build.sbt`
Expand Down Expand Up @@ -156,9 +157,9 @@ object WindowsPlugin extends AutoPlugin {
* Generates the wix configuration features
*
* @param name
* \- title of the core package
* title of the core package
* @param mappings
* \- use to generate different features
* use to generate different features
* @return
* windows features
*/
Expand Down

0 comments on commit 1840f85

Please sign in to comment.