Skip to content

chore: move packages out of source #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .appveyor
Original file line number Diff line number Diff line change
@@ -6,15 +6,12 @@ environment:
matrix:
- CONFIGURATION: Debug
- CONFIGURATION: Release

install:
- git submodule update --init --recursive

before_build:
- cmake -G "Visual Studio 15 2017 Win64" .
- cmake -D UNIT_TEST=ON -G "Visual Studio 15 2017 Win64" .

build:
project: $(APPVEYOR_BUILD_FOLDER)\Ark-Cpp-Client.sln
project: $(APPVEYOR_BUILD_FOLDER)\ark_cpp_client.sln

test_script:
- cmd: '%APPVEYOR_BUILD_FOLDER%\Bin\%CONFIGURATION%\Ark-Cpp-Client-tests.exe'
- cmd: '%APPVEYOR_BUILD_FOLDER%\Bin\%CONFIGURATION%\ark_cpp_client.exe'
9 changes: 3 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -6,15 +6,12 @@ environment:
matrix:
- CONFIGURATION: Debug
- CONFIGURATION: Release

install:
- git submodule update --init --recursive

before_build:
- cmake -G "Visual Studio 15 2017 Win64" .
- cmake -D UNIT_TEST=ON -G "Visual Studio 15 2017 Win64" .

build:
project: $(APPVEYOR_BUILD_FOLDER)\Ark-Cpp-Client.sln
project: $(APPVEYOR_BUILD_FOLDER)\ark_cpp_client.sln

test_script:
- cmd: '%APPVEYOR_BUILD_FOLDER%\test\%CONFIGURATION%\Ark-Cpp-Client-tests.exe'
- cmd: '%APPVEYOR_BUILD_FOLDER%\test\%CONFIGURATION%\ark_cpp_client_tests.exe'
66 changes: 34 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -9,46 +9,49 @@ on:
types: [ready_for_review, synchronize, opened]

jobs:
arduino-default:
arduino:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Make scripts executable
run: sudo chmod -R +x ./.github/workflows/test/*.sh
- name: Install
- name: Install Dependencies
run: ./.github/workflows/test/install_arduino.sh
- name: Build
- name: Build Arduino Sketch
run: ./.github/workflows/test/script_arduino.sh

linux-default:
platformio:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Make scripts executable
run: sudo chmod -R +x ./.github/workflows/test/*.sh
- name: Install
run: ./.github/workflows/test/install_platform_io.sh
- name: Install Dependencies
run: |
sudo pip install -U platformio
platformio update
- name: Build
run: ./.github/workflows/test/script_platform_io.sh
run: |
platformio run
platformio run -d ./test

linux-gcc7:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Install dependencies
- name: Install Dependencies
run: |
sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y install g++-7 lcov cmake openssl
- name: Make scripts executable
run: sudo chmod -R +x ./.github/workflows/test/*.sh
- name: Build
run: ./.github/workflows/test/script_desktop.sh
env:
CC: gcc-7
CXX: g++-7
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON ..
cmake --build .
- name: Run Tests
run: ./build/test/ark_cpp_client_tests
- name: Codecov upload
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}

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

steps:
- uses: actions/checkout@v1
- name: Install dependencies
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get -y install clang-5.0 clang-format-5.0 clang-tidy-5.0 lcov cmake openssl
- name: Make scripts executable
run: sudo chmod -R +x ./.github/workflows/test/*.sh
- name: Build
run: ./.github/workflows/test/script_desktop.sh
env:
CC: clang-5.0
CXX: clang++-5.0
run: |
mkdir build && cd build
cmake -DUNIT_TEST=ON ..
cmake --build .
- name: Run Tests
run: ./build/test/ark_cpp_client_tests
- name: Clang Tidy
run: ./.github/workflows/test/clang_tidy.sh
env:
CC: clang-5.0
CXX: clang++-5.0
- name: Clang Format
run: ./.github/workflows/test/clang_format.sh
env:
CC: clang-5.0
CXX: clang++-5.0

macos:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- run: COMPILER=clang++
- name: Install dependencies
run: brew install cmake lcov
- name: Make scripts executable
run: sudo chmod -R +x ./.github/workflows/test/*.sh
- name: Install Dependencies
run: brew install cmake
- name: Build
run: ./.github/workflows/test/script_desktop.sh
run: |
mkdir build && cd build
cmake -DUNIT_TEST=ON ..
cmake --build .
- name: Run Tests
run: ./build/test/ark_cpp_client_tests
2 changes: 1 addition & 1 deletion .github/workflows/test/clang_format.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ex

grep -nr '\s$' src test examples .gitignore .gitmodules 2>&1 > /dev/null
grep -nr '\s$' src test .gitignore 2>&1 > /dev/null
if $?; then
echo Trailing whitespace found, aborting
exit 1
7 changes: 0 additions & 7 deletions .github/workflows/test/install_platform_io.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/test/script_desktop.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .github/workflows/test/script_platform_io.sh

This file was deleted.

20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@ build
/test/.vscode
/test/lib/readme.txt
.DS_Store
/src/Ark-Cpp-Client-lib.vcxproj.filters
/src/Ark-Cpp-Client-lib.vcxproj
/src/Ark-Cpp-Client-lib.sln
/src/ark_cpp_client.vcxproj.filters
/src/ark_cpp_client.vcxproj
/src/ark_cpp_client.sln
/src/ALL_BUILD.vcxproj.filters
/src/ALL_BUILD.vcxproj
/Win32
@@ -37,25 +37,25 @@ build
/test/Experimental.vcxproj
/test/Continuous.vcxproj.filters
/test/Continuous.vcxproj
/test/Ark-Cpp-Client-tests.vcxproj.filters
/test/Ark-Cpp-Client-tests.vcxproj
/test/Ark-Cpp-Client-tests.sln
/test/ark_cpp_client_tests.vcxproj.filters
/test/ark_cpp_client_tests.vcxproj
/test/Aark_cpp_client_tests.sln
/test/ALL_BUILD.vcxproj.filters
/test/ALL_BUILD.vcxproj
/_3rdParty
/ZERO_CHECK.vcxproj.filters
/ZERO_CHECK.vcxproj
/Ark-Cpp-Client.sln
/ark_cpp_client.sln
/ALL_BUILD.vcxproj.filters
/ALL_BUILD.vcxproj
/src/Win32
/examples/cmake_example/_3rdParty
/examples/cmake_example/bin
/examples/cmake_example/ZERO_CHECK.vcxproj.filters
/examples/cmake_example/ZERO_CHECK.vcxproj
/examples/cmake_example/Cpp-Client-Example.vcxproj.filters
/examples/cmake_example/Cpp-Client-Example.vcxproj
/examples/cmake_example/Cpp-Client-Example.sln
/examples/cmake_example/ark_cpp_client_example.vcxproj.filters
/examples/cmake_example/ark_cpp_client_example.vcxproj
/examples/cmake_example/ark_cpp_client_example.sln
/examples/cmake_example/ALL_BUILD.vcxproj.filters
/examples/cmake_example/ALL_BUILD.vcxproj
/examples/cmake_example/Win32
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- added Blockchain API endpoint ([#104])

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

### Fixed
- fixed typos in Arduino examples ([#86])
@@ -68,4 +70,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#93]: https://github.com/ArkEcosystem/cpp-client/pull/93
[#104]: https://github.com/ArkEcosystem/cpp-client/pull/104
[#114]: https://github.com/ArkEcosystem/cpp-client/pull/114
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
[unreleased]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...develop
88 changes: 52 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,68 +1,84 @@
cmake_minimum_required(VERSION 3.2.2)

set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchain.cmake")
cmake_minimum_required(VERSION 3.2)

project(Ark-Cpp-Client)
project(ark_cpp_client)

# ------------------------------------------------------------------------------
# Set the Environment Variables
# ------------------------------------------------------------------------------

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)

set(CMAKE_INSTALL_PREFIX ${PROJECT_SOURCE_DIR})
set(EXTERNAL_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/extern)

set(BUILD_SHARED_LIBS OFF)

if (MSVC)
add_definitions(
-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-DNOMINMAX
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
add_definitions(-D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS
-DNOMINMAX)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g")
endif()

# clone submodules
execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# Clang Tidy
# ------------------------------------------------------------------------------

if(ENABLE_CLANG_TIDY)

find_program(CLANG_TIDY_BIN clang-tidy-6.0)
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py)
find_program(CLANG_TIDY_BIN clang-tidy-6.0)
find_program(RUN_CLANG_TIDY_BIN run-clang-tidy-6.0.py)

if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
message(FATAL_ERROR "unable to locate clang-tidy-5.0")
endif()
if(CLANG_TIDY_BIN STREQUAL "CLANG_TIDY_BIN-NOTFOUND")
message(FATAL_ERROR "unable to locate clang-tidy-5.0")
endif()

if(RUN_CLANG_TIDY_BIN STREQUAL "RUN_CLANG_TIDY_BIN-NOTFOUND")
message(FATAL_ERROR "unable to locate run-clang-tidy-5.0.py")
endif()
if(RUN_CLANG_TIDY_BIN STREQUAL "RUN_CLANG_TIDY_BIN-NOTFOUND")
message(FATAL_ERROR "unable to locate run-clang-tidy-5.0.py")
endif()

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

add_custom_target(
tidy
COMMAND ${RUN_CLANG_TIDY_BIN} ${RUN_CLANG_TIDY_BIN_ARGS}
COMMENT "running clang tidy"
)
add_custom_target(tidy
COMMAND ${RUN_CLANG_TIDY_BIN} ${RUN_CLANG_TIDY_BIN_ARGS}
COMMENT "running clang tidy")

endif()

# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# Add the ARK C++ Client Library Subdirectory
# ------------------------------------------------------------------------------

add_subdirectory(src)
add_subdirectory(test)

# ------------------------------------------------------------------------------

# ------------------------------------------------------------------------------
# Add the ARK C++ Client Test Subdirectory
#
# Disabled by default.
#
# Use `cmake -DUNIT_TEST=ON ..` to enable Test building.
# ------------------------------------------------------------------------------

option(UNIT_TEST "Tests disabled by default" OFF)

if(UNIT_TEST)
add_subdirectory(test)
endif()

# ------------------------------------------------------------------------------
Loading