How to run sbt multiple command in interactive mode - sbt

I want to run several sbt-commands within sbt interactive mode, i.e. without leaving the sbt "shell"?
(Note:
Some questions answer how to pass argument to sbt-commands using sbt in the standard shell. Not what I wnat here)
Example: I am in sbt interactive shell, and I want to run "test:compile", then "test"
I know test will call required compilation, but in this example I want to run the compilation of all sub-projects, before any test is started.

To run commands sequentially within the sbt shell, use ; to chain commands:
> ;test:compile ;test
Note however that running the test task will compile your sources if necessary without you having to explicitly running the compile task.

Related

how can i use "|find" in robot frame work

I want to know the status of the virtual machine
In Command Prompt by executing the below command
C:\Program Files\Oracle\VirtualBox>vboxmanage showvminfo Linux |find "State:"
I got output as
=>State: running (since 2020-09-30T06:00:01.824000000)
the same thing when I tried in robot framework(RIDE)
#${result}= Run process C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage showvminfo Linux |find "State:"
I am getting error as -
Syntax error: Invalid parameter '|find'
Can someone help how to use |find in robot framework.
Piping eg, using | character is shell feature. If you want to run shell commands or using features from it, you need to tell Run Process to run it inside a shell by adding shell=yes to your Run Process keyword.
This is documented in https://robotframework.org/robotframework/latest/libraries/Process.html#Process%20configuration and a section below it called Running processes in shell

Rerun Failed test cases from output.xml using jython in robot/RIDE

I am using RIDE 1.3 using robotframework 2.8.7 running on Python 2.7.6. To execute my test I use jybot. The Jython version is Jython 2.5.3. I have an output XML generate from a previous run with failed cases. Now I need to selectively execute only the failed cases from the XML.
I have tried using the Command -R --rerunfailed [xml_path] by inserting it in the arguments tab of RIDE. But this command is unrecognised by the editor so I use -R [xml_path] instead which does not throw any errors.
Finally, when I start executing the suite I expect only the failed results from the suite to run but the entire suite runs as if the command has no effect. The suite from previous run and current run is same but the suite is large and output.xml generated is huge (~100 MB).
How can I execute only failed cases?

Nightwatch.js - Run shell script when tasks complete

With nightwatch.js is it possible to run other commands if all of my test pass?
I would like to be able to type a command that runs:
nightwatch
if tests pass shell script that updates repo to latest version
Actually could I use gulp to do this?
Thanks.

how to use sbt shell to try small sbt expressions

like scala shell, does sbt shell provides a way to play around with sbt code
i.e. can I use sbt shell to create temporary tasks/settings and play with them
e.g. redefine existing definitions(in build.sbt) on sbt shell
I see set and eval commands but not sure how can I use sbt shell for testing some small sbt expression. I see that there session command as well.
Please provide a overview on how to try sbt shell as an interpreter of sbt expressions
You can try using consoleProject that allows you to eval settings and tasks and generally explore around your build. Its not the exact same thing that you're asking but maybe offers similar functionality?
Console Project Docs

run a "source" bash shell script in qmake

I want to use the intel compiler for Qt, but using the intel compiler implies running the script
$ source /opt/intel/bin/compilervars.sh intel64
Of course, I could add this to ~/.bashrc, but this would not run it in QtCreator, where it still complains about missing icpc. So I want it to be a part of the main mkspec qmake file.
How can I execute that full bash command in qmake?
Short Answer: Using QMAKE_EXTRA_TARGETS and PRE_TARGET_DEPS, you can execute source /opt/intel/bin/compilersvars.sh intel64, but simply sourcing them will not solve your issue.
Long Answer: The QMake file is converted into a Makefile. Make then executes the Makefile. The problem you will run into is that Make executes each command in its own shell. Thus, simply sourcing the script will only affect one command, the command that executes the script.
There are a couple of possible ways to make things work:
Execute the script before starting Qt-Creator. I've actually done this for some projects where I needed to have special environment variables setup. To make my life easier, I created a shell command to setup the environment and then launch Qt-Creator.
Within Qt-Creator, modify the Build Environment for the project I've also used this trick. In your case, simply look at the environment setup by the script and change the "Build Environment" settings under the project tab for your project to match those setup by the script.
It might also be possible to modify QMake's compiler commands, but I am not sure you can make it execute two commands instead of one (source the script then execute the compiler). Further more, this will make the project very un-transportable to other systems.
You can create a shell script that does more or less the following:
#! /usr/bin/env sh
# Remove the script's path from the PATH variable to avoid recursive calls
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PATH=${PATH/$SCRIPT_DIR:/}
# Set the environment up
source /opt/intel/bin/compilervars.sh intel64
# Call make with the given arguments
make "$#"
Save it into a file named "make" in an empty directory somewhere, make it executable, then change the build environment in QT Creator to prepend PATH with the script's directory:
PATH=[dir-of-make-script]:${Env:PATH}
You can do this either in the project settings or once and for all in the kit settings.
Like this, QT Creator will be fooled into calling your make script which sets up your environment before calling the actual make binary. I use a similar technique under Windows with Linux cross-toolchains and it has been working well so far.

Resources