src: introduce process.release object
PR-URL: https://github.com/nodejs/io.js/pull/2154 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
2d9456e3e6
commit
04fd4fad46
20
Makefile
20
Makefile
@ -290,7 +290,11 @@ release-only:
|
|||||||
$(PKG): release-only
|
$(PKG): release-only
|
||||||
rm -rf $(PKGDIR)
|
rm -rf $(PKGDIR)
|
||||||
rm -rf out/deps out/Release
|
rm -rf out/deps out/Release
|
||||||
$(PYTHON) ./configure --dest-cpu=x64 --tag=$(TAG)
|
$(PYTHON) ./configure \
|
||||||
|
--dest-cpu=x64 \
|
||||||
|
--tag=$(TAG) \
|
||||||
|
--release-urlbase=$(RELEASE_URLBASE) \
|
||||||
|
$(CONFIG_FLAGS)
|
||||||
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
|
$(MAKE) install V=$(V) DESTDIR=$(PKGDIR)
|
||||||
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
|
SIGN="$(CODESIGN_CERT)" PKGDIR="$(PKGDIR)" bash tools/osx-codesign.sh
|
||||||
cat tools/osx-pkg.pmdoc/index.xml.tmpl \
|
cat tools/osx-pkg.pmdoc/index.xml.tmpl \
|
||||||
@ -346,7 +350,12 @@ doc-upload: tar
|
|||||||
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done"
|
ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done"
|
||||||
|
|
||||||
$(TARBALL)-headers: config.gypi release-only
|
$(TARBALL)-headers: config.gypi release-only
|
||||||
$(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
|
$(PYTHON) ./configure \
|
||||||
|
--prefix=/ \
|
||||||
|
--dest-cpu=$(DESTCPU) \
|
||||||
|
--tag=$(TAG) \
|
||||||
|
--release-urlbase=$(RELEASE_URLBASE) \
|
||||||
|
$(CONFIG_FLAGS)
|
||||||
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
|
HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/'
|
||||||
find $(TARNAME)/ -type l | xargs rm # annoying on windows
|
find $(TARNAME)/ -type l | xargs rm # annoying on windows
|
||||||
tar -cf $(TARNAME)-headers.tar $(TARNAME)
|
tar -cf $(TARNAME)-headers.tar $(TARNAME)
|
||||||
@ -371,7 +380,12 @@ endif
|
|||||||
$(BINARYTAR): release-only
|
$(BINARYTAR): release-only
|
||||||
rm -rf $(BINARYNAME)
|
rm -rf $(BINARYNAME)
|
||||||
rm -rf out/deps out/Release
|
rm -rf out/deps out/Release
|
||||||
$(PYTHON) ./configure --prefix=/ --dest-cpu=$(DESTCPU) --tag=$(TAG) $(CONFIG_FLAGS)
|
$(PYTHON) ./configure \
|
||||||
|
--prefix=/ \
|
||||||
|
--dest-cpu=$(DESTCPU) \
|
||||||
|
--tag=$(TAG) \
|
||||||
|
--release-urlbase=$(RELEASE_URLBASE) \
|
||||||
|
$(CONFIG_FLAGS)
|
||||||
$(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
|
$(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
|
||||||
cp README.md $(BINARYNAME)
|
cp README.md $(BINARYNAME)
|
||||||
cp LICENSE $(BINARYNAME)
|
cp LICENSE $(BINARYNAME)
|
||||||
|
9
configure
vendored
9
configure
vendored
@ -191,6 +191,13 @@ parser.add_option('--tag',
|
|||||||
dest='tag',
|
dest='tag',
|
||||||
help='custom build tag')
|
help='custom build tag')
|
||||||
|
|
||||||
|
parser.add_option('--release-urlbase',
|
||||||
|
action='store',
|
||||||
|
dest='release_urlbase',
|
||||||
|
help='Provide a custom URL prefix for the `process.release` properties '
|
||||||
|
'`sourceUrl` and `headersUrl`. When compiling a release build, this '
|
||||||
|
'will default to https://iojs.org/download/release/')
|
||||||
|
|
||||||
parser.add_option('--v8-options',
|
parser.add_option('--v8-options',
|
||||||
action='store',
|
action='store',
|
||||||
dest='v8_options',
|
dest='v8_options',
|
||||||
@ -675,6 +682,8 @@ def configure_node(o):
|
|||||||
else:
|
else:
|
||||||
o['variables']['node_tag'] = ''
|
o['variables']['node_tag'] = ''
|
||||||
|
|
||||||
|
o['variables']['node_release_urlbase'] = options.release_urlbase or ''
|
||||||
|
|
||||||
if options.v8_options:
|
if options.v8_options:
|
||||||
o['variables']['node_v8_options'] = options.v8_options.replace('"', '\\"')
|
o['variables']['node_v8_options'] = options.v8_options.replace('"', '\\"')
|
||||||
|
|
||||||
|
@ -672,6 +672,36 @@ An example of the possible output looks like:
|
|||||||
target_arch: 'x64',
|
target_arch: 'x64',
|
||||||
v8_use_snapshot: 'true' } }
|
v8_use_snapshot: 'true' } }
|
||||||
|
|
||||||
|
## process.release
|
||||||
|
|
||||||
|
An Object containing metadata related to the current release, including URLs
|
||||||
|
for the source tarball and headers-only tarball.
|
||||||
|
|
||||||
|
`process.release` contains the following properties:
|
||||||
|
|
||||||
|
* `name`: a string with a value that will always be `"io.js"` for io.js.
|
||||||
|
* `sourceUrl`: a complete URL pointing to a _.tar.gz_ file containing the
|
||||||
|
source of the current release.
|
||||||
|
* `headersUrl`: a complete URL pointing to a _.tar.gz_ file containing only
|
||||||
|
the header files for the current release. This file is significantly smaller
|
||||||
|
than the full source file and can be used for compiling add-ons against
|
||||||
|
io.js.
|
||||||
|
* `libUrl`: a complete URL pointing to an _iojs.lib_ file matching the
|
||||||
|
architecture and version of the current release. This file is used for
|
||||||
|
compiling add-ons against io.js. _This property is only present on Windows
|
||||||
|
builds of io.js and will be missing on all other platforms._
|
||||||
|
|
||||||
|
e.g.
|
||||||
|
|
||||||
|
{ name: 'io.js',
|
||||||
|
sourceUrl: 'https://iojs.org/download/release/v2.3.5/iojs-v2.3.5.tar.gz',
|
||||||
|
headersUrl: 'https://iojs.org/download/release/v2.3.5/iojs-v2.3.5-headers.tar.gz',
|
||||||
|
libUrl: 'https://iojs.org/download/release/v2.3.5/win-x64/iojs.lib' }
|
||||||
|
|
||||||
|
In custom builds from non-release versions of the source tree, only the
|
||||||
|
`name` property may be present. The additional properties should not be
|
||||||
|
relied upon to exist.
|
||||||
|
|
||||||
## process.kill(pid[, signal])
|
## process.kill(pid[, signal])
|
||||||
|
|
||||||
Send a signal to a process. `pid` is the process id and `signal` is the
|
Send a signal to a process. `pid` is the process id and `signal` is the
|
||||||
|
5
node.gyp
5
node.gyp
@ -194,6 +194,11 @@
|
|||||||
'src/node_main.cc',
|
'src/node_main.cc',
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
[ 'node_release_urlbase!=""', {
|
||||||
|
'defines': [
|
||||||
|
'NODE_RELEASE_URLBASE="<(node_release_urlbase)"',
|
||||||
|
]
|
||||||
|
}],
|
||||||
[ 'v8_enable_i18n_support==1', {
|
[ 'v8_enable_i18n_support==1', {
|
||||||
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
|
'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
|
33
src/node.cc
33
src/node.cc
@ -2760,6 +2760,39 @@ void SetupProcessObject(Environment* env,
|
|||||||
"platform",
|
"platform",
|
||||||
OneByteString(env->isolate(), NODE_PLATFORM));
|
OneByteString(env->isolate(), NODE_PLATFORM));
|
||||||
|
|
||||||
|
// process.release
|
||||||
|
Local<Object> release = Object::New(env->isolate());
|
||||||
|
READONLY_PROPERTY(process, "release", release);
|
||||||
|
READONLY_PROPERTY(release, "name", OneByteString(env->isolate(), "io.js"));
|
||||||
|
|
||||||
|
// if this is a release build and no explicit base has been set
|
||||||
|
// substitute the standard release download URL
|
||||||
|
#ifndef NODE_RELEASE_URLBASE
|
||||||
|
# if NODE_VERSION_IS_RELEASE
|
||||||
|
# define NODE_RELEASE_URLBASE "https://iojs.org/download/release/"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(NODE_RELEASE_URLBASE)
|
||||||
|
# define _RELEASE_URLPFX NODE_RELEASE_URLBASE "v" NODE_VERSION_STRING "/"
|
||||||
|
# define _RELEASE_URLFPFX _RELEASE_URLPFX "iojs-v" NODE_VERSION_STRING
|
||||||
|
|
||||||
|
READONLY_PROPERTY(release,
|
||||||
|
"sourceUrl",
|
||||||
|
OneByteString(env->isolate(),
|
||||||
|
_RELEASE_URLFPFX ".tar.gz"));
|
||||||
|
READONLY_PROPERTY(release,
|
||||||
|
"headersUrl",
|
||||||
|
OneByteString(env->isolate(),
|
||||||
|
_RELEASE_URLFPFX "-headers.tar.gz"));
|
||||||
|
# ifdef _WIN32
|
||||||
|
READONLY_PROPERTY(release,
|
||||||
|
"libUrl",
|
||||||
|
OneByteString(env->isolate(),
|
||||||
|
_RELEASE_URLPFX "win-" NODE_ARCH "/iojs.lib"));
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// process.argv
|
// process.argv
|
||||||
Local<Array> arguments = Array::New(env->isolate(), argc);
|
Local<Array> arguments = Array::New(env->isolate(), argc);
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
|
@ -35,6 +35,7 @@ set noperfctr_arg=
|
|||||||
set noperfctr_msi_arg=
|
set noperfctr_msi_arg=
|
||||||
set i18n_arg=
|
set i18n_arg=
|
||||||
set download_arg=
|
set download_arg=
|
||||||
|
set release_urls_arg=
|
||||||
|
|
||||||
:next-arg
|
:next-arg
|
||||||
if "%1"=="" goto args-done
|
if "%1"=="" goto args-done
|
||||||
@ -79,6 +80,7 @@ if "%config%"=="Debug" set debug_arg=--debug
|
|||||||
if defined nosnapshot set snapshot_arg=--without-snapshot
|
if defined nosnapshot set snapshot_arg=--without-snapshot
|
||||||
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
|
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
|
||||||
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
|
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
|
||||||
|
if defined RELEASE_URLBASE set release_urlbase_arg=--release-urlbase=%RELEASE_URLBASE%
|
||||||
|
|
||||||
if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
|
if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
|
||||||
if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
|
if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
|
||||||
|
Loading…
x
Reference in New Issue
Block a user