Skip to content

Commit

Permalink
Extract bash script creating into a single auto plugin
Browse files Browse the repository at this point in the history
- Tests need to be fixed and/or extended
- Documentation is missing
- Bat script plugin is missing
- Application.ini refactoring still needs to be done
  • Loading branch information
muuki88 committed Oct 3, 2016
1 parent 16f0e3b commit bf78ae0
Show file tree
Hide file tree
Showing 17 changed files with 405 additions and 540 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fix_classpath() {
cp="$1"
if is_cygwin; then
echo "$(fixCygwinClasspath "$cp")"
else
else
echo "$cp"
fi
}
Expand All @@ -124,9 +124,9 @@ execRunner () {
[[ $verbose || $debug ]] && echo "# Executing command line:" && {
for arg; do
if printf "%s\n" "$arg" | grep -q ' '; then
printf "\"%s\"\n" "$arg"
printf "\"%s\"\n" "$arg"
else
printf "%s\n" "$arg"
printf "%s\n" "$arg"
fi
done
echo ""
Expand Down Expand Up @@ -180,23 +180,23 @@ process_args () {
local no_more_snp_opts=0
while [[ $# -gt 0 ]]; do
case "$1" in
--) shift && no_more_snp_opts=1 && break ;;
--) shift && no_more_snp_opts=1 && break ;;
-h|-help) usage; exit 1 ;;
-v|-verbose) verbose=1 && shift ;;
-d|-debug) debug=1 && shift ;;

-no-version-check) no_version_check=1 && shift ;;

-mem) echo "!! WARNING !! -mem option is ignored. Please use -J-Xmx and -J-Xms" && shift 2 ;;
-mem) echo "!! WARNING !! -mem option is ignored. Please use -J-Xmx and -J-Xms" && shift 2 ;;
-jvm-debug) require_arg port "$1" "$2" && addDebugger $2 && shift 2 ;;

-main) custom_mainclass="$2" && shift 2 ;;
-main) custom_mainclass="$2" && shift 2 ;;

-java-home) require_arg path "$1" "$2" && jre=`eval echo $2` && java_cmd="$jre/bin/java" && shift 2 ;;

-D*|-agentlib*) addJava "$1" && shift ;;
-J*) addJava "${1:2}" && shift ;;
*) addResidual "$1" && shift ;;
-J*) addJava "${1:2}" && shift ;;
*) addResidual "$1" && shift ;;
esac
done

Expand Down Expand Up @@ -228,12 +228,12 @@ run() {
addJava "-Djline.terminal=jline.UnixTerminal"
addJava "-Dsbt.cygwin=true"
fi

# check java version
if [[ ! $no_version_check ]]; then
java_version_check
fi

if [ -n "$custom_mainclass" ]; then
mainclass=("$custom_mainclass")
else
Expand All @@ -253,7 +253,7 @@ run() {
"${mainclass[@]}" \
"${app_commands[@]}" \
"${residual_args[@]}"

local exit_code=$?
if is_cygwin; then
stty icanon echo > /dev/null 2>&1
Expand All @@ -268,7 +268,7 @@ loadConfigFile() {

# Now check to see if it's a good enough version
# TODO - Check to see if we have a configured default java version, otherwise use 1.6
java_version_check() {
java_version_check() {
readonly java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}')
if [[ "$java_version" == "" ]]; then
echo
Expand Down Expand Up @@ -310,12 +310,12 @@ Usage: $script_name [options]
JAVA_OPTS environment variable, if unset uses "$java_opts"
-Dkey=val pass -Dkey=val directly to the java runtime
-J-X pass option -X directly to the java runtime
(-J is stripped)
(-J is stripped)
# special option
-- To stop parsing built-in commands from the rest of the command-line.
e.g.) enabling debug and sending -d as app argument
\$ ./start-script -d -- -d
e.g.) enabling debug and sending -d as app argument
\$ ./start-script -d -- -d
In the case of duplicated or conflicting options, basically the order above
shows precedence: JAVA_OPTS lowest, command line options highest except "--".
Expand Down
9 changes: 0 additions & 9 deletions src/main/scala/com/typesafe/sbt/PackagerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ object SbtNativePackager extends AutoPlugin {
windows.WindowsPlugin.projectSettings ++
archetypes.JavaAppPackaging.projectSettings

/**
* {{{
* enablePlugins(AkkaAppPackaging)
* }}}
*/
@deprecated("Use enablePlugins(AkkaAppPackaging)", "1.x")
def akka_application: Seq[Setting[_]] =
java_application ++ archetypes.AkkaAppPackaging.projectSettings

/**
* {{{
* enablePlugins(JavaServerAppPackaging)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/com/typesafe/sbt/packager/Keys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ object Keys
with archetypes.JavaAppKeys
with archetypes.JavaServerAppKeys
with archetypes.systemloader.SystemloaderKeys
with archetypes.scripts.BashStartScriptKeys
62 changes: 0 additions & 62 deletions src/main/scala/com/typesafe/sbt/packager/archetypes/AkkaApp.scala

This file was deleted.

This file was deleted.

Loading

0 comments on commit bf78ae0

Please sign in to comment.