From 9ba4a42fcb1fe17080aa53a573c05d934f79f025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20K=C3=BCsel?= Date: Fri, 7 Jul 2017 23:55:04 +0200 Subject: [PATCH] Add prebuild feature (#30) * add prebuild feature --- .travis.yml | 4 ++-- README.md | 16 ++++++++++------ appveyor.yml | 12 +++--------- package.json | 13 +++++++++++-- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2cfa0f7..19f3a33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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: diff --git a/README.md b/README.md index 87eae92..9db0636 100644 --- a/README.md +++ b/README.md @@ -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)). @@ -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/) diff --git a/appveyor.yml b/appveyor.yml index a9458ca..076c0df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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" @@ -12,7 +12,6 @@ environment: # node.js - nodejs_version: "0.12" - nodejs_version: "0.10" - - nodejs_version: "0.8" # Build on both platforms platform: @@ -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 diff --git a/package.json b/package.json index e48e62e..b265bed 100644 --- a/package.json +++ b/package.json @@ -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" } }