Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making it compile and run for node 12+ and electron 6+ #261

Merged
merged 3 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 32 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
env:
matrix:
- export NODE_VERSION="6.9"
- export NODE_VERSION="5.9"
- export NODE_VERSION="4.4"
- export NODE_VERSION="0.10"
- export NODE_VERSION="0.10.48"
- export NODE_VERSION="0.12.18"
- export NODE_VERSION="4.9.1"
- export NODE_VERSION="5.9.1"
- export NODE_VERSION="6.17.1"
- export NODE_VERSION="8.16.1"
- export NODE_VERSION="10.16.0"
- export NODE_VERSION="11.15.0"
- export NODE_VERSION="12.10.0"
matrix:
fast_finish: true
allow_failures:
- env: NODE_VERSION="0.10"
- env: NODE_VERSION="iojs"
- env: export NODE_VERSION="0.10.48"
- env: export NODE_VERSION="0.12.18"

before_script:
- git config --global user.name "Ion Lupascu"
- git config --global user.email ionlupascu@gmail.com

before_install:
- git clone https://github.com/creationix/nvm.git ./.nvm
- source ./.nvm/nvm.sh
- nvm install $NODE_VERSION 64
- echo $NODE_VERSION
- nvm use $NODE_VERSION
- nvm install 12 64
- nvm use 12
- npm -v
- node -v
- if [ $TRAVIS_OS_NAME == "linux" ]; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
sudo apt-get -qq update;
Expand All @@ -23,34 +34,29 @@ before_install:
sudo apt-get install -qq debhelper autotools-dev cups-ppdc libcups2-dev cups imagemagick ghostscript;
fi
- "export JOBS=4"
- npm install -g node-gyp
- npm install -g node-gyp node-pre-gyp
- BUILD_ONLY=true npm install --build-from-source
before_script:
- git config --global user.name "Ion Lupascu"
- git config --global user.email ionlupascu@gmail.com

after_script:
- node-pre-gyp configure
- node-pre-gyp build package

- node-pre-gyp configure
- node-pre-gyp build package --target_arch=ia32
- npm test
script:
- node-pre-gyp configure --target=$NODE_VERSION
- node-pre-gyp build package --target=$NODE_VERSION --target_arch=x64
- node-pre-gyp configure --target=$NODE_VERSION
- node-pre-gyp build package --target=$NODE_VERSION --target_arch=ia32

# Need S3 Upload for Artifacts
# addons:
# artifacts:
# debug: true
# paths:
# - ./build/stage/**/*.tar.gz
addons:
artifacts:
debug: true
paths:
- ./build/stage/**/*.tar.gz

git:
depth: 1

branches:
only:
- master

os:
- linux
- osx
script: npm test
38 changes: 22 additions & 16 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ version: "{build}"

platform: x64

image: Visual Studio 2015
image: Visual Studio 2017

# Set a known clone folder
clone_folder: c:\projects\node-printer
clone_folder: c:\p

# fix lineendings in Windows
init:
Expand All @@ -20,35 +20,41 @@ init:
environment:
matrix:
# Node.js
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4.4"
- nodejs_version: "5.8"
- nodejs_version: "6.9"
- nodejs_version: "0.10.48"
- nodejs_version: "0.12.18"
- nodejs_version: "4.9.1"
- nodejs_version: "5.9.1"
- nodejs_version: "6.17.1"
- nodejs_version: "8.16.1"
- nodejs_version: "10.16.0"
- nodejs_version: "11.15.0"
- nodejs_version: "12.10.0"
build_electron: "true"

matrix:
fast_finish: true
allow_failures:
- nodejs_version: "0.10"
- nodejs_version: "0.10.48"
- nodejs_version: "0.12.18"

# Get the latest stable version of Node 0.STABLE.latest
install:
- ps: Install-Product node $env:nodejs_version x64
- ps: Install-Product node 12.6 x64
- cmd: SET PATH=c:\python27;%PATH%
- cmd: SET JOBS=4
- cmd: SET BUILD_ONLY=true
- npm install -g node-gyp node-pre-gyp
- npm install --build-from-source --msvs_version=2013
- cmd: npm install node-gyp node-pre-gyp
- cmd: echo 'Building for node version '
- cmd: echo %nodejs_version%
- cmd: node_modules\.bin\node-pre-gyp.cmd configure --target=%nodejs_version%
- cmd: node_modules\.bin\node-pre-gyp.cmd build package --target=%nodejs_version% --target_arch=x64
- cmd: node_modules\.bin\node-pre-gyp.cmd configure --target=%nodejs_version%
- cmd: node_modules\.bin\node-pre-gyp.cmd build package --target=%nodejs_version% --target_arch=ia32
- ps: ./tools/buildWindows.ps1

test_script:
- node --version
- npm --version
- npm test

after_test:
- node-gyp clean
- ps: ./tools/buildWindows.ps1

build: off

Expand Down
20 changes: 13 additions & 7 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
'variables': {
'module_name%': 'node_printer',
'module_path%': './lib/'
"variables": {
"module_name%": "node_printer",
"module_path%": "lib"
},
'targets': [
{
Expand All @@ -22,6 +22,12 @@
# sources
'<!@(["python", "tools/getSourceFiles.py", "src", "cc"])'
],
'include_dirs' : [
"<!(node -e \"require('nan')\")"
],
'cflags_cc+': [
"-Wno-deprecated-declarations"
],
'conditions': [
# common exclusions
['OS!="linux"', {'sources/': [['exclude', '_linux\\.cc$']]}],
Expand All @@ -45,10 +51,10 @@
#'-lcups -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lz -lpthread -lm -lcrypt -lz'
],
'link_settings': {
'libraries': [
'<!(cups-config --libs)'
]
}
'libraries': [
'<!(cups-config --libs)'
]
}
}]
]
}
Expand Down
Loading