mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
npm: start generating the collateral needed to publish sources to npm
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
40a695a87f
commit
64b4f040dc
48
doxy/README.npm.md
Normal file
48
doxy/README.npm.md
Normal file
@ -0,0 +1,48 @@
|
||||
UPM (Useful Packages & Modules) Sensor/Actuator repository for MRAA
|
||||
==============
|
||||
|
||||
The UPM repository provides software drivers for a wide variety of commonly
|
||||
used sensors and actuators. These software drivers interact with the underlying
|
||||
hardware platform (or microcontroller), as well as with the attached sensors,
|
||||
through calls to [MRAA](https://github.com/intel-iot-devkit/mraa) APIs.
|
||||
|
||||
These bindings are precompiled with Node.js 4.4.
|
||||
|
||||
### Installing
|
||||
To install a UPM module using npm simply type:
|
||||
|
||||
`npm install jsupm_<module-name>`
|
||||
|
||||
### Supported Sensors
|
||||
The full list is available on [Intel® IoT Developer Zone](https://software.intel.com/iot/sensors).
|
||||
|
||||
### IDE Integration
|
||||
Intel® XDK IoT Edition is the recommended IDE for Node.js development. Visit
|
||||
the Intel® Developer Zone [IDE page](https://software.intel.com/iot/software/ide)
|
||||
for more information on how to get started.
|
||||
|
||||

|
||||
|
||||
### Building UPM
|
||||
See building documentation [here](https://github.com/intel-iot-devkit/upm/blob/master/docs/building.md).
|
||||
|
||||
### Making your own UPM module
|
||||
Our porting [link](https://github.com/intel-iot-devkit/upm/blob/master/docs/porting.md)
|
||||
has more information on making new UPM modules. Also check out our main Github page as
|
||||
we do have some guidelines if you would like to contribute your modules to the library.
|
||||
|
||||
### API Documentation
|
||||
Our Node.js documentation pages are hosted [here](http://iotdk.intel.com/docs/master/upm/node/).
|
||||
For other supported languages and their APIs please visit our main Github page.
|
||||
|
||||
### API Compatibility
|
||||
Even if we try our best not to, every once in a while we are forced to modify
|
||||
our API in a way that will break backwards compatibility. If you find yourself
|
||||
unable to run code that was working fine before a library update, make sure
|
||||
you check the [API changes](https://github.com/intel-iot-devkit/upm/blob/master/docs/apichanges.md) section first.
|
||||
|
||||
### Changelog
|
||||
Version changelog [here](https://github.com/intel-iot-devkit/upm/blob/master/docs/changelog.md).
|
||||
|
||||
### Known Limitations
|
||||
List of known limitations [here](https://github.com/intel-iot-devkit/upm/blob/master/docs/knownlimitations.md).
|
@ -291,7 +291,24 @@ if (BUILDSWIGNODE)
|
||||
${NODE_ROOT_DIR}/include/deps/uv/include
|
||||
)
|
||||
macro(createpackagejson)
|
||||
#Create list of source files
|
||||
foreach (srcfile ${module_src})
|
||||
file (RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set (upm_LIB_SRCS_GYP "'${rel}/${srcfile}',\n${upm_LIB_SRCS_GYP}")
|
||||
endforeach (srcfile)
|
||||
file (RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
set (upm_LIB_SRCS_GYP "'${rel}/jsupm_${libname}JAVASCRIPT_wrap.cxx',\n${upm_LIB_SRCS_GYP}")
|
||||
#Create list of include directories
|
||||
foreach (includedir ${UPM_COMMON_HEADER_DIRS})
|
||||
file (RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${includedir})
|
||||
set (upm_LIB_INCLUDE_DIRS_GYP "'${rel}',\n${upm_LIB_INCLUDE_DIRS_GYP}")
|
||||
endforeach (includedir)
|
||||
file (RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set (upm_LIB_SRCS_GYP "'${rel}',\n${upm_LIB_SRCS_GYP}")
|
||||
|
||||
configure_file (${PROJECT_SOURCE_DIR}/src/package.json.in ${CMAKE_CURRENT_BINARY_DIR}/package.json @ONLY)
|
||||
configure_file (${PROJECT_SOURCE_DIR}/src/binding.gyp.in ${CMAKE_CURRENT_BINARY_DIR}/binding.gyp @ONLY)
|
||||
configure_file (${PROJECT_SOURCE_DIR}/doxy/README.npm.md ${CMAKE_CURRENT_BINARY_DIR}/README.md)
|
||||
# If a CMAKE_INSTALL_PREFIX has NOT been provided, set NODE_MODULE_INSTALL_PATH
|
||||
# base on the NODE_ROOT_DIR.
|
||||
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
25
src/binding.gyp.in
Normal file
25
src/binding.gyp.in
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'jsupm_@libname@',
|
||||
'sources': [
|
||||
@upm_LIB_SRCS_GYP@
|
||||
],
|
||||
'include_dirs': [
|
||||
@upm_LIB_INCLUDE_DIRS_GYP@
|
||||
],
|
||||
'variables': {
|
||||
"v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g' | cut -c 1-5)",
|
||||
"arch%": "<!(node -e 'console.log(process.arch)')"
|
||||
},
|
||||
'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
|
||||
'cflags!': [ '-fno-exceptions' ],
|
||||
'defines' : [
|
||||
'SWIG',
|
||||
'BUILDING_NODE_EXTENSION=1',
|
||||
'SWIG_V8_VERSION=0x0<(v8_version)',
|
||||
'V8_VERSION=0x0<(v8_version)'
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -9,13 +9,13 @@
|
||||
"url": "https://github.com/intel-iot-devkit/upm"
|
||||
},
|
||||
"engines" : {
|
||||
"node": ">= 4.4.x"
|
||||
"node": ">= 0.10.x"
|
||||
},
|
||||
"bugs": {
|
||||
"url" : "http://github.com/intel-iot-devkit/upm/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"mraa": ">=@MRAA_VERSION@"
|
||||
"mraa": ">=@MRAA_MINIMUM@"
|
||||
},
|
||||
"license": "MIT",
|
||||
"version" : "@upm_VERSION_STRING@",
|
||||
|
Loading…
x
Reference in New Issue
Block a user