Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(launch): init support of launching applications #37

Merged
merged 2 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion applications/solvcon/prepare-solvcon-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
# source <this script> <your-project-folder>
#
set -x
SOLVCON_PROJECT=${1:-${HOME}/solvcon}

if [ -z "${DEVENVFLAVOR}" ]
then
SOLVCON_PROJECT=${1:-${HOME}/solvcon}
else
SOLVCON_PROJECT=${1:-${DEVENVAPP}}
fi

SCSRC="${SOLVCON_PROJECT}/solvcon"
SCSRC_WORKING="${SOLVCON_PROJECT}/solvcon-working"
SCDE_SRC=${SCDE_SRC:-${SOLVCON_PROJECT}/devenv}
Expand Down Expand Up @@ -78,3 +85,11 @@ pushd ${SCSRC}/sandbox/gas/tube
./go run
popd


yungyuc marked this conversation as resolved.
Show resolved Hide resolved
# A workaround to use packages built or managed by conda. We could abandon
# this workaround when devenv is fully integrated and used for SOLVCON
echo "Re-launch SOLVCON by the following commands:"
echo ""
echo "export PATH="${SCSRC}:${MINICONDA_DIR}/bin:${PATH}""
echo ""

11 changes: 6 additions & 5 deletions bin/devenv
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Description:
devenv management tool

Commands:
add - create a new devenv environment
use - select an environment to use
del - delete an environment directory
off - deactivate environment
build - build applications"
add - create a new devenv environment
use - select an environment to use
del - delete an environment directory
off - deactivate environment
build - build package
launch - launch application"
else
display -e "Unrecognized command line argument: '${cmd}'"
fi
Expand Down
21 changes: 21 additions & 0 deletions scripts/application.d/solvcon
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -e

application_name=solvcon
application_branch=${VERSION:-master}
application_full=$application_name-$application_branch
application_src=${DEVENVROOT}/flavors/${DEVENVFLAVOR}/src/${application_full}

syncgit https://github.com/solvcon ${application_name} ${application_branch}

export DEVENVAPP=${DEVENVROOT}/flavors/${DEVENVFLAVOR}/application-${application_name}
mkdir -p ${DEVENVAPP}

ln -s ${application_src} ${DEVENVAPP}/${application_name}


echo "launching solvcon..."
${DEVENVROOT}/bin/build-application-solvcon-devenv.sh

# vim: set et nobomb ft=bash ff=unix fenc=utf8:
17 changes: 17 additions & 0 deletions scripts/cmd.d/launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
. ${DEVENVROOT}/scripts/func.d/bash_utils

script="${DEVENVROOT}/scripts/application.d/$1"
if [ ! -f "${script}" ]; then
display -e "'$1' not defined"
fi

if [ -z "${DEVENVFLAVOR}" ] ; then
display -e "\$DEVENVFLAVOR not defined"
fi

. ${DEVENVROOT}/scripts/func.d/build_utils
display "Execute building script \"${script}\" ${@:$(($#+1))} ..."
. ${script}
display "Finished building script \"${script}\"."

# vim: set et nu nobomb fenc=utf8 ft=sh ff=unix sw=2 ts=2:
3 changes: 3 additions & 0 deletions scripts/func.d/bash_utils
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ get_list() {
build)
dir="${DEVENVROOT}/scripts/build.d"
;;
application)
dir="${DEVENVROOT}/scripts/application.d"
;;
cmd)
dir="${DEVENVROOT}/scripts/cmd.d"
;;
Expand Down
5 changes: 5 additions & 0 deletions scripts/init
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ _devenv() {
COMPREPLY=( $(compgen -W "$(get_list build)" -- ${cur}) )
return 0
;;
launch)
[[ $COMP_CWORD > 2 ]] && return 1
COMPREPLY=( $(compgen -W "$(get_list application)" -- ${cur}) )
return 0
;;
*)
[[ $COMP_CWORD > 1 ]] && return 1
cmds=$(get_list cmd)
Expand Down