Skip to content

Commit 9ba4a42

Browse files
authored
Add prebuild feature (mathiask88#30)
* add prebuild feature
1 parent 2949d40 commit 9ba4a42

4 files changed

Lines changed: 26 additions & 19 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ env:
99
- TRAVIS_NODE_VERSION="6"
1010
- TRAVIS_NODE_VERSION="5"
1111
- TRAVIS_NODE_VERSION="4"
12-
- TRAVIS_NODE_VERSION="3"
1312
- TRAVIS_NODE_VERSION="0.12"
1413
- TRAVIS_NODE_VERSION="0.10"
15-
- TRAVIS_NODE_VERSION="0.8"
1614

1715
addons:
1816
apt:
@@ -29,6 +27,8 @@ install:
2927
- 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
3028
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then export CXX=g++-4.8; fi
3129
- $CXX --version
30+
- node --version
31+
- npm --version
3232
- npm install
3333

3434
script:

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
[![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/)
44

5-
**Current node-snap7 version:** 0.3.1
6-
**Current snap7 version:** 1.4.2
7-
8-
**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)
5+
[![Build Status](https://travis-ci.org/mathiask88/node-snap7.svg?branch=master)](https://travis-ci.org/mathiask88/node-snap7)
6+
[![Build status](https://ci.appveyor.com/api/projects/status/ca1kepectsn3wkrc/branch/master?svg=true)](https://ci.appveyor.com/project/mathiask88/node-snap7/branch/master)
7+
[![dependencies Status](https://david-dm.org/mathiask88/node-snap7/status.svg)](https://david-dm.org/mathiask88/node-snap7)
98

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

1212
## About
1313
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)).
@@ -17,7 +17,11 @@ Install with:
1717

1818
npm install node-snap7
1919

20-
Requirements:
20+
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.
21+
22+
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.
23+
24+
For building from source you need the following requirements:
2125

2226
- Windows:
2327
- Visual Studio 2010 Express or higher e.g [Visual Studio 2015 Express](https://www.visualstudio.com/de/vs/visual-studio-express/)

appveyor.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# http://www.appveyor.com/docs/appveyor-yml
22

33
environment:
4-
# Test against these versions of Node.js and io.js
4+
# Test against these versions of Node.js
55
matrix:
66
# node.js
77
- nodejs_version: "8"
@@ -12,7 +12,6 @@ environment:
1212
# node.js
1313
- nodejs_version: "0.12"
1414
- nodejs_version: "0.10"
15-
- nodejs_version: "0.8"
1615

1716
# Build on both platforms
1817
platform:
@@ -22,13 +21,8 @@ platform:
2221
# Install scripts. (runs after repo cloning)
2322
install:
2423
# Get the latest version of $env:nodejs_version
25-
- ps: >-
26-
If($env:nodejs_version -eq "0.8") {
27-
Install-Product node $env:nodejs_version $env:platform
28-
} Else {
29-
Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
30-
}
31-
# Install latest NPM@2 for node.js 0.8, 0.10 and 0.12 because built in npm(node-gyp) does not know VS2015
24+
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:platform
25+
# Install latest NPM@2 for node.js 0.10 and 0.12 because built in npm(node-gyp) does not know VS2015
3226
# Update NPM for the rest
3327
- IF %nodejs_version:~0,2% EQU 0. npm -g install npm@2 2>&1>nul
3428
- IF %nodejs_version:~0,2% NEQ 0. npm -g install npm 2>&1>nul

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@
1313
"name": "Mathias Küsel"
1414
},
1515
"engines": {
16-
"node": ">=0.8.0"
16+
"node": ">=0.10.0"
1717
},
1818
"license": "MIT",
1919
"readmeFilename": "README.md",
2020
"dependencies": {
2121
"nan": "~2.6.2",
22-
"bindings": "~1.2.1"
22+
"bindings": "~1.2.1",
23+
"prebuild-install": "^2.2.0"
24+
},
25+
"devDependencies": {
26+
"prebuild": "^6.2.0",
27+
"prebuild-ci": "^2.2.3"
28+
},
29+
"scripts": {
30+
"install": "prebuild-install || node-gyp rebuild",
31+
"test": "prebuild-ci"
2332
}
2433
}

0 commit comments

Comments
 (0)