Skip to content

Commit 0f9499d

Browse files
authored
Merge pull request #8 from 7bitcoder/dev
Release 1.0.0 version
2 parents b5fd60f + 6a05d74 commit 0f9499d

34 files changed

+337
-68
lines changed

.github/workflows/DevCI.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ on:
66
paths-ignore:
77
- "Docs/**"
88
- ".readthedocs.yaml"
9-
- "Readme.md"
10-
pull_request:
11-
branches: ["dev"]
12-
paths-ignore:
13-
- "Docs/**"
14-
- ".readthedocs.yaml"
15-
- "Readme.md"
9+
- "README.md"
10+
1611
env:
1712
BUILD_TYPE: Release
1813
BUILD_DIR: ${{github.workspace}}/build

.github/workflows/MainCI.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name: MainCI
22

33
on:
4-
push:
5-
branches: ["main"]
6-
paths-ignore:
7-
- "Docs/**"
8-
- ".readthedocs.yaml"
9-
- "Readme.md"
104
pull_request:
115
branches: ["main"]
126
paths-ignore:
137
- "Docs/**"
148
- ".readthedocs.yaml"
15-
- "Readme.md"
9+
- "README.md"
1610

1711
env:
1812
BUILD_TYPE: Release

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.15.0)
2-
project(7bitInjector VERSION 0.1.0)
2+
project(7bitInjector VERSION 1.0.0)
33

44
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Docs/advanced-guides/building-library.rst

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,76 @@
1-
Building Library
1+
Build Library
22
==========================
33

4-
The library can be built locally using Cmake_ (`Cmake Installation`_), and several cache variables can be set:
4+
The library can be built locally using Cmake_ (`Cmake Installation`_)
5+
6+
Create a build directory and navigate to it:
7+
8+
.. code-block:: sh
9+
10+
mkdir build && cd build
11+
12+
Configure CMake project
13+
14+
.. code-block:: sh
15+
16+
cmake .. -DCMAKE_BUILD_TYPE=Debug
17+
18+
Using this command several cache variables can be set:
519

620
* <variable cache name>: [possible values] (default value) - Description
721
* LIBRARY_TYPE: ["Shared", "Static", "HeaderOnly"] ("HeaderOnly") - Library build type
822
* BUILD_DOCS: [true, false] (false) - Turn on to build documentation (requires Sphinx_, Breathe_ and Doxygen_ installed)
9-
* BUILD_TESTS: [true, false] (false) - Turn on to build tests (requires Gtest_ to be installed, see `Conan Packages Installation`_)
23+
* BUILD_TESTS: [true, false] (false) - Turn on to build tests (requires Gtest_ to be installed, see `Build Library With Conan`_)
1024
* BUILD_EXAMPLES: [true, false] (false) - Turn on to build examples
1125

12-
build the library using the command:
26+
to set cache variable pass additional option: -D<variable cache name>=[value]
27+
for example, this command will set the library type to Static and will force examples built
1328

1429
.. code-block:: sh
1530
16-
cmake --build ./build
31+
cmake .. -DCMAKE_BUILD_TYPE=Release -DLIBRARY_TYPE=Static -DBUILD_EXAMPLES=true
32+
33+
Build the library using the command:
34+
35+
.. code-block:: sh
1736
37+
cmake --build .
1838
19-
Conan Packages Installation
39+
40+
Build Library With Conan
2041
^^^^^^^^^^^^^^^
2142

2243
Gtest_ library is added to project using Conan_ package manager (`Conan Installation`_),
23-
to install Conan packages run this command in the library root folder:
44+
If Conan was freshly installed run detect command:
45+
46+
.. code-block:: sh
47+
48+
conan profile detect
49+
50+
To install Conan packages run this command in the library root folder:
2451

2552
.. code-block:: sh
2653
2754
conan install . --output-folder=build --build=missing
2855
56+
Navigate to the build directory:
57+
58+
.. code-block:: sh
59+
60+
cd build
61+
62+
Configure the CMake project, and add also toolchain file as a CMAKE_TOOLCHAIN_FILE cache variable:
63+
64+
.. code-block:: sh
65+
66+
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=true -DCMAKE_TOOLCHAIN_FILE:STRING="conan_toolchain.cmake"
67+
68+
Build the library using the command:
69+
70+
.. code-block:: sh
71+
72+
cmake --build .
73+
2974
.. _Cmake: https://cmake.org/
3075
.. _`Cmake Installation`: https://cmake.org/download/
3176
.. _Sphinx: https://www.sphinx-doc.org/en/master/

Docs/advanced-guides/external-singleton.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ External Singleton
33

44
Singleton can be registered externally
55

6-
.. literalinclude:: ../../Examples/ExternalSingleton.cpp
7-
:caption: Examples/ExternalSingleton
6+
.. literalinclude:: ../../Examples/Guides/ExternalSingleton.cpp
7+
:caption: Examples/Guides/ExternalSingleton
88
:language: C++
99

1010
.. code-block:: console

Docs/advanced-guides/using-factories.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
Using Factories
22
========================================
33

4-
Factory functor can be provided to manually create a service. Functor should return unique_ptr and as an argument should optionally take reference to the service provider.
4+
Factory functor can be provided to manually create a service.
5+
Functor should return unique_ptr and as an argument should optionally take reference to the service provider.
56
Functor scheme (IServiceProvider &) -> std::unique_ptr or () -> std::unique_ptr
67

7-
.. literalinclude:: ../../Examples/FactoryFunctions.cpp
8-
:caption: Examples/FactoryFunctions
8+
.. literalinclude:: ../../Examples/Guides/FactoryFunctions.cpp
9+
:caption: Examples/Guides/FactoryFunctions
910
:language: C++
1011

1112
.. code-block:: console

Docs/basic-guides/core-classes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ The library relies on two core classes:
99
.. _ServiceCollection: ../reference/di/servicecollection.html
1010
.. _IServiceProvider: ../reference/di/iserviceprovider.html
1111

12-
.. literalinclude:: ../../Examples/CoreClasses.cpp
13-
:caption: Examples/Basic
12+
.. literalinclude:: ../../Examples/Guides/CoreClasses.cpp
13+
:caption: Examples/Guides/Basic
1414
:language: C++

Docs/basic-guides/injecting-multiple-services.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ Multiple services can inherit one interface and can be injected using a vector.
99

1010
Injection rules are simple:
1111

12-
* It is guaranteed that vectors won't contain null pointners
12+
* It is guaranteed that vectors won't contain null pointers
1313
* Singleton/scoped services should be injected using std::vector<pointners>
1414
* Transient services should be injected using std::vector<std::unique_ptr>
1515

1616

17-
.. literalinclude:: ../../Examples/InjectingMultipleServices.cpp
18-
:caption: Examples/InjectingMultipleServices
17+
.. literalinclude:: ../../Examples/Guides/InjectingMultipleServices.cpp
18+
:caption: Examples/Guides/InjectingMultipleServices
1919
:language: C++
2020

2121
.. code-block:: console

Docs/basic-guides/injecting-service-provider.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Injecting Service Provider
33

44
Service Provider object can be injected and can be used to manually get (scoped/singletons) or create (transient) services.
55

6-
.. literalinclude:: ../../Examples/InjectingServiceProvider.cpp
7-
:caption: Examples/InjectingServiceProvider
6+
.. literalinclude:: ../../Examples/Guides/InjectingServiceProvider.cpp
7+
:caption: Examples/Guides/InjectingServiceProvider
88
:language: C++
99

1010
.. code-block:: console

Docs/basic-guides/injecting-services.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ This example shows the main purpose of this library, injecting services into ser
88

99
* Service should have one constructor
1010
* It is guaranteed that injected service won`t be null
11-
* Singleton/scoped service should be injected using pointners (references are not allowed due to library limitations, it might be fixed in the future)
11+
* Singleton/scoped service should be injected using pointers (references are not allowed due to library limitations, it might be fixed in the future)
1212
* Transient services should be injected using std::unique_ptr
1313

14-
.. literalinclude:: ../../Examples/InjectingServices.cpp
15-
:caption: Examples/InjectingServices
14+
.. literalinclude:: ../../Examples/Guides/InjectingServices.cpp
15+
:caption: Examples/Guides/InjectingServices
1616
:language: C++
1717

1818
.. code-block:: console

0 commit comments

Comments
 (0)