cpp.js 1.0.0-beta.7 → 1.0.1
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/CHANGELOG.md +19 -0
- package/LICENSE +1 -1
- package/README.md +9 -26
- package/package.json +23 -23
- package/src/{functions/buildJS.js → actions/buildJs.js} +7 -6
- package/src/actions/buildWasm.js +68 -0
- package/src/actions/createInterface.js +128 -0
- package/src/actions/createLib.js +104 -0
- package/src/actions/createXCFramework.js +44 -0
- package/src/actions/getAllBridges.js +8 -0
- package/src/actions/getCmakeParameters.js +56 -0
- package/src/actions/getData.js +28 -0
- package/src/actions/getDependLibs.js +19 -0
- package/src/{functions → actions}/run.js +118 -64
- package/src/assets/CMakeLists.txt +14 -10
- package/src/assets/commonBridges.cpp +16 -0
- package/src/assets/dist.cmake +1 -1
- package/src/assets/ios.toolchain.cmake +4 -4
- package/src/bin.js +255 -96
- package/src/index.js +13 -63
- package/src/integration/getCppJsScript.js +91 -0
- package/src/integration/getDependFilePath.js +37 -0
- package/src/state/calculateDependencyParameters.js +64 -0
- package/src/state/index.js +81 -0
- package/src/state/loadConfig.js +104 -0
- package/src/utils/downloadAndExtractFile.js +36 -0
- package/src/utils/findFiles.js +5 -0
- package/src/utils/fixPackageName.js +7 -0
- package/src/utils/getAbsolutePath.js +14 -0
- package/src/utils/getCMakeListsFilePath.js +17 -0
- package/src/utils/getOsUserAndGroupId.js +1 -1
- package/src/utils/getParentPath.js +12 -0
- package/src/utils/hash.js +20 -0
- package/src/utils/loadJs.js +32 -0
- package/src/utils/loadJson.js +16 -0
- package/src/utils/pullDockerImage.js +2 -2
- package/src/utils/systemKeys.js +18 -0
- package/src/utils/writeJson.js +9 -0
- package/.mocharc.yaml +0 -3
- package/src/functions/createBridge.js +0 -37
- package/src/functions/createLib.js +0 -44
- package/src/functions/createWasm.js +0 -67
- package/src/functions/findOrCreateInterfaceFile.js +0 -68
- package/src/functions/finishBuild.js +0 -43
- package/src/functions/getCmakeParams.js +0 -106
- package/src/functions/getData.js +0 -36
- package/src/functions/getLibs.js +0 -33
- package/src/functions/specs/createBridge.spec.js +0 -51
- package/src/functions/specs/findOrCreateInterfaceFile.spec.js +0 -49
- package/src/utils/createTempDir.js +0 -15
- package/src/utils/findCMakeListsFile.js +0 -16
- package/src/utils/getBaseInfo.js +0 -15
- package/src/utils/getCliPath.js +0 -12
- package/src/utils/getConfig.js +0 -170
- package/src/utils/getDirName.js +0 -8
- package/src/utils/getPathInfo.js +0 -10
- package/src/utils/specs/findCMakeListsFile.spec.js +0 -34
- package/src/utils/specs/utils.spec.js +0 -81
- package/test/data/sample.cpp +0 -1
- package/test/data/sample.h +0 -10
- package/test/data/sample.i +0 -12
- package/test/data/sample2.ei +0 -12
- package/test/data/sample2.h +0 -10
- /package/{test/data/sample2.cpp → src/assets/cppjsEmptySource.cpp} +0 -0
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { assert } from 'chai';
|
|
2
|
-
import { getBaseInfo, getPathInfo } from './utils.js';
|
|
3
|
-
|
|
4
|
-
describe('getBaseInfo', function () {
|
|
5
|
-
it('empty', async function () {
|
|
6
|
-
const baseInfo = getBaseInfo('');
|
|
7
|
-
assert.equal(baseInfo.withSlash, '/');
|
|
8
|
-
assert.equal(baseInfo.withoutSlash, '/');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('null', async function () {
|
|
12
|
-
const baseInfo = getBaseInfo(null);
|
|
13
|
-
assert.equal(baseInfo.withSlash, '/');
|
|
14
|
-
assert.equal(baseInfo.withoutSlash, '/');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('undefined', async function () {
|
|
18
|
-
const baseInfo = getBaseInfo();
|
|
19
|
-
assert.equal(baseInfo.withSlash, '/');
|
|
20
|
-
assert.equal(baseInfo.withoutSlash, '/');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('/', async function () {
|
|
24
|
-
const baseInfo = getBaseInfo('/');
|
|
25
|
-
assert.equal(baseInfo.withSlash, '/');
|
|
26
|
-
assert.equal(baseInfo.withoutSlash, '/');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('with /', async function () {
|
|
30
|
-
const baseInfo = getBaseInfo('/home/cppjs/');
|
|
31
|
-
assert.equal(baseInfo.withSlash, '/home/cppjs/');
|
|
32
|
-
assert.equal(baseInfo.withoutSlash, '/home/cppjs');
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('without /', async function () {
|
|
36
|
-
const baseInfo = getBaseInfo('/home/cppjs');
|
|
37
|
-
assert.equal(baseInfo.withSlash, '/home/cppjs/');
|
|
38
|
-
assert.equal(baseInfo.withoutSlash, '/home/cppjs');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('getPathInfo', function () {
|
|
43
|
-
it('path: absolute', async function () {
|
|
44
|
-
const path = '/home/cppjs/cppjs.h';
|
|
45
|
-
const pathInfo = getPathInfo(path);
|
|
46
|
-
assert.equal(pathInfo.relative, path);
|
|
47
|
-
assert.equal(pathInfo.absolute, path);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('path: absolute, base: /', async function () {
|
|
51
|
-
const basePath = '/home/cppjs/';
|
|
52
|
-
const path = '/home/cppjs/cppjs.h';
|
|
53
|
-
const pathInfo = getPathInfo(path, basePath);
|
|
54
|
-
assert.equal(pathInfo.relative, 'cppjs.h');
|
|
55
|
-
assert.equal(pathInfo.absolute, path);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('path: absolute, base', async function () {
|
|
59
|
-
const basePath = '/home/cppjs';
|
|
60
|
-
const path = '/home/cppjs/cppjs.h';
|
|
61
|
-
const pathInfo = getPathInfo(path, basePath);
|
|
62
|
-
assert.equal(pathInfo.relative, 'cppjs.h');
|
|
63
|
-
assert.equal(pathInfo.absolute, path);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('path: relative, base: /', async function () {
|
|
67
|
-
const basePath = '/home/cppjs/';
|
|
68
|
-
const path = 'cppjs.h';
|
|
69
|
-
const pathInfo = getPathInfo(path, basePath);
|
|
70
|
-
assert.equal(pathInfo.relative, 'cppjs.h');
|
|
71
|
-
assert.equal(pathInfo.absolute, basePath + path);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('path: relative, base: ', async function () {
|
|
75
|
-
const basePath = '/home/cppjs';
|
|
76
|
-
const path = 'cppjs.h';
|
|
77
|
-
const pathInfo = getPathInfo(path, basePath);
|
|
78
|
-
assert.equal(pathInfo.relative, 'cppjs.h');
|
|
79
|
-
assert.equal(pathInfo.absolute, basePath + '/' + path);
|
|
80
|
-
});
|
|
81
|
-
});
|
package/test/data/sample.cpp
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#include "sample.h"
|
package/test/data/sample.h
DELETED
package/test/data/sample.i
DELETED
package/test/data/sample2.ei
DELETED
package/test/data/sample2.h
DELETED
|
File without changes
|