Biicode-logo
  • Explore
  • Plans
  • Learn
    • Get Started
    • Downloads
    • Docs
    • Blog
    • Forum
  • Log in
C/C++ Arduino Raspberry Pi (cross compiling) Node.js
  • Biicode
    • Installation
      • Install Biicode
      • Install C/C++ tools
      • Debian based distributions
      • Arch based distributions
      • Run biicode from source
      • Install C/C++ tools manually
        • Verify your installation
      • Connect through a proxy server
    • Getting started
      • Basics
      • Create your first project
        • [optional] Keeping #includes short
      • Using an IDE
      • Build and run
      • Publishing
    • Dependencies
      • Dependencies
      • Modifying the version you depend on
        • Depending on a block track
    • Publishing
      • Tag a version
      • Private blocks
    • Custom build configuration
      • CMake basics
      • Where is biicode´s “magic”?
      • Define and prepare targets
        • Which source code files are part of the block’s library
        • Choose STATIC or SHARED library
        • Modify which executable targets are made
        • Which source code files are part of each executable
        • Modify which test targets are made
      • Configure targets
        • Configure library target
        • Configure executable target
      • Select build type: Debug or Release
      • Complete variable reference
    • Adapt your library
      • Concepts to understand
        • Key facts
      • Without a previous CMakeLists.txt
        • 1. Look for unresolved dependencies with bii deps
        • 2. Execute bii build
        • 3. Test the libary’s reusability
      • With a previous CMakeLists.txt
        • Option 1: Let biicode do its job in an isolated file
        • Option 2: Build your own target library and link them to BII_LIB_TARGET
        • Option 3: Adapt your CMakeLists.txt filtering files
    • Advanced Usage
      • Custom Layouts
        • Simple Layout
        • TMP Layout
        • Classic Layout
        • CLion Layout
      • Tests
      • Open multiple blocks
        • Working with your own blocks
        • Opening your block
        • Publishing updated code
        • Closing edited block
        • Working with any published block
        • Open a block
        • Publish the changes
        • Close the block
        • Depend on the block you’ve just published
      • Toolchains
      • Override a dependency
        • Override a dependency with block tracks
      • Advanced build configuration
        • Publish, share and reuse CMake scripts
        • Overriding dependencies build options and configuration
      • Publish a block track
        • Publish a new block Track
      • Private blocks
    • Examples
      • Basic Compression Library
        • Simple Huffman Compression - Uncompression
        • Open and build
      • Boost Libraries
        • Boost.Lambda
        • Boost.Coroutine
        • Alternative setup call
        • Extra configuration variables
        • Contribute to the setup scripts
      • Box2D
        • Bounces of a circle falling
        • Open and build
      • C++ challenge
        • Create a new project
        • Copy the code
        • Find and retrieve dependencies
        • Build and run
      • CImg
        • Tron game
        • Open and build
      • Crypto++
        • Encrypt a message
        • Open and build
      • CSparse
        • Read a matrix and solve a linear system
        • Create a new project
        • Open and build
      • cURL
        • HTML page gatherer
        • Open and build
      • Eigen
        • Middle rows from a matrix
        • Open and build
      • Expression Parser
        • Simple form of mathematical expression parsing
        • Open and build
      • fit
        • Tests
      • Flatbuffers
        • Charge a *.fbs file and generate a C++ header
      • Freeglut
        • 1. Create a new project
        • 2. Creating reusable code
        • 3. Find dependencies
        • 4. Build and run
      • GLFW
        • Running the examples
      • GLUI User Interface Library
        • GLUI Window Template
      • Google Mock (GMock)
        • GMock Examples
        • Mocking a simple function
      • Google Test (GTest)
        • Testing a factorial function: Simple test
        • Testing a factorial function: Test suites
        • Open and build
      • HTTP Server
        • How does it work?
        • How can I use it?
        • The code
        • Supported Operating Systems
        • More information
        • List of dependencies
      • json11
        • Simple convert data to json and vice versa
      • json++
        • Simple parser and converter from JSON to XML
      • Miniutf
      • Multivariate Splines
      • libuv
        • Http client/server application
        • Change libuv’s version
      • Little CMS
        • ICC Profile Examples
        • Open and build
      • Log4z
        • Fast stream log strings test
      • lwan Web Server
        • Hello World Example
      • MiLi
      • MuParser
      • OpenCV
        • Showing an image and detecting faces
        • Open and build
      • OpenSSL
        • Encrypting with MD5 and SHA1
        • Develop your project
        • Open and build
      • POCO
        • PDF example
        • Using NetSSL_OpenSSL or NetSSL_Win library
      • PTypes
      • SDL
        • Graphical window interface
        • Open and build
      • SQLite
        • Shopping list database
        • SQLite++ Wrapper
        • Open and build
      • TinyThread++
        • Open and build the examples
        • Simple Hello World with a thread
        • Draw a fractal
      • Zlib
        • Usage example (difficulty: medium)
      • ZMQ
        • Simple client-server with C++ binding
      • ZMQ with Google Protocol Buffers Serialization
    • Integrations
      • Generators and IDEs
        • Eclipse CDT
        • Visual Studio
        • CLion
      • IDEs and VCS
      • Git (GitHub, Bitbucket, etc.)
        • With a new repository
        • Create a block from a git repository
        • Publish from git commit
      • Continuous Integration
        • AppVeyor
        • Travis CI
      • Koding
      • Doxygen
        • Create a Doxyfile template
        • Edit your Doxyfile
        • Generate the Documentation
    • Reference
      • biicode.conf: configure your biicode projects
        • [requirements]
        • [parent]
        • [paths]
        • [dependencies]
        • [mains]
        • [tests]
        • [hooks]
        • [includes]
        • [data]
      • Commands
        • bii build: build your project
        • bii buzz: init, find and build
        • bii clean: delete meta-information
        • bii close: finish editing published blocks
        • bii configure: configure your project
        • bii deps: show block dependencies
        • bii diff: compare block versions
        • bii find: find your external dependencies
        • bii init: creates a new project
        • bii new: creates new blocks
        • bii open: edit published blocks
        • bii publish: publish your blocks
        • bii setup: install necessary tools
        • bii test: test your code
        • bii update: update a block
        • bii user: specify your username
      • Configuration Files
        • layout.bii: define your project layout
        • policies.bii: defining the policies for the code you want to reuse
        • ignore.bii: filtering your files
        • settings.bii: defining your tools and preferences
        • types.bii: configuring non-standard file extensions
    • Release notes
    • FAQs
      • Is biicode free?
      • Is biicode an editor in the cloud?
      • Is biicode a VCS?
      • Can I use biicode with my favourite VCS?
      • Which languages are supported?
      • How does biicode relate to Maven, NPM, PyPI...?
    • Troubleshooting
      • Eclipse projects: “Launch failed. Binary not found” (OS X)
      • g++ doesn’t compile simple code, using thread header
      • Default Build Configuration with bii build not working
  • Arduino
    • Installation
      • Install Biicode
      • Install Arduino tools
      • Install Arduino tools manually
        • Install Arduino SDK manually
    • Getting started
      • Installing biicode and Arduino tools
      • Create your project
      • Define your board
      • Build and upload your program
      • Depending on Fenix Blink
      • Build and upload
    • Arduino commands
      • bii configure -t arduino: configure your project
      • bii build: build your project
      • bii arduino:upload: send your code into the Arduino
      • bii arduino:settings: configure your Arduino settings
      • bii arduino:monitor: start a serial monitor
      • bii configure –toolchain=arduino: enable, disable or change the Arduino cross compilation
    • How to
      • Eclipse IDE configuration
        • How to import your project
        • How to fix “Unresolved inclusion: Arduino.h”
      • Configure your SDK, port and board
        • I changed my Arduino’s port, what happens now?
        • How can I change my Arduino project properties?
        • bii arduino:settings options
      • How to adapt your code
        • 1. Projects with one single .ino file
        • 2. Projects with multiple .ino files
      • How to use the Arduino Yun
        • Download Arduino 1.5
        • Configure your settings
    • Examples
      • Arduino Serial Monitor
        • C++ code
        • Turn ON/OFF one LED
      • Servo and LCD 2x16
        • What do we need?
        • Scheme
        • The code: Display the servo angle into a LCD
        • Build and upload the code
      • Arduino Serial Interface
        • How does it work?
        • How do I use it?
        • C++ code
        • Arduino code
        • Build and run!
    • Troubleshooting
      • Launching Arduino IDE, I get an error ./arduino: 22: ./arduino: java: not found in Ubuntu
  • Raspberry Pi Cross Compilation
    • Installation
      • Install Biicode
      • Install RPI tools
      • Install RPI cross-compiling tools manually
        • C++ tools installation
        • Raspberry Pi tools installation
    • Getting started
      • 1. Installing biicode and C/C++ cross-building tools
      • 2. Create your project
      • 3. Build and run your program (cross-compiling)
      • 4. Send your executable to your Raspberry Pi
      • 5. Depending on WiringPi
    • RPi commands
      • bii rpi:send: send a bin folder
      • bii rpi:settings: configure your Raspberry Pi settings
      • bii rpi:ssh: connect by ssh with the Raspberry Pi
      • bii configure –toolchain=rpi: enable, disable or change the Raspberry Pi cross compilation.
    • How to
      • Installing the biicode package from downloads page is too slow
      • Output selection and volume control
      • Raspberry Pi GPIO Pin Layout
    • Examples
      • WiringPi: C GPIO library
        • How to make a LED blink with Raspberry Pi
        • How to use the RPi PWM output to control a motor
        • How to use softServo to control a Servo
      • HTTP Server: how to control a led by web
        • How can i use it?
      • A funny moving doll with Raspberry PI and biicode
        • You just need paper, scissors, a servo, a Raspberry Pi and biicode!
        • Choose the paper doll you like most
        • Putting it all together!
        • Stick the head to the servo and put the servo in the body
        • Connect the servo to the 5v, GPIO17 and 0v pins
    • Troubleshooting
      • Is it possible to change the version of gcc used for cross-compiling to the Raspberry Pi?
  • Node.js
    • Getting started
      • 1. Installing biicode and node.js
      • 2. Create your project
      • 3. Run your program
      • 4. Depending on redis
    • How to
      • Run your node programs
  • biicode docs
  • Biicode
  • Integrations
  • Continuous Integration
  • Edit on GitHub
Git (GitHub, Bitbucket, etc.)
Koding

Continuous Integration¶

AppVeyor¶

AppVeyor provides Continuous Integration and Deploy for Windows and it is compatible with both GitHub and Bitbucket.

Place an appveyor.yml file in your repository and each time you push to your Github repository it will kick-off a new build in Windows, executing your tests and publishing it as a biicode block into your biicode user account.

Login AppVeyor and click on + NEW PROJECT and choose the repository you want to deploy with. Create an appveyor.yml file in your local project to automatically publish your block to biicode, including your version tags, here’s an example file:

version: 1.0.{build}

install:
  - cmd: cinst cmake -version 3.0.2 -y
  - cmd: cmake --version
  - cmd: echo "Downloading biicode..."
  - ps: wget http://www.biicode.com/downloads/latest/win -OutFile bii-win.exe
  - cmd: bii-win.exe /VERYSILENT
  - cmd: set PATH=%PATH%;C:\Program Files (x86)\BiiCode\bii
  - cmd: bii -v
  - cmd: del bii-win.exe

before_build:
  - cmd: bii init -L
  - cmd: bii cpp:configure -G "Visual Studio 12"

build_script:
  - cmd: bii build

test_script:
  - cmd: cd bin
  - cmd: amalulla_cpp-expression-parser_test-shunting-yard.exe

deploy_script:
  - cmd: bii user %block_user% -p %secured_passwd%
  - cmd: bii publish -r

environment:
  block_user:
    "amalulla"
  secured_passwd:
    secure: ENCRYPTED_BIICODE_PASSWORD_HERE

Encrypt your biicode password and your access token using Encrypt Data tool, copy the values generated and put them it in your environment like secured_password: secure:. Use your own test_script and environment values to start deploying with it.

Here’s an appveyor guide about how to Git push from Appveyor Build. Following this Appveyor Guide we’re using it as credentials with Git commands. Use this GitHub guide to create your GitHub Personal Access Token. This is a full appveyor.yml file to automatically publish to biicode DEV and STABLE versions:

version: 1.0.{build}

install:
  - cmd: cinst cmake -version 3.0.2 -y
  - cmd: cmake --version
  - cmd: echo "Downloading biicode..."
  - ps: wget http://www.biicode.com/downloads/latest/win -OutFile bii-win.exe
  - cmd: bii-win.exe /VERYSILENT
  - cmd: set PATH=%PATH%;C:\Program Files (x86)\BiiCode\bii
  - cmd: bii -v
  - cmd: del bii-win.exe

before_build:
  - cmd: bii init -L
  - cmd: bii cpp:configure -G "Visual Studio 12"
  - cmd: bii user %block_user%

build_script:
  - cmd: bii build

test_script:
  - cmd: cd bin
  - cmd: amalulla_cpp-expression-parser_test-shunting-yard.exe

deploy_script:
  - cmd: bii user %block_user% -p %secured_passwd%
  - if defined APPVEYOR_REPO_TAG_NAME set VERSION=%APPVEYOR_REPO_TAG_NAME%
  - if defined APPVEYOR_REPO_TAG_NAME bii publish -r --tag=STABLE --versiontag=%VERSION%
  - if not defined APPVEYOR_REPO_TAG_NAME bii publish -r

on_success:
  - cmd: cd /%project_name%/blocks/%block_user%/%block_name%
  - ps: |
        $new_biiconf = get-content biicode.conf
        $orig_biiconf = get-content "$env:APPVEYOR_BUILD_FOLDER\biicode.conf"
        if (diff $new_biiconf $orig_biiconf){
           'different, updating biicode parents'
           git checkout "$env:APPVEYOR_REPO_BRANCH"
           git config --global core.autocrlf true
           git config --global credential.helper store
           Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n"
           git remote add neworigin "$env:github_repo"
           git config --global user.email "$env:github_email"
           git config --global user.name "$env:github_user"
           git add biicode.conf
           git commit -m "Updated biicode parents [skip ci]"
           git push neworigin "$env:APPVEYOR_REPO_BRANCH"
           }Write-Host "Updated biicode parents" else {
            'equal, no parents update needed'
          }

environment:
  project_name:
    "myproject"
  block_user:
    "amalulla"
  block_name:
    "cpp-expression-parser"
  secured_passwd:
    secure: ENCRYPTED_BIICODE_PASSWORD_HERE
  access_token:
    secure: ENCRYPTED_GITHUB_PASSWORD_HERE
  github_user:
    "MariadeAnton"
  github_email:
    "maria.deanton@biicode.com"
  github_repo:
    "git@github.com:MariadeAnton/cpp-expression-parser.git"

What’s going on the appveyor.yml file?

  • install: This part installs all tools required to deploy your biicode projects in AppVeyor.
  • before_build: Moves your project’s files into the biicode project and configures it to use Visual Studio 12 via bii configure. Check biicode docs and your project’s settings in Appveyor to use other build configurations. Also note that there’s a commented line here you should also write if your project contains folders.
  • test_script: cd bin and execute your project. Ensure about your project’s executable, build and execute it locally with bii build.
  • deploy_script: This script publishes your block to biicode, including your version tag only when it’s tagged.
  • on_success: If your biicode.conf file is updated commit its changes to github without launching a new build. Else do nothing.
  • environment: Replace all environment variables here with your values: project_name, tag, default version tag value... Also your encrypted variables.

You can see this example live:

  • Forked cpp-expresion-parser repo in GitHub
  • cpp-expression-parser builds in AppVeyor
  • cpp-expression parser biicode block with its automatically published releases

Learn more about AppVeyor visiting their docs.

  • Here’s a blog-post about using Appveyor CI and Deploy for Windows.
  • MinGW compiler is already installed in Appveyor, just include it in the Path at install section: set PATH=%PATH%;C:\MinGW\bin and bii configure “MinGW Makefiles” at before_build section.

Travis CI¶

Travis CI takes care of running your tests and deploying your apps. Like we work with VCS, many of the blocks published in our web have their .travis.yml files, that lets us pushing to our GitHub repository, and automatically build in Linux, execute and publish this project with your biicode user account thanks to this excellent service.

If you’re working with it, the .travis.yml file format will help to automatically publish to your biicode account with DEV tag:

language: cpp
compiler:
  - clang
  - gcc
before_install:
  - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
  - if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi
  - sudo apt-get update -qq

  - if [ "$CXX" == "g++" ]; then sudo apt-get install -qq g++-${GCC_VERSION}; fi
  - if [ "$CXX" == "g++" ]; then sudo apt-get install -qq gcc-${GCC_VERSION}; fi
  - if [ "$CXX" == "g++" ]; then sudo ln -s -v -f $(which g++-${GCC_VERSION}) /usr/bin/g++; fi
  - if [ "$CXX" == "g++" ]; then sudo ln -s -v -f $(which gcc-${GCC_VERSION}) /usr/bin/gcc; fi
install:
  - wget http://apt.biicode.com/install.sh && chmod +x install.sh && ./install.sh
  - bii --version
  - wget https://s3.amazonaws.com/biibinaries/thirdparty/cmake-3.0.2-Linux-64.tar.gz
  - tar -xzf cmake-3.0.2-Linux-64.tar.gz
  - sudo cp -fR cmake-3.0.2-Linux-64/* /usr
  - rm -rf cmake-3.0.2-Linux-64
  - rm cmake-3.0.2-Linux-64.tar.gz
script:
  - cmake --version
  - bii init -L
  - if [ "$CXX" == "clang++" ]; then export CXX="clang++" && bii build; fi
  - if [ "$CXX" == "g++" ];     then export CXX="g++"     && bii build; fi
##################### CHANGE WITH YOUR CUSTOM CHECKS OR TEST EXECUTION ##################
  - ./bin/amalulla_unit_test_main
########################################################################################
after_success:
  - bii user $USER -p $BII_PASSWORD
  - bii publish
env:
  global:
    - GCC_VERSION="4.9"
    - USER=amalulla
    - secure: Z1IrvEQFr/poZNXRWAVPXB7eDIUwQWXMgkjMWNTJuXAsjKHTXazd5SaOc88Fd6ajU8ZyJfbX1P25bO0A1G+GS15OVq0i28tuFp1HuHF/YmTKu9Ig5erBW36Huj5ijysKbpPeyQxYIpuFcOsCH3MjghQ1nV0Zo+CdnM0OSB2hgcc=

Here’s a way to automatically publish to your biicode account with DEV tag unless your github repository is tagged, in this case, imports the tag and publishes as STABLE to biicode:

language: cpp
compiler:
  - gcc
before_install:
  - export TRAVIS_COMMIT_MSG="$(git log --format=%B --no-merges -n 1)"
  - if [[ "$TRAVIS_COMMIT_MSG" = "$COMMIT_IGNORE_BUILD" ]]; then exit 0 ; fi
  - if [ "$CXX" == "g++" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi
  - sudo apt-get update -qq
  - git config --global user.email "$USER_EMAIL"
  - git config --global user.name "$USER_NAME"
  - git config --global push.default simple
  - git checkout $TRAVIS_BRANCH
install:
  - if [ "$CXX" == "g++" ]; then sudo apt-get install -qq g++-4.8; fi
  - if [ "$CXX" == "g++" ]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50; fi
  - wget http://www.biicode.com/downloads/latest/ubuntu64
  - mv ubuntu64 bii-ubuntu64.deb
  - sudo dpkg -i bii-ubuntu64.deb && sudo apt-get -f install
  - rm bii-ubuntu64.deb
  - wget https://s3.amazonaws.com/biibinaries/thirdparty/cmake-3.0.2-Linux-64.tar.gz
  - tar -xzf cmake-3.0.2-Linux-64.tar.gz
  - sudo cp -fR cmake-3.0.2-Linux-64/* /usr
  - rm -rf cmake-3.0.2-Linux-64
  - rm cmake-3.0.2-Linux-64.tar.gz
  - export TRAVIS_CXX=$CXX
script:
  - cd /tmp
  - bii init -L
  - shopt -s dotglob && mv $TRAVIS_BUILD_DIR/* ./
  - if [ "$CXX" == "clang++" ]; then export CXX="clang++" && bii build; fi
  - if [ "$CXX" == "g++" ];     then export CXX="g++"     && bii build; fi
  - cd /tmp/biicode_project
##################### CHANGE WITH YOUR CUSTOM CHECKS OR TEST EXECUTION ##################
  - ls ./bin/lasote_docker_client_example_main
#########################################################################################
after_success:
  - bii user $USER -p $BII_PASSWORD
  - if [[ -n $TRAVIS_TAG ]]; then bii publish -r --tag STABLE --versiontag $TRAVIS_TAG || echo "Ignored publish output..."; fi
  - if [[ -z $TRAVIS_TAG ]]; then bii publish -r || echo "Ignored publish output..."; fi
  # If there are changes, commit them
  - cd /tmp/biicode_project/blocks/$USER/$BLOCK_NAME
  - git config credential.helper "store --file=.git/credentials"
  - echo "https://${GH_TOKEN}:@github.com" > .git/credentials
  - git add -A .
  - git commit -m "$COMMIT_IGNORE_BUILD"
  - git remote -v
  - git remote set-url origin https://github.com/$TRAVIS_REPO_SLUG.git
  - git push
env:
  global:
    - USER_EMAIL=lasote@gmail.com
    - USER_NAME="Luis Martinez de Bartolome"
    - COMMIT_IGNORE_BUILD="Promoted version.***travis***"
    - BLOCK_NAME=docker_client
    - USER=lasote
    # BII_PASSWORD: Biicode USER's password. > travis encrypt BII_PASSWORD=XXXXXX --add
    - secure: ENCRYPTED_BIICODE_PASSWORD_HERE
    # GH_TOKEN: Github token > travis encrypt GH_TOKEN=XXXXXX --add
    - secure: NCRYPTED_GITHUB_PASSWORD_HERE

What’s going on the .travis.yml file?

  • language and compiler are totally clear (this is where you choose the language and compiler that Travis CI will use).
  • before_installing, stablishes our automatic commit must be ignored and configures git to push later, on the after_success part.
  • install provides the tools necessary to test our code with BIICODE.
  • script, creates, builds and runs the project and checks if the project successes.
  • after_success part is to publish your project to biicode as STABLE with VERSION_TAG if tagged in github, otherwise it publishes as DEV. Also, if your biicode.conf file is updated, this commits its changes to github without launching a new build.
  • env: replace all environment values with your own ones. Don’t delete the *travis* text, as it is the one needed to specify that commit should skip build, avoiding entering an endless build loop.

To learn more about Travis using C++ language, visit its documentation.

Here’s how to automatically build and publish via Travis CI and Github. You can also deploy directly with biicode.

Check our biicode's forum and/or StackOverflow tag for questions and answers. You can also write us for suggestions and feedback.

Git (GitHub, Bitbucket, etc.)
Koding

© Copyright 2014, biicode.