Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
fix: fix xxd path for local snapshots generation
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitarTachev committed Sep 27, 2019
1 parent 2e9b753 commit f63d493
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snapshot/android/snapshot-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ SnapshotGenerator.prototype.getSnapshotToolCommand = function (snapshotToolPath,

SnapshotGenerator.prototype.getXxdCommand = function (srcOutputDir, xxdLocation) {
// https://github.com/NativeScript/docker-images/tree/master/v8-snapshot/bin
return `/bin/xxd -i ${SNAPSHOT_BLOB_NAME}.blob > ${srcOutputDir}`;
return `${xxdLocation || ""}xxd -i ${SNAPSHOT_BLOB_NAME}.blob > ${srcOutputDir}`;
}

SnapshotGenerator.prototype.getPathInDocker = function (mappedLocalDir, mappedDockerDir, targetPath) {
Expand Down Expand Up @@ -310,7 +310,7 @@ SnapshotGenerator.prototype.buildCSource = function (androidArch, blobInputDir,
const blobsInputInDocker = `/blobs/${androidArch}`
const srcOutputDirInDocker = `/dist/src/${androidArch}`;
const outputPathInDocker = this.getPathInDocker(srcOutputDir, srcOutputDirInDocker, join(srcOutputDir, `${SNAPSHOT_BLOB_NAME}.c`));
const buildCSourceCommand = this.getXxdCommand(outputPathInDocker);
const buildCSourceCommand = this.getXxdCommand(outputPathInDocker, "/bin/");
command = `docker run --rm -v "${blobInputDir}:${blobsInputInDocker}" -v "${srcOutputDir}:${srcOutputDirInDocker}" ${SNAPSHOTS_DOCKER_IMAGE} /bin/sh -c "cd ${blobsInputInDocker} && ${buildCSourceCommand}"`;
}
else {
Expand Down Expand Up @@ -377,6 +377,6 @@ SnapshotGenerator.prototype.runMksnapshotTool = function (tool, mksnapshotParams
This is why the *.blob files are initially named TNSSnapshot.blob.
After the xxd step, they must be renamed to snapshot.blob, because this is the filename that the Android runtime is looking for.
*/
shelljs.mv(join(blobOutputDir, `${SNAPSHOT_BLOB_NAME}.blob`), join(blobOutputDir, `snapshot.blob`));
shelljs.mv(join(blobOutputDir, `${SNAPSHOT_BLOB_NAME}.blob`), join(blobOutputDir, `snapshot.blob`));
});
}

0 comments on commit f63d493

Please sign in to comment.