Skip to content

Commit

Permalink
Revert "Merge branch 'master' into RVA/NLIC-2466/Fix-(make-stable)-C+…
Browse files Browse the repository at this point in the history
…+-client-tests-and-add-bundle-shop-token-example"

This reverts commit b9751ca, reversing
changes made to 9486731.
  • Loading branch information
v-rudkovskiy committed Aug 20, 2024
1 parent b9751ca commit a822f0b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 52 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/netlicesning-client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ jobs:
apt-get update
apt-get upgrade -y
- name: Install required dependencies
run: apt-get install -y git g++ cmake libcurl4-openssl-dev libboost-all-dev
run: apt-get install -y git g++ cmake libcurl4-openssl-dev
- name: Build with CMake
run: |
mkdir build
cd build
cmake .. -DBUILD_TESTS=yes
cmake ..
make
- name: Run tests
run: |
cd tests
./run_tests
- name: Run Demo App
run: |
cd build
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@

# Generated and working files and directories
tests/run_tests
build*
build
.vscode
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
find_package(CURL REQUIRED)

if (BUILD_TESTS)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.40 REQUIRED unit_test_framework)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.40 REQUIRED unit_test_framework)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand All @@ -22,7 +22,7 @@ set(LIBS ${LIBS} ${CURL_LIBRARIES} ${JSONCPP_LIBRARIES})
set(BUILD_SHARED_LIBS OFF)

add_definitions(-DCURL_STATICLIB)
if (UNIX)
if(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()

Expand All @@ -37,7 +37,7 @@ target_link_libraries(netlicensing ${LIBS})
# demo client
file(GLOB client_demo_headers client_demo/${db2lp_component}/*h)
file(GLOB client_demo_sources client_demo/${db2lp_component}/*cc)
add_executable(netlicensing-client-demo ${client_demo_headers} ${client_demo_sources})
add_executable(netlicensing-client-demo ${client_demo_headers} ${client_demo_sources} )
target_link_libraries(netlicensing-client-demo netlicensing ${LIBS})

if (BUILD_TESTS)
Expand Down
43 changes: 5 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ C++ wrapper for Labs64 NetLicensing [RESTful API](https://netlicensing.io/wiki/r
Visit Labs64 NetLicensing at https://netlicensing.io

## Dependencies
1. C++11 toolset + STL
2. cmake
3. [libcurl](https://github.com/curl/curl) (with libcurl's transitive dependencies)
4. [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (included)
5. [boost](https://www.boost.org/) (optional, needed for unit tests)

1. C++11 STL
2. [libcurl](https://github.com/curl/curl) (with libcurl's transitive dependencies)
3. [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (included)

## Compatibility

Expand All @@ -35,7 +32,6 @@ Windows 10 | Visual studio 14 2015 x86 - x64
Windows 10 | Visual studio 15 2017 x86 - x64
macOS Mojave | Xcode 10.1


## Windows build

### Build curl
Expand All @@ -62,14 +58,12 @@ macOS Mojave | Xcode 10.1
(replace `-G` argument with your actual version / platform, see [`cmake` documentation](https://cmake.org/cmake/help/latest/))
5. Open solution created in `NetLicensingClient-cpp\build` directory in Visual Studio and build the library and demo client.


## Linux build

### Build NetLincesing-cpp
1. Download the latest release and unpack to `NetLicensingClient-cpp` (or checkout [master](https://github.com/Labs64/NetLicensingClient-cpp.git) to build the latest development version)
2. Install **libcurl** (for development, including C headers and libraries). E.g. in **Ubuntu**:
```sudo apt-get install libcurl4-openssl-dev```
3. Install **boost**: ```sudo apt-get install libboost-all-dev```
2. Install **curl** (for development, including C headers and libraries). E.g. in **Ubuntu**:
```sudo apt-get install libcurl4-openssl```
3. In the `NetLicensingClient-cpp` directory create `build/` subdirectory
4. Execute:
```
Expand All @@ -83,33 +77,6 @@ macOS Mojave | Xcode 10.1
Unit tests require [**Boost**](https://www.boost.org) Unit Test Framework. To build project with the unit tests activated add cmake option `-DBUILD_TESTS=yes`. The tests must be executed from `tests/` subdirectory on Linux or `tests\Debug\` on Windows in order to properly locate the JSON files with test data.


## Linux build using docker

_TODO: full description_

1. Prepare container
- Image: ubuntu:22.04
- apt-get update
- apt-get install cmake g++ libcurl4-openssl-dev libboost-all-dev

2. Map `NetLicensingClient-cpp` or clone it inside the container

3. Build as described in [Linux Build](#linux-build)


## MacOS build

_TODO: full description_

1. Prepare environment:
- Install XCode 10.1+
- Install `homebrew`
- `libcurl` is provided
- `brew install cmake boost`

2. Build as described in [Linux Build](#linux-build)


## Execution environment

**libcurl** dynamic library should be either installed system-wide or otherwise available for the loading at run-time (typically located in the same directory as your executable)
2 changes: 0 additions & 2 deletions include/netlicensing/mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#include "netlicensing/transaction.h"
#include "netlicensing/licensing_model.h"
#include "netlicensing/bundle.h"
#include "netlicensing/license_type.h"
#include "netlicensing/license_template.h"

namespace netlicensing {

Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class TestObserver {
BOOST_AUTO_TEST_SUITE(test_mapper)

BOOST_AUTO_TEST_CASE(initial_test) {
std::string str = read_whole_file("product.json");
std::string str = read_whole_file("../json/product.json");
BOOST_REQUIRE(!str.empty());
Json::Value root;
Json::Reader reader;
Expand Down

0 comments on commit a822f0b

Please sign in to comment.