uqbar-project / wollok-cli

Wollok Command Line Interface project
1 stars 0 forks source link

Wollok Command-Line Interface Project

Build Status Latest release

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.

Installation

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.

Scripts

The root folder provides all Wollok bash commands:

Here's an example of running

Demo Test & Run

A second demo shows

Demo REPL

And finally you can see formatter in action:

Demo Formatter

jars folder

In jars folder we put all necessary Java jar files in order to run in a standalone computer without installing the whole Wollok development environment.

Travis integration & scripts

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).

Wollok Problems

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:

Travis Build

Example 1: running tests in a Wollok Project

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

Example 2: running a program inside a Wollok Project

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

Testing Wollok CLI: Sanity check

Having https://github.com/wollok/introPepita as a witness case, these are the test cases:

Updating to a new version of Wollok

Whenever 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

Another useful scripts

They are all in util folder:

Adding Travis to whole repository

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:

Future steps


- Powered by Uqbar - http://www.uqbar.org