Skip to content

simonvpe/spock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spock

Spock is a project generator for C++. It generates an standard shared library or executable project using CMake as its build tool. The project generation is configurable through commandline options.

Internals

The core of spock is written in Rust, combined with the Tera template engine and the Clap command line argument parser.

Every file generated is a Tera template. Each template has an extension which is used to decide whether or not the template should be generated into the project depending on the command line options. The extensions are:

  • all is included in every project
  • test is included if a test suite was selected
  • lib is included if the project is a library
  • exec is included if the project is an executable

Installation

Arch Linux

  1. Download the PKGBUILD file and from the same directory run
    makepkg -i

Other Linux Platforms

  1. Install rust

  2. Install using cargo

    cargo install --git https://github.com/simonvpe/spock
  3. Add the stuff to your path as instructed by the installation

  4. Clone the repo and install the templates

    git clone https://github.com/simonvpe/spock && cd spock
    sudo install -d -m 755 /usr/share/spock
    sudo cp -R templates/cpp /usr/share/spock/
    sudo chmod -R 755 /usr/share/spock

Usage

Discover spock

spock help

Scaffold a new C++ executable project with catch for running tests

mkdir my-awesome-project && spock -C ./my-awesome-project create --tesing catch --exec c++ my-awesome-project 

Scaffold a new C++ shared library project with catch for running tests

mkdir my-awesome-project && spock -C ./my-awesome-project create --tesing catch --lib c++ my-awesome-project 

Contributing

Pull requestes are accepted. The most appreciated PR's are the following

  • Enhancing the interface of the cpp module.
  • Error handling
  • Enhance the templates (I am not particularily good with CMake)

Possible features in the future

  • Spock modules spock add https://github.com/user/some-cool-spock-lib
  • Querying CMake files to re-generate as new teplates are released

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published