The main purpose of this project is to provide a command line interface (CLI) for Wollok developers & users, in order to foster any kind of automation (like CI workflow or developing bash scripts). Wollok is a pedagogical tool for teaching object-oriented programming, and it is IDE based. Although, you can also run checker, interpreter and interactive console without a graphical user interface.
If you want to use it in your computer,
export PATH="$PATH:<<pathWhereThisRepoWasCloned>>"
Then you can move to any other folder and use all executable bash files, as explained below.
The root folder provides all Wollok bash commands:
Here's an example of running
A second demo shows
And finally you can see formatter in action:
jars
folderIn jars
folder we put all necessary Java jar files in order to run in a standalone computer without installing the whole Wollok development environment.
are suitable for using it in Travis scripts. They both start building all .wlk files, so even if your tests are passing or your program is working fine, ensure you have no errors in Problems
tab (in your Wollok IDE).
Otherwise, your build will fail.
It then will run either all the tests files or all the programs. Any kind of error prevents a succesful build to happen.
An example of Travis output:
If your Wollok project has several test files, your .travis.yml
should look like this:
language: generic
sudo: required
script:
- git clone https://github.com/uqbar-project/wollok-cli
- export PATH="$PATH:./wollok-cli"
- wollok test
If your Wollok project has no test file but a program, then your .travis.yml
should look like this:
language: generic
sudo: required
script:
- git clone https://github.com/uqbar-project/wollok-cli
- export PATH="$PATH:./wollok-cli"
- wollok run
Or, if you have both programs and tests, you could simply do a
language: generic
sudo: required
script:
- git clone https://github.com/uqbar-project/wollok-cli
- export PATH="$PATH:./wollok-cli"
- wollok run && wollok test
Having https://github.com/wollok/introPepita as a witness case, these are the test cases:
pepita.wlk
not compiling => build failedpepita.*
in test file => build failedpepita.wlk
like having a constructor in an object definition => build faileddivision by zero
or null
parameters in operations like +
) => build failedpepita.wlk
(but no errors) => build passedWhenever Wollok has a new stable release, you can update all jars from jars
folder running generateCI.sh
script. You must provide just one argument, the location of root Wollok development environment folder.
For example, if you have this folder structure:
|- wollok-cli
|- generateCI script bash file
| ...
|- wollok-dev
|- wollok
|- wollok development environment files ...
|-
This is the way you should call the script:
generateCI.sh ../wollok-dev/wollok
Or, if you are in wollok-dev/wollok
folder, simply run
generateCI.sh .
Don't add the trailing /
character for wollok root folder. After running the script, you can tests if everything went smooth:
wsanity-check.sh
They are all in util
folder:
If you want to add .travis.yml
to all projects in a single organization (for example, wollok
), you can use this scripts in util
folder:
.travis.yml
files in each project and adds the corresponding (tests or programs), and also adds Travis badge to README.md (creating or appending to an existing README file)