rclnodejs 0.21.0 → 0.21.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/identify-ros-distro.yml +44 -0
- package/.github/workflows/linux-build-and-test-compatibility.yml +67 -0
- package/.github/workflows/linux-build-and-test.yml +51 -0
- package/.github/workflows/windows-build-and-test-compatibility.yml +52 -0
- package/.github/workflows/windows-build-and-test.yml +63 -0
- package/CONTRIBUTORS.md +6 -2
- package/README.md +5 -5
- package/binding.gyp +51 -4
- package/index.js +12 -4
- package/lib/action/client.js +6 -20
- package/lib/action/server.js +1 -1
- package/lib/action/uuid.js +28 -1
- package/lib/client.js +13 -10
- package/lib/distro.js +70 -0
- package/lib/interface_loader.js +1 -1
- package/lib/node.js +17 -10
- package/lib/parameter.js +14 -11
- package/package.json +4 -4
- package/scripts/npmjs-readme.md +5 -5
- package/scripts/ros_distro.js +19 -21
- package/src/rcl_bindings.cpp +7 -9
- package/types/action_server.d.ts +12 -8
- package/types/action_uuid.d.ts +58 -0
- package/types/base.d.ts +2 -0
- package/types/distro.d.ts +34 -0
- package/types/node.d.ts +7 -0
- package/.vscode/c_cpp_properties.json +0 -15
- package/scripts/compile_tests.js +0 -124
package/scripts/compile_tests.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2017 Intel Corporation. All rights reserved.
|
|
2
|
-
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
'use strict';
|
|
16
|
-
|
|
17
|
-
/* eslint-disable */
|
|
18
|
-
const fs = require('fs-extra');
|
|
19
|
-
const os = require('os');
|
|
20
|
-
const path = require('path');
|
|
21
|
-
const child = require('child_process');
|
|
22
|
-
|
|
23
|
-
var rootDir = path.dirname(__dirname);
|
|
24
|
-
var testCppDir = path.join(rootDir, 'test', 'cpp');
|
|
25
|
-
|
|
26
|
-
function getExecutable(input) {
|
|
27
|
-
if (os.platform() === 'win32') return input + '.exe';
|
|
28
|
-
|
|
29
|
-
return input;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var publisher = getExecutable('publisher_msg');
|
|
33
|
-
var subscription = getExecutable('subscription_msg');
|
|
34
|
-
var listener = getExecutable('listener');
|
|
35
|
-
var client = getExecutable('add_two_ints_client');
|
|
36
|
-
|
|
37
|
-
function getExecutablePath(input) {
|
|
38
|
-
var releaseDir = '';
|
|
39
|
-
if (os.platform() === 'win32') releaseDir = 'Release';
|
|
40
|
-
|
|
41
|
-
return path.join(rootDir, 'build', 'cpp_nodes', releaseDir, input);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
var publisherPath = getExecutablePath(publisher);
|
|
45
|
-
var subscriptionPath = getExecutablePath(subscription);
|
|
46
|
-
var listenerPath = getExecutablePath(listener);
|
|
47
|
-
var clientPath = getExecutablePath(client);
|
|
48
|
-
|
|
49
|
-
function copyFile(platform, srcFile, destFile) {
|
|
50
|
-
if (!fs.existsSync(destFile)) {
|
|
51
|
-
if (os.platform() === 'win32') {
|
|
52
|
-
child.spawn('cmd.exe', ['/c', `copy ${srcFile} ${destFile}`]);
|
|
53
|
-
} else {
|
|
54
|
-
child.spawn('sh', ['-c', `cp ${srcFile} ${destFile}`]);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function copyAll(fileList, dest) {
|
|
60
|
-
fileList.forEach((file) => {
|
|
61
|
-
copyFile(os.platform(), file, path.join(dest, path.basename(file)));
|
|
62
|
-
console.log(`cpp executables ${file} is copied to test/cpp.`);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function copyPkgToRos2(pkgName) {
|
|
67
|
-
let srcDir = path.join(rootDir, 'install', pkgName);
|
|
68
|
-
let destDir = process.env.COLCON_PREFIX_PATH;
|
|
69
|
-
if (os.platform() === 'win32') {
|
|
70
|
-
child.spawn('cmd.exe', ['/c', `xcopy ${srcDir} ${destDir} /O /X /E /K`]);
|
|
71
|
-
} else {
|
|
72
|
-
child.spawn('sh', ['-c ', '"' + `cp -fr ${srcDir}/. ${destDir}` + '"'], {
|
|
73
|
-
shell: true,
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
var subProcess = child.spawn('colcon', [
|
|
79
|
-
'build',
|
|
80
|
-
'--event-handlers',
|
|
81
|
-
'console_cohesion+',
|
|
82
|
-
'--base-paths',
|
|
83
|
-
path.join(rootDir, 'test', 'rclnodejs_test_msgs'),
|
|
84
|
-
]);
|
|
85
|
-
subProcess.on('close', (code) => {
|
|
86
|
-
copyPkgToRos2('rclnodejs_test_msgs');
|
|
87
|
-
});
|
|
88
|
-
subProcess.stdout.on('data', (data) => {
|
|
89
|
-
console.log(`${data}`);
|
|
90
|
-
});
|
|
91
|
-
subProcess.stderr.on('data', (data) => {
|
|
92
|
-
console.log(`${data}`);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
!fs.existsSync(publisherPath) &&
|
|
97
|
-
!fs.existsSync(subscriptionPath) &&
|
|
98
|
-
!fs.existsSync(listenerPath) &&
|
|
99
|
-
!fs.existsSync(clientPath)
|
|
100
|
-
) {
|
|
101
|
-
var compileProcess = child.spawn('colcon', [
|
|
102
|
-
'build',
|
|
103
|
-
'--base-paths',
|
|
104
|
-
testCppDir,
|
|
105
|
-
]);
|
|
106
|
-
compileProcess.on('close', (code) => {
|
|
107
|
-
copyAll(
|
|
108
|
-
[publisherPath, subscriptionPath, listenerPath, clientPath],
|
|
109
|
-
testCppDir
|
|
110
|
-
);
|
|
111
|
-
});
|
|
112
|
-
compileProcess.stdout.on('data', (data) => {
|
|
113
|
-
console.log(`${data}`);
|
|
114
|
-
});
|
|
115
|
-
compileProcess.stderr.on('data', (data) => {
|
|
116
|
-
console.log(`${data}`);
|
|
117
|
-
});
|
|
118
|
-
} else {
|
|
119
|
-
copyAll(
|
|
120
|
-
[publisherPath, subscriptionPath, , listenerPath, clientPath],
|
|
121
|
-
testCppDir
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
/* eslint-enable */
|