AshScriptPlugin

com.typesafe.sbt.packager.archetypes.scripts.AshScriptPlugin
object AshScriptPlugin extends AutoPlugin

==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

Attributes

Example

Enable this plugin in your build.sbt with

enablePlugins(AshScriptPlugin)
Graph
Supertypes
class AutoPlugin
trait PluginsFunctions
class Basic
trait Plugins
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

object Defines

Ash defines

Ash defines

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Defines.type

Value members

Concrete methods

override def projectSettings: Seq[Setting[_]]

The Settings to add in the scope of each project that activates this AutoPlugin.

The Settings to add in the scope of each project that activates this AutoPlugin.

Attributes

Definition Classes
AutoPlugin
override def requires: Plugins

This AutoPlugin requires the plugins the Plugins matcher returned by this method. See trigger.

This AutoPlugin requires the plugins the Plugins matcher returned by this method. See trigger.

Attributes

Definition Classes
AutoPlugin

Inherited methods

def &&(o: Basic): Plugins

Attributes

Inherited from:
Basic
def allRequirements: PluginTrigger

This plugin is activated when all required plugins are present.

This plugin is activated when all required plugins are present.

Attributes

Inherited from:
PluginsFunctions
def buildSettings: Seq[Setting[_]]

The Setting to add to the build scope for each project that activates this AutoPlugin. The settings returned here are guaranteed to be added to a given build scope only once regardless of how many projects for that build activate this AutoPlugin.

The Setting to add to the build scope for each project that activates this AutoPlugin. The settings returned here are guaranteed to be added to a given build scope only once regardless of how many projects for that build activate this AutoPlugin.

Attributes

Inherited from:
AutoPlugin
def derivedProjects(proj: ProjectDefinition[_]): Seq[Project]

The Projects to add to the current build based on an existing project.

The Projects to add to the current build based on an existing project.

Attributes

Inherited from:
AutoPlugin
def empty: Plugins

Plugins instance that doesn't require any Pluginss.

Plugins instance that doesn't require any Pluginss.

Attributes

Inherited from:
PluginsFunctions
def extraProjects: Seq[Project]

The Projects to add to the current build.

The Projects to add to the current build.

Attributes

Inherited from:
AutoPlugin
def globalSettings: Seq[Setting[_]]

The Settings to add to the global scope exactly once if any project activates this AutoPlugin.

The Settings to add to the global scope exactly once if any project activates this AutoPlugin.

Attributes

Inherited from:
AutoPlugin
def noTrigger: PluginTrigger

This plugin is activated only when it is manually activated.

This plugin is activated only when it is manually activated.

Attributes

Inherited from:
PluginsFunctions
def projectConfigurations: Seq[Configuration]

The Configurations to add to each project that activates this AutoPlugin.

The Configurations to add to each project that activates this AutoPlugin.

Attributes

Inherited from:
AutoPlugin
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
AutoPlugin -> Any
Inherited from:
AutoPlugin
def trigger: PluginTrigger

Determines whether this AutoPlugin will be activated for this project when the requires clause is satisfied.

Determines whether this AutoPlugin will be activated for this project when the requires clause is satisfied.

When this method returns allRequirements, and requires method returns Web && Javascript, this plugin instance will be added automatically if the Web and Javascript plugins are enabled.

When this method returns noTrigger, and requires method returns Web && Javascript, this plugin instance will be added only if the build user enables it, but it will automatically add both Web and Javascript.

Attributes

Inherited from:
AutoPlugin

Concrete fields

val ashForwarderTemplate: String
val ashTemplate: String

Inherited fields

val label: String

Attributes

Inherited from:
AutoPlugin