Skip to content

Commit f62fdec

Browse files
committed
chore: include missing android binaries in binaries.tar.gz
1 parent 8600187 commit f62fdec

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

scripts/package-binaries.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ const path = require('path');
55
const tar = require('tar');
66

77
async function packageBinaries() {
8-
const buildDir = path.join(__dirname, '..', 'build');
9-
const outputFile = path.join(__dirname, '..', 'binaries.tar.gz');
8+
const projectDir = path.join(__dirname, '..');
9+
const buildDir = path.join(projectDir, 'build');
10+
const androidLibsDir = path.join(projectDir, 'android', 'src', 'main', 'jniLibs');
11+
const outputFile = path.join(projectDir, 'binaries.tar.gz');
1012

1113
if (!fs.existsSync(path.join(buildDir, 'RnMatrixRustSdk.xcframework'))) {
12-
console.error('No binaries found in build directory. Run yarn generate:release first.');
14+
console.error('No iOS binaries found in build directory. Run yarn generate:release first.');
15+
process.exit(1);
16+
}
17+
18+
if (!fs.existsSync(androidLibsDir)) {
19+
console.error('No Android binaries found in android/src/main/jniLibs directory. Run yarn generate:release first.');
1320
process.exit(1);
1421
}
1522

@@ -18,8 +25,11 @@ async function packageBinaries() {
1825
await tar.c({
1926
gzip: true,
2027
file: outputFile,
21-
cwd: buildDir,
22-
}, ['.']);
28+
cwd: projectDir,
29+
}, [
30+
'build',
31+
'android/src/main/jniLibs'
32+
]);
2333

2434
const stats = fs.statSync(outputFile);
2535
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);

0 commit comments

Comments
 (0)