cpp.js 0.6.0 → 1.0.0-alpha.2
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/LICENSE +1 -1
- package/cpp.js-1.0.0-alpha.2.tgz +0 -0
- package/package.json +10 -3
- package/src/assets/CMakeLists.txt +28 -11
- package/src/assets/browser.js +161 -0
- package/src/assets/dist.cmake +36 -11
- package/src/assets/ios.toolchain.cmake +1145 -0
- package/src/assets/node.js +130 -0
- package/src/bin.js +102 -27
- package/src/functions/buildJS.js +63 -0
- package/src/functions/createBridge.js +16 -17
- package/src/functions/createLib.js +44 -0
- package/src/functions/createWasm.js +61 -158
- package/src/functions/findOrCreateInterfaceFile.js +29 -8
- package/src/functions/finishBuild.js +43 -0
- package/src/functions/getCmakeParams.js +106 -0
- package/src/functions/getData.js +37 -0
- package/src/functions/getLibs.js +33 -0
- package/src/functions/run.js +220 -0
- package/src/functions/specs/createBridge.spec.js +8 -9
- package/src/functions/specs/findOrCreateInterfaceFile.spec.js +12 -12
- package/src/index.js +41 -1
- package/src/utils/createTempDir.js +2 -2
- package/src/utils/findCMakeListsFile.js +3 -3
- package/src/utils/getCliPath.js +4 -5
- package/src/utils/getConfig.js +63 -32
- package/src/utils/getDirName.js +2 -2
- package/src/utils/getOsUserAndGroupId.js +1 -1
- package/src/utils/getPathInfo.js +0 -2
- package/src/utils/pullDockerImage.js +11 -6
- package/src/assets/extern-post.js +0 -14
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { execFileSync } from 'child_process';
|
|
2
2
|
|
|
3
|
+
let isDockerImageAvailable = false;
|
|
4
|
+
|
|
5
|
+
export function getDockerImage() {
|
|
6
|
+
return 'bugra9/cpp.js:0.2.6';
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
export default function pullDockerImage() {
|
|
4
|
-
|
|
10
|
+
if (isDockerImageAvailable) return;
|
|
11
|
+
|
|
12
|
+
const isImageExist = execFileSync('docker', ['images', '-q', getDockerImage()], { encoding: 'utf-8' }).trim() !== '';
|
|
5
13
|
|
|
6
14
|
if (!isImageExist) {
|
|
7
15
|
console.log('');
|
|
@@ -9,13 +17,10 @@ export default function pullDockerImage() {
|
|
|
9
17
|
console.log('============= Downloading the docker image... =============');
|
|
10
18
|
console.log('===========================================================');
|
|
11
19
|
console.log('');
|
|
12
|
-
execFileSync(
|
|
20
|
+
execFileSync('docker', ['pull', getDockerImage()], { stdio: 'inherit' });
|
|
13
21
|
console.log('');
|
|
14
22
|
console.log('===========================================================');
|
|
15
23
|
console.log('');
|
|
24
|
+
isDockerImageAvailable = true;
|
|
16
25
|
}
|
|
17
26
|
}
|
|
18
|
-
|
|
19
|
-
export function getDockerImage() {
|
|
20
|
-
return "bugra9/cpp.js:0.2.0";
|
|
21
|
-
}
|