diff --git a/README.md b/README.md index 65cddb82d..fa4dba80c 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,20 @@ > Lets you build your [NW.js](https://github.com/nwjs/nw.js) apps for mac, win and linux via cli. It will download the prebuilt binaries for a newest version, unpacks it, creates a release folder, create the app.nw file for a specified directory and copies the app.nw file where it belongs. +This is a self-maintained repo of `nw-builder` which temporarily fixs support for 0.13.x normal/SDK/NaCl versions. + +This repo is deprecated now as I reimplement a [evshiron/nwjs-builder](https://github.com/evshiron/nwjs-builder), which should be a successor to `evshiron/nw-builder`. If you are a new user please move forward to `nwjs-builder`. This repo should still work with nw.js 0.13.x/0.14.x and node.js pre 6.x, but will not have any updates. ### Installation ##### Local ```shell -npm install nw-builder --save-dev +npm install evshiron/nw-builder --save-dev ``` ##### Global ```shell -npm install nw-builder -g +npm install evshiron/nw-builder -g ``` ##### Grunt and Gulp Plugins @@ -46,7 +49,7 @@ var NwBuilder = require('nw-builder'); var nw = new NwBuilder({ files: './path/to/nwfiles/**/**', // use the glob format platforms: ['osx32', 'osx64', 'win32', 'win64'], - version: '0.12.3' + version: '0.13.0-rc3-sdk' }); //Log stuff you want diff --git a/lib/index.js b/lib/index.js index 784a907d4..369b90ace 100644 --- a/lib/index.js +++ b/lib/index.js @@ -227,6 +227,16 @@ NwBuilder.prototype.downloadNodeWebkit = function () { platform.cache = path.resolve(self.options.cacheDir, self._version.version, name); platform.url = url.resolve(self.options.downloadUrl, self._version.platforms[name]); + // Fix platform.url for SDK/NaCl versions. + if(self._version.version.indexOf('-sdk') > 0) { + var version = self._version.version.split('-sdk').shift(); + platform.url = platform.url.replace(version + '-sdk', version).replace('v' + version + '-sdk', 'sdk-v' + version); + } + else if(self._version.version.indexOf('-nacl') > 0) { + var version = self._version.version.split('-nacl').shift(); + platform.url = platform.url.replace(version + '-nacl', version).replace('v' + version + '-nacl', 'nacl-v' + version); + } + // Ensure that there is a cache folder if(self.options.forceDownload) { fs.removeSync(platform.cache); @@ -240,7 +250,7 @@ NwBuilder.prototype.downloadNodeWebkit = function () { Downloader.downloadAndUnpack(platform.cache, platform.url) .catch(function(err){ if(err.statusCode === 404){ - self.emit('log', 'ERROR: The version '+self._version.version+' does not have a corresponding build posted at ' + self.options.downloadUrl + '. Please choose a version from that list.'); + self.emit('log', 'ERROR: The version '+self._version.version+' for platform '+name+' does not have a corresponding build posted at ' + self.options.downloadUrl + '. Please choose a version from that list.'); } else { self.emit('log', err.msg); } diff --git a/lib/platforms.js b/lib/platforms.js index d34c319f8..b59c784b9 100644 --- a/lib/platforms.js +++ b/lib/platforms.js @@ -8,7 +8,8 @@ module.exports = { '<=0.9.2': ['nw.exe', 'ffmpegsumo.dll', 'icudt.dll', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak'], '>0.9.2 <0.12.0': ['nw.exe', 'ffmpegsumo.dll', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak', 'locales'], '>=0.12.0 <0.13.0-beta.1': ['nw.exe', 'ffmpegsumo.dll', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak', 'locales', 'd3dcompiler_47.dll', 'pdf.dll'], - '>=0.13.0-beta.1': ['nw.exe', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'ffmpeg.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'] + '>=0.13.0-beta.1 <0.14.1-beta.1': ['nw.exe', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'ffmpeg.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'], + '>=0.14.1-beta.1': ['nw.exe', 'icudtl.dat', 'libexif.dll', 'libEGL.dll', 'libGLESv2.dll', 'ffmpeg.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'] }, versionNameTemplate: 'v${ version }/${ name }-v${ version }-win-ia32.zip' }, @@ -19,7 +20,8 @@ module.exports = { '<=0.9.2': ['nw.exe', 'ffmpegsumo.dll', 'icudt.dll', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak', 'locales'], '>0.9.2 <0.12.0': ['nw.exe', 'ffmpegsumo.dll', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak', 'locales'], '>=0.12.0 <0.13.0-beta.1': ['nw.exe', 'ffmpegsumo.dll', 'icudtl.dat', 'libEGL.dll', 'libGLESv2.dll', 'nw.pak', 'locales', 'd3dcompiler_47.dll', 'pdf.dll'], - '>=0.13.0-beta.1': ['nw.exe', 'icudtl.dat', 'libEGL.dll', 'ffmpeg.dll', 'libGLESv2.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'] + '>=0.13.0-beta.1 <0.14.1-beta.1': ['nw.exe', 'icudtl.dat', 'libEGL.dll', 'ffmpeg.dll', 'libGLESv2.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'], + '>=0.14.1-beta.1': ['nw.exe', 'icudtl.dat', 'libexif.dll', 'libEGL.dll', 'libGLESv2.dll', 'ffmpeg.dll', 'locales', 'd3dcompiler_47.dll', 'dbghelp.dll','natives_blob.bin','node.dll','nw.dll','nw_100_percent.pak','nw_200_percent.pak','nw_elf.dll','resources.pak','snapshot_blob.bin'] }, versionNameTemplate: 'v${ version }/${ name }-v${ version }-win-x64.zip' },