Skip to content

Commit

Permalink
Merge pull request #1 from Susheer/napi-compatibility
Browse files Browse the repository at this point in the history
Napi compatibility
  • Loading branch information
Susheer authored Nov 11, 2024
2 parents 544f09b + 2cb73ba commit 7dadbf2
Show file tree
Hide file tree
Showing 39 changed files with 3,328 additions and 9,753 deletions.
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
*~
.settings
.c9*
prebuilds/
prebuilds/
# Exclude the build directory
build/
22 changes: 22 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}\\src\\"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22621.0",
"compilerPath": "cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
73 changes: 73 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"files.associations": {
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"exception": "cpp",
"format": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"queue": "cpp",
"ranges": "cpp",
"ratio": "cpp",
"set": "cpp",
"span": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
36 changes: 0 additions & 36 deletions ChangeLog

This file was deleted.

93 changes: 49 additions & 44 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,75 +1,80 @@
module.exports = function(grunt) {
grunt.initConfig({
gyp: {
ia32: {
command: 'rebuild',
options: {
arch: 'ia32'
}
shell: {
'node-pre-gyp-ia32': {
command: 'node-pre-gyp configure build package --target_arch=ia32'
},
x64: {
command: 'rebuild',
options: {
arch: 'x64'
}
}
},
"nw-gyp": {
ia32: {
command: 'rebuild',
options: {
arch: 'ia32'
}
'node-pre-gyp-x64': {
command: 'node-pre-gyp configure build package --target_arch=x64'
},
x64: {
command: 'rebuild',
options: {
arch: 'x64'
}
'node-gyp-ia32': {
command: 'node-gyp rebuild --arch=ia32'
},
'node-gyp-x64': {
command: 'node-gyp rebuild --arch=x64'
},
'upload-binaries': {
command: 'node-pre-gyp-github publish'
}
},
copy: {
ia32: {
files: [{src: 'build/Release/node_printer.node', dest: 'lib/node_printer_' + process.platform + '_ia32.node'}]
files: [
{src: 'build/Release/electron_printer.node', dest: 'lib/electron_printer_' + process.platform + '_ia32.node'},
{src: 'binding.js', dest: 'lib/binding.js'},
{src: 'index.js', dest: 'lib/index.js'}
]
},
x64: {
files: [{src: 'build/Release/node_printer.node', dest: 'lib/node_printer_' + process.platform + '_x64.node'}]
files: [
{src: 'build/Release/electron_printer.node', dest: 'lib/electron_printer_' + process.platform + '_x64.node'},
{src: 'binding.js', dest: 'lib/binding.js'},
{src: 'index.js', dest: 'lib/index.js'}
]
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-node-gyp');
grunt.loadNpmTasks('grunt-nw-gyp');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('build-nw-ia32', [
'nw-gyp:ia32',
'copy:ia32'
grunt.registerTask('build-pre-ia32', [
'shell:node-pre-gyp-ia32',
'copy:ia32'
]);

grunt.registerTask('build-ia32', [
'gyp:ia32',
'copy:ia32'
'shell:node-gyp-ia32',
'copy:ia32'
]);

grunt.registerTask('build-x64', [
'gyp:x64',
'copy:x64'
'shell:node-gyp-x64',
'copy:x64'
]);

grunt.registerTask('build-nw-x64', [
'nw-gyp:x64',
'copy:x64'
grunt.registerTask('build-pre-x64', [
'shell:node-pre-gyp-x64',
'copy:x64'
]);

grunt.registerTask('build', [
'build-ia32',
'build-x64'
'build-ia32',
'build-x64'
]);

grunt.registerTask('build-pre', [
'build-pre-ia32',
'build-pre-x64'
]);

grunt.registerTask('upload', [
'shell:upload-binaries'
]);

grunt.registerTask('build-nw', [
'build-nw-ia32',
'build-nw-x64'
grunt.registerTask('release', [
'build-pre',
'upload'
]);
}
};
Loading

0 comments on commit 7dadbf2

Please sign in to comment.