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
Enable this plugin in your
build.sbtwithenablePlugins(AshScriptPlugin)
- Alphabetic
- By Inheritance
- AshScriptPlugin
- AutoPlugin
- PluginsFunctions
- Basic
- Plugins
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
&&(o: Basic): Plugins
- Definition Classes
- Basic → Plugins
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allRequirements: PluginTrigger
- Definition Classes
- PluginsFunctions
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val ashTemplate: String
-
def
buildSettings: Seq[sbt.Def.Setting[_]]
- Definition Classes
- AutoPlugin
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
derivedProjects(proj: ProjectDefinition[_]): Seq[Project]
- Definition Classes
- AutoPlugin
-
def
empty: Plugins
- Definition Classes
- PluginsFunctions
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
extraProjects: Seq[Project]
- Definition Classes
- AutoPlugin
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
globalSettings: Seq[sbt.Def.Setting[_]]
- Definition Classes
- AutoPlugin
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
label: String
- Definition Classes
- AutoPlugin
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
noTrigger: PluginTrigger
- Definition Classes
- PluginsFunctions
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
projectConfigurations: Seq[Configuration]
- Definition Classes
- AutoPlugin
-
def
projectSettings: Seq[sbt.Def.Setting[_ >: Task[Seq[String]] with Task[File] <: Task[_ >: Seq[String] with File <: AnyRef]]]
- Definition Classes
- AshScriptPlugin → AutoPlugin
-
def
requires: Plugins
- Definition Classes
- AshScriptPlugin → AutoPlugin
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AutoPlugin → AnyRef → Any
-
def
trigger: PluginTrigger
- Definition Classes
- AutoPlugin
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
object
Defines
Ash defines