Skip to content

Commit 4d99aae

Browse files
sleepdefic1tfaustbrian
authored andcommitted
chore: move packages out of source (#140)
1 parent 97eb34b commit 4d99aae

28 files changed

+429
-261
lines changed

.appveyor

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ environment:
66
matrix:
77
- CONFIGURATION: Debug
88
- CONFIGURATION: Release
9-
10-
install:
11-
- git submodule update --init --recursive
129

1310
before_build:
14-
- cmake -G "Visual Studio 15 2017 Win64" .
11+
- cmake -D UNIT_TEST=ON -G "Visual Studio 15 2017 Win64" .
1512

1613
build:
17-
project: $(APPVEYOR_BUILD_FOLDER)\Ark-Cpp-Client.sln
14+
project: $(APPVEYOR_BUILD_FOLDER)\ark_cpp_client.sln
1815

1916
test_script:
20-
- cmd: '%APPVEYOR_BUILD_FOLDER%\Bin\%CONFIGURATION%\Ark-Cpp-Client-tests.exe'
17+
- cmd: '%APPVEYOR_BUILD_FOLDER%\Bin\%CONFIGURATION%\ark_cpp_client.exe'

.appveyor.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ environment:
66
matrix:
77
- CONFIGURATION: Debug
88
- CONFIGURATION: Release
9-
10-
install:
11-
- git submodule update --init --recursive
129

1310
before_build:
14-
- cmake -G "Visual Studio 15 2017 Win64" .
11+
- cmake -D UNIT_TEST=ON -G "Visual Studio 15 2017 Win64" .
1512

1613
build:
17-
project: $(APPVEYOR_BUILD_FOLDER)\Ark-Cpp-Client.sln
14+
project: $(APPVEYOR_BUILD_FOLDER)\ark_cpp_client.sln
1815

1916
test_script:
20-
- cmd: '%APPVEYOR_BUILD_FOLDER%\test\%CONFIGURATION%\Ark-Cpp-Client-tests.exe'
17+
- cmd: '%APPVEYOR_BUILD_FOLDER%\test\%CONFIGURATION%\ark_cpp_client_tests.exe'

.github/workflows/test.yml

+34-32
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,49 @@ on:
99
types: [ready_for_review, synchronize, opened]
1010

1111
jobs:
12-
arduino-default:
12+
arduino:
1313
runs-on: ubuntu-latest
1414

1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Make scripts executable
1818
run: sudo chmod -R +x ./.github/workflows/test/*.sh
19-
- name: Install
19+
- name: Install Dependencies
2020
run: ./.github/workflows/test/install_arduino.sh
21-
- name: Build
21+
- name: Build Arduino Sketch
2222
run: ./.github/workflows/test/script_arduino.sh
2323

24-
linux-default:
24+
platformio:
2525
runs-on: ubuntu-latest
2626

2727
steps:
2828
- uses: actions/checkout@v1
29-
- name: Make scripts executable
30-
run: sudo chmod -R +x ./.github/workflows/test/*.sh
31-
- name: Install
32-
run: ./.github/workflows/test/install_platform_io.sh
29+
- name: Install Dependencies
30+
run: |
31+
sudo pip install -U platformio
32+
platformio update
3333
- name: Build
34-
run: ./.github/workflows/test/script_platform_io.sh
34+
run: |
35+
platformio run
36+
platformio run -d ./test
37+
3538
linux-gcc7:
3639
runs-on: ubuntu-latest
3740

3841
steps:
3942
- uses: actions/checkout@v1
40-
- name: Install dependencies
43+
- name: Install Dependencies
4144
run: |
4245
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
4346
sudo apt-get update
4447
sudo apt-get -y install g++-7 lcov cmake openssl
45-
- name: Make scripts executable
46-
run: sudo chmod -R +x ./.github/workflows/test/*.sh
4748
- name: Build
48-
run: ./.github/workflows/test/script_desktop.sh
49-
env:
50-
CC: gcc-7
51-
CXX: g++-7
49+
run: |
50+
mkdir build && cd build
51+
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON ..
52+
cmake --build .
53+
- name: Run Tests
54+
run: ./build/test/ark_cpp_client_tests
5255
- name: Codecov upload
5356
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
5457

@@ -57,37 +60,36 @@ jobs:
5760

5861
steps:
5962
- uses: actions/checkout@v1
60-
- name: Install dependencies
63+
- name: Install Dependencies
6164
run: |
6265
sudo apt-get update
6366
sudo apt-get -y install clang-5.0 clang-format-5.0 clang-tidy-5.0 lcov cmake openssl
6467
- name: Make scripts executable
6568
run: sudo chmod -R +x ./.github/workflows/test/*.sh
6669
- name: Build
67-
run: ./.github/workflows/test/script_desktop.sh
68-
env:
69-
CC: clang-5.0
70-
CXX: clang++-5.0
70+
run: |
71+
mkdir build && cd build
72+
cmake -DUNIT_TEST=ON ..
73+
cmake --build .
74+
- name: Run Tests
75+
run: ./build/test/ark_cpp_client_tests
7176
- name: Clang Tidy
7277
run: ./.github/workflows/test/clang_tidy.sh
73-
env:
74-
CC: clang-5.0
75-
CXX: clang++-5.0
7678
- name: Clang Format
7779
run: ./.github/workflows/test/clang_format.sh
78-
env:
79-
CC: clang-5.0
80-
CXX: clang++-5.0
8180

8281
macos:
8382
runs-on: macOS-latest
8483

8584
steps:
8685
- uses: actions/checkout@v1
8786
- run: COMPILER=clang++
88-
- name: Install dependencies
89-
run: brew install cmake lcov
90-
- name: Make scripts executable
91-
run: sudo chmod -R +x ./.github/workflows/test/*.sh
87+
- name: Install Dependencies
88+
run: brew install cmake
9289
- name: Build
93-
run: ./.github/workflows/test/script_desktop.sh
90+
run: |
91+
mkdir build && cd build
92+
cmake -DUNIT_TEST=ON ..
93+
cmake --build .
94+
- name: Run Tests
95+
run: ./build/test/ark_cpp_client_tests

.github/workflows/test/clang_format.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -ex
22

3-
grep -nr '\s$' src test examples .gitignore .gitmodules 2>&1 > /dev/null
3+
grep -nr '\s$' src test .gitignore 2>&1 > /dev/null
44
if $?; then
55
echo Trailing whitespace found, aborting
66
exit 1

.github/workflows/test/install_platform_io.sh

-7
This file was deleted.

.github/workflows/test/script_desktop.sh

-15
This file was deleted.

.github/workflows/test/script_platform_io.sh

-7
This file was deleted.

.gitignore

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ build
2323
/test/.vscode
2424
/test/lib/readme.txt
2525
.DS_Store
26-
/src/Ark-Cpp-Client-lib.vcxproj.filters
27-
/src/Ark-Cpp-Client-lib.vcxproj
28-
/src/Ark-Cpp-Client-lib.sln
26+
/src/ark_cpp_client.vcxproj.filters
27+
/src/ark_cpp_client.vcxproj
28+
/src/ark_cpp_client.sln
2929
/src/ALL_BUILD.vcxproj.filters
3030
/src/ALL_BUILD.vcxproj
3131
/Win32
@@ -37,25 +37,25 @@ build
3737
/test/Experimental.vcxproj
3838
/test/Continuous.vcxproj.filters
3939
/test/Continuous.vcxproj
40-
/test/Ark-Cpp-Client-tests.vcxproj.filters
41-
/test/Ark-Cpp-Client-tests.vcxproj
42-
/test/Ark-Cpp-Client-tests.sln
40+
/test/ark_cpp_client_tests.vcxproj.filters
41+
/test/ark_cpp_client_tests.vcxproj
42+
/test/Aark_cpp_client_tests.sln
4343
/test/ALL_BUILD.vcxproj.filters
4444
/test/ALL_BUILD.vcxproj
4545
/_3rdParty
4646
/ZERO_CHECK.vcxproj.filters
4747
/ZERO_CHECK.vcxproj
48-
/Ark-Cpp-Client.sln
48+
/ark_cpp_client.sln
4949
/ALL_BUILD.vcxproj.filters
5050
/ALL_BUILD.vcxproj
5151
/src/Win32
5252
/examples/cmake_example/_3rdParty
5353
/examples/cmake_example/bin
5454
/examples/cmake_example/ZERO_CHECK.vcxproj.filters
5555
/examples/cmake_example/ZERO_CHECK.vcxproj
56-
/examples/cmake_example/Cpp-Client-Example.vcxproj.filters
57-
/examples/cmake_example/Cpp-Client-Example.vcxproj
58-
/examples/cmake_example/Cpp-Client-Example.sln
56+
/examples/cmake_example/ark_cpp_client_example.vcxproj.filters
57+
/examples/cmake_example/ark_cpp_client_example.vcxproj
58+
/examples/cmake_example/ark_cpp_client_example.sln
5959
/examples/cmake_example/ALL_BUILD.vcxproj.filters
6060
/examples/cmake_example/ALL_BUILD.vcxproj
6161
/examples/cmake_example/Win32

.gitmodules

-6
This file was deleted.

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
910
### Added
1011
- added Blockchain API endpoint ([#104])
1112

@@ -15,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1516
- improved formatting and maintainability ([#92])
1617
- dropped Hunter Package Manager in favor of git submodules in OS builds ([#90])
1718
- updated ArduinoJson 5.13.2 >> 6.10.1, usage patterns, and documentation/examples ([#87])
19+
- moved external libraries out of source tree ([#140])
1820

1921
### Fixed
2022
- fixed typos in Arduino examples ([#86])
@@ -68,4 +70,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6870
[#93]: https://github.com/ArkEcosystem/cpp-client/pull/93
6971
[#104]: https://github.com/ArkEcosystem/cpp-client/pull/104
7072
[#114]: https://github.com/ArkEcosystem/cpp-client/pull/114
73+
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
7174
[unreleased]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...develop

CMakeLists.txt

+52-36
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,84 @@
1-
cmake_minimum_required(VERSION 3.2.2)
21

3-
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake")
2+
cmake_minimum_required(VERSION 3.2)
43

5-
project(Ark-Cpp-Client)
4+
project(ark_cpp_client)
5+
6+
# ------------------------------------------------------------------------------
7+
# Set the Environment Variables
8+
# ------------------------------------------------------------------------------
69

710
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
811
set(CMAKE_CXX_STANDARD 11)
912

1013
set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR})
14+
set(EXTERNAL_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/extern)
1115

1216
set(BUILD_SHARED_LIBS OFF)
1317

1418
if (MSVC)
15-
add_definitions(
16-
-D_CRT_SECURE_NO_WARNINGS
17-
-D_SCL_SECURE_NO_WARNINGS
18-
-DNOMINMAX
19-
)
20-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
21-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
22-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
19+
add_definitions(-D_CRT_SECURE_NO_WARNINGS
20+
-D_SCL_SECURE_NO_WARNINGS
21+
-DNOMINMAX)
22+
23+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
24+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
25+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
2326
else()
24-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
27+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
2528
endif()
2629

27-
# clone submodules
28-
execute_process(
29-
COMMAND git submodule update --init --recursive
30-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
31-
)
30+
# ------------------------------------------------------------------------------
3231

3332
# ------------------------------------------------------------------------------
3433
# Clang Tidy
3534
# ------------------------------------------------------------------------------
3635

3736
if(ENABLE_CLANG_TIDY)
3837

39-
find_program(CLANG_TIDY_BIN clang-tidy-6.0)
40-
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py)
38+
find_program(CLANG_TIDY_BIN clang-tidy-6.0)
39+
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py)
4140

42-
if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
43-
message(FATAL_ERROR "unable to locate clang-tidy-5.0")
44-
endif()
41+
if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
42+
message(FATAL_ERROR "unable to locate clang-tidy-5.0")
43+
endif()
4544

46-
if(RUN_CLANG_TIDY_BIN STREQUAL "RUN_CLANG_TIDY_BIN-NOTFOUND")
47-
message(FATAL_ERROR "unable to locate run-clang-tidy-5.0.py")
48-
endif()
45+
if(RUN_CLANG_TIDY_BIN STREQUAL "RUN_CLANG_TIDY_BIN-NOTFOUND")
46+
message(FATAL_ERROR "unable to locate run-clang-tidy-5.0.py")
47+
endif()
4948

50-
list(APPEND RUN_CLANG_TIDY_BIN_ARGS
51-
-clang-tidy-binary ${CLANG_TIDY_BIN}
52-
"\"-header-filter=.*\\b(src|test|examples)\\b\\/(?!lib).*\"" #Only run clang tidy on src, test, examples and skip 3rd party libraries
53-
-checks=clan*,cert*,misc*,perf*,cppc*,read*,mode*,-cert-err58-cpp,-misc-noexcept-move-constructor,-cppcoreguidelines-*
54-
)
49+
list(APPEND RUN_CLANG_TIDY_BIN_ARGS
50+
-clang-tidy-binary ${CLANG_TIDY_BIN}
51+
"\"-header-filter=.*\\b(src|test|examples)\\b\\/(?!lib).*\"" #Only run clang tidy on src, test, examples and skip 3rd party libraries
52+
-checks=clan*,cert*,misc*,perf*,cppc*,read*,mode*,-cert-err58-cpp,-misc-noexcept-move-constructor,-cppcoreguidelines-*)
5553

56-
add_custom_target(
57-
tidy
58-
COMMAND ${RUN_CLANG_TIDY_BIN} ${RUN_CLANG_TIDY_BIN_ARGS}
59-
COMMENT "running clang tidy"
60-
)
54+
add_custom_target(tidy
55+
COMMAND ${RUN_CLANG_TIDY_BIN} ${RUN_CLANG_TIDY_BIN_ARGS}
56+
COMMENT "running clang tidy")
6157

6258
endif()
6359

6460
# ------------------------------------------------------------------------------
6561

62+
# ------------------------------------------------------------------------------
63+
# Add the ARK C++ Client Library Subdirectory
64+
# ------------------------------------------------------------------------------
65+
6666
add_subdirectory(src)
67-
add_subdirectory(test)
6867

68+
# ------------------------------------------------------------------------------
69+
70+
# ------------------------------------------------------------------------------
71+
# Add the ARK C++ Client Test Subdirectory
72+
#
73+
# Disabled by default.
74+
#
75+
# Use `cmake -DUNIT_TEST=ON ..` to enable Test building.
76+
# ------------------------------------------------------------------------------
77+
78+
option(UNIT_TEST "Tests disabled by default" OFF)
79+
80+
if(UNIT_TEST)
81+
add_subdirectory(test)
82+
endif()
83+
84+
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)