package scripts
- Alphabetic
- Public
- All
Type Members
- trait ApplicationIniGenerator extends AnyRef
-
trait
BashStartScriptKeys extends AnyRef
Keys related to the BashStartScriptPlugin
Keys related to the BashStartScriptPlugin
- See also
-
trait
BatStartScriptKeys extends AnyRef
Keys related to the BatStartScriptPlugin
Keys related to the BatStartScriptPlugin
- See also
- trait CommonStartScriptGenerator extends AnyRef
-
case class
ExplicitMainWithAdditional(mainClass: String, additional: Seq[String]) extends StartScriptMainClassConfig with Product with Serializable
The project has multiple main classes and a defined main entrypoint.
The project has multiple main classes and a defined main entrypoint.
- mainClass
Explicitly defined main class
- additional
Other discovered main classes without the explicit main class
-
case class
MultipleMains(mainClasses: Seq[String]) extends StartScriptMainClassConfig with Product with Serializable
The project has multiple main classes, but no explicit configured main entrypoint.
The project has multiple main classes, but no explicit configured main entrypoint.
- mainClasses
A non-empty list of main classes
-
case class
SingleMain(mainClass: String) extends StartScriptMainClassConfig with Product with Serializable
The project has a single defined main class.
The project has a single defined main class.
- mainClass
project main entrypoint
-
sealed
trait
StartScriptMainClassConfig extends AnyRef
Models the main script configuration for the given project.
Value Members
-
object
AshScriptPlugin extends AutoPlugin
This class is an alternate to JavaAppPackaging designed to support the ash shell.
Java Application
This class is an alternate to JavaAppPackaging designed to support the ash shell. JavaAppPackaging generates bash-specific code that is not compatible with ash, a very stripped-down, lightweight shell used by popular micro base Docker images like BusyBox. The AshScriptPlugin will generate simple ash-compatible output.
Just like with JavaAppPackaging you can override the bash-template file by creating a src/templates directory and adding your own bash-template file. Actually this isn't a bad idea as the default bash-template file inherited from JavaAppPackaging has a lot of stuff you probably don't want/need in a highly-constrained environment like ash+BusyBox. Something much simpler will do, for example:
#!/usr/bin/env sh
realpath () { ( TARGET_FILE="$1"
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
if [ "$TARGET_FILE" == "." -o "$TARGET_FILE" == ".." ]; then cd "$TARGET_FILE" TARGET_FILEPATH= else TARGET_FILEPATH=/$TARGET_FILE fi
echo "$(pwd -P)/$TARGET_FILE" ) }
real_script_path="$(realpath "$0")" app_home="$(realpath "$(dirname "$real_script_path")")" lib_dir="$(realpath "${app_home}/../lib")"
${{template_declares}}
java -classpath $app_classpath $app_mainclass $@
Configuration
This plugin adds new settings to configure your packaged application. The keys are defined in com.typesafe.sbt.packager.archetypes.JavaAppKeys
Enable this plugin in your
build.sbtwithenablePlugins(AshScriptPlugin)
Example: -
object
BashStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator with CommonStartScriptGenerator
This plugins creates a start bash script to run an application built with the com.typesafe.sbt.packager.archetypes.JavaAppPackaging.
Bash StartScript Plugin
This plugins creates a start bash script to run an application built with the com.typesafe.sbt.packager.archetypes.JavaAppPackaging.
-
object
BatStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator with CommonStartScriptGenerator
This plugins creates a start bat script to run an application built with the com.typesafe.sbt.packager.archetypes.JavaAppPackaging.
Bat StartScript Plugin
This plugins creates a start bat script to run an application built with the com.typesafe.sbt.packager.archetypes.JavaAppPackaging.
-
object
NoMain extends StartScriptMainClassConfig with Product with Serializable
The project has no main class.
- object ScriptUtils
- object StartScriptMainClassConfig