Coder Social home page Coder Social logo

vdev's Introduction

vdev.sh script: a development v version

Bash script behaving like a development v version running/compiling v files using imported modules in official version or development version

Installation and configuration

  1. Clone this directory or donwload the vdev.sh vdev.sh bash script
  2. Create a directory ~/vdevmodules similar to ~/.vmodules but for testing development repo.
  3. Update VDEVMODULES and VEXE (default: ~/vlang/v/v) environment variables inside vdev.sh if necessary
  4. chmod u+x vdev.sh
  5. Link vdev.sh script as you wish. It could also serve of symlinking version of the v binary (ex: ln -s vdev.sh ~/bin/vv to have both v binary and vv development version)

Feature

  1. A development mode to test modules in development is provided:
    • normal mode: vdev.v (or the corresponding ~/bin/vv symlink if created) behaves the same as the v binary except the following completion about the v file path to run when starting with %.
    • development mode: vdev.sh -dev ( or vv -dev) allows us to run/compile v file by importing modules installed inside ~/vdevmodules skipping the modules usually installed inside ~/.vmodules.
  2. Path of a v file to run when starting with %, such as %<v_fullpath_file>.v, is prepended with the folder containing the v modules:
  • ~/.vmodules/ in normal mode
  • ~/vdevmodules/ in devel mode, i.e. with -dev option

Use case

Here it is supposed that ~/bin/vv is the symlink of vdev.sh and ~/bin part of $PATH such that type vv is ~/bin/vv. After installing official version ui (v install ui) and a development version of ui inside ~/vdevmodules (cd ~/vdevmodules;git clone -b devel17 https://github.com/rcqls/ui). You can then run ui/examples/users_resizable.v in the two modes:

  1. normal mode: vv run %ui/examples/users_resizable.v (equivalent to vv run ~/.vmodules/ui/examples/users_resizable.v) using the official ui module inside ~/.vmodules
  2. development mode: vv -dev run %ui/examples/users_resizable.v (equivalent to vv -dev run ~/vdevmodules/ui/examples/users_resizable.v) using the development module ~/vdevmodules.

Remark: tested on macOS, linux and Windows10 (using GitBash)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.