Skip to content

Commit

Permalink
Merge branch 'feat/add_platformio_gmock' of https://github.com/ciband…
Browse files Browse the repository at this point in the history
…/cpp-client into feat/add_platformio_gmock
  • Loading branch information
ciband committed Feb 14, 2019
2 parents f533cab + 4f7d4f6 commit 0d359e0
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 46 deletions.
14 changes: 14 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
version: 2
jobs:
build-arduino-default:
machine: true
steps:
- checkout
- run:
name: Make scripts executable
command: sudo chmod -R +x ./.circleci/*.sh
- run:
name: Install
command: ./.circleci/install_arduino.sh
- run:
name: Build
command: ./.circleci/script_arduino.sh
build-linux-default:
machine: true
steps:
Expand Down Expand Up @@ -99,6 +112,7 @@ workflows:
version: 2
build:
jobs:
- build-arduino-default
- build-linux-default
- build-linux-gcc7
- build-linux-clang-5
Expand Down
21 changes: 21 additions & 0 deletions .circleci/install_arduino.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

sudo apt-get install bzip2
yes | sudo apt install python-pip
pip install pyserial
pip install --upgrade pip

wget -O arduino-cli-linux64.tar.bz2 https://github.com/arduino/arduino-cli/releases/download/0.3.3-alpha.preview/arduino-cli-0.3.3-alpha.preview-linux64.tar.bz2
bunzip2 arduino-cli-linux64.tar.bz2
tar xvf arduino-cli-linux64.tar

sudo mv arduino-cli-0.3.3-alpha.preview-linux64 /usr/local/share/arduino-cli
sudo ln -s /usr/local/share/arduino-cli /usr/local/bin/arduino-cli

printf "board_manager:
additional_urls:
- https://dl.espressif.com/dl/package_esp32_index.json" >> .cli-config.yml
sudo mv .cli-config.yml /usr/local/share/

arduino-cli core update-index
arduino-cli core install esp32:esp32
8 changes: 8 additions & 0 deletions .circleci/script_arduino.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

bash ./extras/ARDUINO_IDE.sh --auto

mkdir -p ~/Arduino/libraries/cpp-client/
mv ~/project/* ~/Arduino/libraries/cpp-client

arduino-cli compile --output temp.bin -b esp32:esp32:esp32 ~/Arduino/libraries/cpp-client/examples/arduino/ESP32/ESP32.ino --debug
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

### 1.0.0 - 2019-01-19
## [1.1.0] - 2019-02-07

### Added

- Added an API `send()` method for the `Transactions` class ([#64])
- Added Arduino Sketch Paths to `library.json` ([#67])

### Fixed

- Fixed unterminated comment which resulted in skipped `Node` tests ([#63])
- Renamed `Helpers` class to avoid naming collision with Cpp-Crypto `Helpers` ([#65])

## 1.0.0 - 2019-01-19

- Initial Release

[unreleased]: https://github.com/ArkEcosystem/cpp-client/compare/1.1.0...develop
[1.1.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.0.0...1.1.0
[#64]: https://github.com/ArkEcosystem/cpp-client/pull/64
[#67]: https://github.com/ArkEcosystem/cpp-client/pull/67
[#63]: https://github.com/ArkEcosystem/cpp-client/pull/63
[#65]: https://github.com/ArkEcosystem/cpp-client/pull/65
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @faustbrian @kristjank @supaiku0
48 changes: 20 additions & 28 deletions extras/ARDUINO_IDE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
# (i.e. recreates the directory tree and moves headers back to 'include'.)
# #########

# Flags
# You can skip the interface by passing '--auto'; eg 'bash ARDUINO_IDE.sh -auto'
AUTO='0'
if [ "$1" == "--auto" ]; then
AUTO='1'
fi

# Directories
EXTRAS_DIR=`dirname "$0"`
INCLUDE_DIR=${EXTRAS_DIR}/../src/include/cpp-client
Expand Down Expand Up @@ -52,24 +59,26 @@ SRC_HTTP_DIR=${SRC_DIR}/http
INCLUDE_HOST_DIR=${INCLUDE_DIR}/host
SRC_HOST_DIR=${SRC_DIR}/host

if [[ $AUTO == '0' ]]; then

# Interface
echo -e "\n\n👋 Welcome Aboard 🚢\n\n"
sleep 1

if [[ -d ${INCLUDE_DIR} ]]; then
echo -e "🤖 This script extends compatibility to the Arduino IDE 🤖\n"
sleep 2
sleep 1
echo -e "💪 All header files will be moved to their 'src' folders 💪\n"
sleep 2
sleep 1
else
echo -e "🤖 Looks like this library was already converted to support the Arduino IDE 🤖\n"
sleep 2
sleep 1
echo -e "💪 All header files will be moved back to the 'include' folder 💪\n"
sleep 2
sleep 1
fi

echo -e "\n🛑 These changes are permanent, any unsaved changes will be lost 🛑\n"
sleep 4
sleep 2

# Prompts for continuation
read -p "⚠️ Are you sure you want to continue? (Y/n):" -n 1 -r
Expand All @@ -81,12 +90,13 @@ else
echo -e "\n\n👌 Let's go!\n";
fi

fi # /if [[ ${AUTO} ]]; then

if [[ -d ${INCLUDE_DIR} ]]; then
# This will run if headers are in the 'include' directory tree.
echo -e "****************************************\n"
echo -e "Moving 'arkClient.h' to 'src' directory.\n"
mv ${INCLUDE_DIR}/arkClient.h ${SRC_DIR}
sleep 1

echo -e "Moving API headers.\n"
mv ${INCLUDE_API_DIR}/abstract.h ${SRC_API_DIR}
Expand All @@ -101,45 +111,35 @@ if [[ -d ${INCLUDE_DIR} ]]; then
mv ${INCLUDE_TRANSACTIONS_DIR}/transactions.h ${SRC_TRANSACTIONS_DIR}
mv ${INCLUDE_VOTES_DIR}/votes.h ${SRC_VOTES_DIR}
mv ${INCLUDE_WALLETS_DIR}/wallets.h ${SRC_WALLETS_DIR}
sleep 1

echo "Creating 'connection' folder 🗂"
mkdir ${SRC_CONNECTION_DIR}
sleep 1

echo -e "Moving 'connection.h' to 'src/connection'.\n"
mv ${INCLUDE_CONNECTION_DIR}/connection.h ${SRC_CONNECTION_DIR}
sleep 1

echo -e "Moving 'host.h'\n"
mv ${INCLUDE_HOST_DIR}/host.h ${SRC_HOST_DIR}
sleep 1

echo -e "Moving 'http.h'\n"
mv ${INCLUDE_HTTP_DIR}/http.h ${SRC_HTTP_DIR}
sleep 1

echo -e "Removing old directories 🗑\n"
rm -rf ${INCLUDE_DIR}
sleep 1

echo -e "****************************************\n"
sleep 1

echo -e "\nAll Done!\n👏👏👏👏👏\n"
echo -e "\nYou can now use Cpp-Client with the Arduino IDE 👍\n\n"
exit 0

else
# This will run if headers are already in the 'src' directory tree.
echo -e "****************************************\n"

echo -e "Creating the 'include' folder 🗂\n"
mkdir ${INCLUDE_DIR}
sleep 1

echo -e "Moving 'arkClient.h' back to the 'include' directory.\n"
mv ${SRC_DIR}/arkClient.h ${INCLUDE_DIR}
sleep 1

echo -e "Recreating API directories 🗂\n"
mkdir ${INCLUDE_API_DIR}
Expand All @@ -150,7 +150,6 @@ else
mkdir ${INCLUDE_TRANSACTIONS_DIR}
mkdir ${INCLUDE_VOTES_DIR}
mkdir ${INCLUDE_WALLETS_DIR}
sleep 1

echo -e "Moving API headers back to the 'include' tree.\n"
mv ${SRC_API_DIR}/abstract.h ${INCLUDE_API_DIR}
Expand All @@ -165,36 +164,29 @@ else
mv ${SRC_TRANSACTIONS_DIR}/transactions.h ${INCLUDE_TRANSACTIONS_DIR}
mv ${SRC_VOTES_DIR}/votes.h ${INCLUDE_VOTES_DIR}
mv ${SRC_WALLETS_DIR}/wallets.h ${INCLUDE_WALLETS_DIR}
sleep 1

echo -e "Recreating the 'connection' folder 🗂"
mkdir ${INCLUDE_CONNECTION_DIR}
sleep 1

echo -e "Moving 'connection.h' to 'include/cpp-client/connection'.\n"
mv ${SRC_CONNECTION_DIR}/connection.h ${INCLUDE_CONNECTION_DIR}
sleep 1

echo -e "Recreating the 'host' folder 🗂"
mkdir ${INCLUDE_HOST_DIR}
sleep 1

echo -e "Moving 'host.h'\n"
mv ${SRC_HOST_DIR}/host.h ${INCLUDE_HOST_DIR}
sleep 1

echo -e "Recreating the 'http' folder 🗂"
mkdir ${INCLUDE_HTTP_DIR}
sleep 1

echo -e "Moving 'http.h'\n"
mv ${SRC_HTTP_DIR}/http.h ${INCLUDE_HTTP_DIR}
sleep 1

echo -e "Removing old directories 🗑\n"
rm -rf ${SRC_CONNECTION_DIR}
sleep 1

echo -e "****************************************\n"
sleep 1

echo -e "\nAll Done!\n👏👏👏👏👏\n"
echo -e "\nArduino IDE compatibility has been reverted 👍\n\n"
exit 0
Expand Down
18 changes: 2 additions & 16 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/ArkEcosystem/Cpp-Client.git"
},
"version": "1.0.0",
"version": "1.1.0",
"authors": [
{
"name": "Ark Ecosystem",
Expand Down Expand Up @@ -47,23 +47,9 @@
"platforms": "espressif32"
}
],
"export": {
"include": [
"src/*"
],
"exclude": [
"test/*",
"examples/*"
]
},
"build": {
"flags": [
"-I src/include/cpp-client"
]
},
"examples": [
"[Ee]xamples/platformio_example/*.ino",
"[Ee]xamples/platformio_example/*.cpp",
"[Ee]xamples/platformio_example/*.c"
]
}
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Ark-Cpp-Client
version=1.0.0
version=1.1.0
author=Ark Ecosystem
maintainer=Ark Ecosystem
sentence=A simple API client implementation in C++ for the ARK Blockchain.
Expand Down

0 comments on commit 0d359e0

Please sign in to comment.