Skip to content

Commit

Permalink
Add prebuild feature (#30)
Browse files Browse the repository at this point in the history
* add prebuild feature
  • Loading branch information
mathiask88 authored Jul 7, 2017
1 parent 2949d40 commit 9ba4a42
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ env:
- TRAVIS_NODE_VERSION="6"
- TRAVIS_NODE_VERSION="5"
- TRAVIS_NODE_VERSION="4"
- TRAVIS_NODE_VERSION="3"
- TRAVIS_NODE_VERSION="0.12"
- TRAVIS_NODE_VERSION="0.10"
- TRAVIS_NODE_VERSION="0.8"

addons:
apt:
Expand All @@ -29,6 +27,8 @@ install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
- $CXX --version
- node --version
- npm --version
- npm install

script:
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![NPM](https://nodei.co/npm/node-snap7.png?downloads=true)](https://nodei.co/npm/node-snap7/) [![NPM](https://nodei.co/npm-dl/node-snap7.png?months=1)](https://nodei.co/npm/node-snap7/)

**Current node-snap7 version:** 0.3.1
**Current snap7 version:** 1.4.2

**Build status:** Linux [![Build Status](https://travis-ci.org/mathiask88/node-snap7.svg?branch=master)](https://travis-ci.org/mathiask88/node-snap7) Windows [![Build status](https://ci.appveyor.com/api/projects/status/ca1kepectsn3wkrc)](https://ci.appveyor.com/project/mathiask88/node-snap7)
[![Build Status](https://travis-ci.org/mathiask88/node-snap7.svg?branch=master)](https://travis-ci.org/mathiask88/node-snap7)
[![Build status](https://ci.appveyor.com/api/projects/status/ca1kepectsn3wkrc/branch/master?svg=true)](https://ci.appveyor.com/project/mathiask88/node-snap7/branch/master)
[![dependencies Status](https://david-dm.org/mathiask88/node-snap7/status.svg)](https://david-dm.org/mathiask88/node-snap7)

**!!! node-snap7 is still a work in progress !!!**
**Current node-snap7 version:** 0.3.1\
**Current snap7 version:** 1.4.2

## About
This is a node.js wrapper for snap7. Snap7 is an open source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively with Siemens S7 PLCs (See [compatibility](http://snap7.sourceforge.net/snap7_client.html#target_compatibility)).
Expand All @@ -17,7 +17,11 @@ Install with:

npm install node-snap7

Requirements:
node-snap7 uses `prebuild` and `prebuild-install` for handling prebuilt binaries. See [this list](https://github.com/mathiask88/node-snap7/releases) of supported prebuilt platform binaries. When installing node-snap7 `prebuild-install` will install prebuilt binaries from GitHub if they exist and fallback to a compile step if they don't.

If you don't want to use the `prebuild` for the platform you are installing on, specify the `--build-from-source` flag when you install.

For building from source you need the following requirements:

- Windows:
- Visual Studio 2010 Express or higher e.g [Visual Studio 2015 Express](https://www.visualstudio.com/de/vs/visual-studio-express/)
Expand Down
12 changes: 3 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# http://www.appveyor.com/docs/appveyor-yml

environment:
# Test against these versions of Node.js and io.js
# Test against these versions of Node.js
matrix:
# node.js
- nodejs_version: "8"
Expand All @@ -12,7 +12,6 @@ environment:
# node.js
- nodejs_version: "0.12"
- nodejs_version: "0.10"
- nodejs_version: "0.8"

# Build on both platforms
platform:
Expand All @@ -22,13 +21,8 @@ platform:
# Install scripts. (runs after repo cloning)
install:
# Get the latest version of $env:nodejs_version
- ps: >-
If($env:nodejs_version -eq "0.8") {
Install-Product node $env:nodejs_version $env:platform
} Else {
Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
}
# Install latest NPM@2 for node.js 0.8, 0.10 and 0.12 because built in npm(node-gyp) does not know VS2015
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
# Install latest NPM@2 for node.js 0.10 and 0.12 because built in npm(node-gyp) does not know VS2015
# Update NPM for the rest
- IF %nodejs_version:~0,2% EQU 0. npm -g install npm@2 2>&1>nul
- IF %nodejs_version:~0,2% NEQ 0. npm -g install npm 2>&1>nul
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@
"name": "Mathias Küsel"
},
"engines": {
"node": ">=0.8.0"
"node": ">=0.10.0"
},
"license": "MIT",
"readmeFilename": "README.md",
"dependencies": {
"nan": "~2.6.2",
"bindings": "~1.2.1"
"bindings": "~1.2.1",
"prebuild-install": "^2.2.0"
},
"devDependencies": {
"prebuild": "^6.2.0",
"prebuild-ci": "^2.2.3"
},
"scripts": {
"install": "prebuild-install || node-gyp rebuild",
"test": "prebuild-ci"
}
}

0 comments on commit 9ba4a42

Please sign in to comment.