Yet another... C++ Source Package Manager
Official site: https://wsjcpp.org/
Docker:
$ docker pull sea5kg/wsjcpp:latest
$ docker run -it --rm \
-v `pwd`/.:/root/project \
sea5kg/wsjcpp:latest \
bash
root@8b93098b8a07:~/project#
Now you can call wsjcpp inside a container
For exit, just enter exit
command after this container will be destroed.
$ brew tap wsjcpp/wsjcpp
$ brew install wsjcpp
$ sudo add-apt-repository ppa:sea5kg/wsjcpp
$ sudo apt-get update
$ sudo apt-get install wsjcpp
$ sudo apt install cmake make g++ pkg-config libcurl4-openssl-dev git-core
$ git clone https://github.com/wsjcpp/wsjcpp /tmp/wsjcpp.git
$ cd /tmp/wsjcpp.git
$ ./build_simple.sh
$ sudo cp -r /tmp/wsjcpp.git /bin/wsjcpp
Inside with your folder project
$ wsjcpp init .
$ chmod +x build_simple.sh
$ chmod +x unit-tests.wsjcpp/build_simple.sh
If you already have a project and want integrate to you project please look here: TODO
On this step will be generated different files, like (only if files not exists):
- src.wsjcpp/CMakeLists.txt
- src.wsjcpp/wsjcpp_core/* <- sample of package (core always required)
- unit-tests.wsjcpp/* <- folder for unit-tests
- src/main.cpp
- .wsjcpp/* <- temporary folder
- CMakeLists.txt
- build_simple.sh
- .gitignore
- ...
You can find on github package what a need you here (for example) https://github.com/topics/wsjcpp
And next command you can install package:
$ wsjcpp install https://github.com/wsjcpp/wsjcpp-print-tree:master
Also you can change 'master' to specific version or branch
After downloading wsjcpp will be automaticly update file: src.wsjcpp/CMakeLists.txt
$ wsjcpp list
Dependencies:
* 'wsjcpp-core:v0.0.8' (https://github.com/wsjcpp/wsjcpp-core:master -> ./src.wsjcpp/wsjcpp_core)
* 'wsjcpp-print-tree:v0.0.1' (https://github.com/wsjcpp/wsjcpp-print-tree:master -> ./src.wsjcpp/wsjcpp_print_tree)
$ wsjcpp reinstall wsjcpp-print-tree
$ wsjcpp uninstall https://github.com/wsjcpp/wsjcpp-print-tree:master
Create a new unit-test
$ wsjcpp unit-tests create SomeTest "Tesing some"
Will be created new files:
- unit-tests.wsjcpp/src/unit_test_init_package.h
- unit-tests.wsjcpp/src/unit_test_init_package.cpp
Also will be automaticly updated unit-tests.wsjcpp/CMakeLists.txt
For build and run unit-tests:
$ cd unit-tests.wsjcpp
$ ./build_simple.sh
$ ./unit-tests
P.S. For testing you package - you need define distribution files (for automaticly include to unit-tests.wsjcpp/CMakeLists.txt)
$ wsjcpp distribution add src/your_source_file.h
$ wsjcpp distribution add src/your_source_file.cpp
Will be updated section 'distribution' in wsjcpp.yml
distribution:
- source-file: "src/your_source_file.h"
target-file: "your_source_file.h"
type: "source-code"
- source-file: "src/your_source_file.cpp"
target-file: "your_source_file.cpp"
type: "source-code"
$ wsjcpp distribution remove src/your_source_file.cpp
For update automaticly generated files:
$ wsjcpp update
wsjcpp prepare file 'build_simple.sh' for easy building
$ ./build_simple.sh
$ docker build -t sea5kg/wsjcpp:latest .