react-native-pirate-wallet 0.3.0 → 0.3.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/README.md +5 -2
- package/package.json +6 -5
- package/scripts/assemble-ios-framework.js +143 -45
- package/scripts/verify-package.js +67 -46
package/README.md
CHANGED
|
@@ -77,7 +77,9 @@ await sdk.configureAccountStorage({
|
|
|
77
77
|
- `src/`
|
|
78
78
|
|
|
79
79
|
Native libraries are distributed in exact-version Android ARM, Android x86_64,
|
|
80
|
-
iOS device, and iOS simulator companion packages.
|
|
80
|
+
iOS device, iOS simulator arm64, and iOS simulator x86_64 companion packages.
|
|
81
|
+
On macOS, CocoaPods combines the two thin simulator archives into the universal
|
|
82
|
+
XCFramework slice expected by Xcode.
|
|
81
83
|
|
|
82
84
|
## Preparing native artifacts in this repo
|
|
83
85
|
|
|
@@ -90,7 +92,8 @@ bash scripts/prepare-react-native-plugin.sh
|
|
|
90
92
|
That copies:
|
|
91
93
|
|
|
92
94
|
- Android JNI libraries into the two Android companion packages
|
|
93
|
-
- iOS XCFramework
|
|
95
|
+
- the iOS device XCFramework slice and two thin simulator archives into the
|
|
96
|
+
three iOS companion packages
|
|
94
97
|
|
|
95
98
|
There is also a minimal consumer app in:
|
|
96
99
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-pirate-wallet",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "React Native wrapper for the Pirate Unified Wallet native SDK surfaces",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -52,10 +52,11 @@
|
|
|
52
52
|
"react-native": ">=0.71.0 <1.0.0"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
|
-
"react-native-pirate-wallet-android": "0.3.
|
|
56
|
-
"react-native-pirate-wallet-android-x86_64": "0.3.
|
|
57
|
-
"react-native-pirate-wallet-ios-device": "0.3.
|
|
58
|
-
"react-native-pirate-wallet-ios-simulator": "0.3.
|
|
55
|
+
"react-native-pirate-wallet-android": "0.3.2",
|
|
56
|
+
"react-native-pirate-wallet-android-x86_64": "0.3.2",
|
|
57
|
+
"react-native-pirate-wallet-ios-device": "0.3.2",
|
|
58
|
+
"react-native-pirate-wallet-ios-simulator-arm64": "0.3.2",
|
|
59
|
+
"react-native-pirate-wallet-ios-simulator-x86_64": "0.3.2"
|
|
59
60
|
},
|
|
60
61
|
"publishConfig": {
|
|
61
62
|
"access": "public"
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
3
|
+
const childProcess = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
5
6
|
|
|
6
|
-
const packageRoot = path.resolve(__dirname,
|
|
7
|
-
const frameworkName =
|
|
8
|
-
const
|
|
7
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
8
|
+
const frameworkName = "PirateWalletNative.xcframework";
|
|
9
|
+
const devicePackage = {
|
|
10
|
+
name: "react-native-pirate-wallet-ios-device",
|
|
11
|
+
slice: "ios-arm64",
|
|
12
|
+
};
|
|
13
|
+
const simulatorPackages = [
|
|
9
14
|
{
|
|
10
|
-
name:
|
|
11
|
-
|
|
15
|
+
name: "react-native-pirate-wallet-ios-simulator-arm64",
|
|
16
|
+
architecture: "arm64",
|
|
12
17
|
},
|
|
13
18
|
{
|
|
14
|
-
name:
|
|
15
|
-
|
|
19
|
+
name: "react-native-pirate-wallet-ios-simulator-x86_64",
|
|
20
|
+
architecture: "x86_64",
|
|
16
21
|
},
|
|
17
22
|
];
|
|
18
23
|
|
|
@@ -22,43 +27,41 @@ function candidatePackageJsonPaths(packageName) {
|
|
|
22
27
|
candidates.push(
|
|
23
28
|
require.resolve(`${packageName}/package.json`, {
|
|
24
29
|
paths: [process.cwd(), packageRoot],
|
|
25
|
-
})
|
|
30
|
+
})
|
|
26
31
|
);
|
|
27
32
|
} catch (_) {
|
|
28
33
|
// The monorepo package is resolved below before it has been published.
|
|
29
34
|
}
|
|
30
|
-
candidates.push(
|
|
31
|
-
path.resolve(packageRoot, '..', packageName, 'package.json'),
|
|
32
|
-
);
|
|
35
|
+
candidates.push(path.resolve(packageRoot, "..", packageName, "package.json"));
|
|
33
36
|
return [...new Set(candidates)];
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
function resolvePackage(packageName, expectedVersion) {
|
|
37
40
|
for (const packageJsonPath of candidatePackageJsonPaths(packageName)) {
|
|
38
|
-
if (!fs.statSync(packageJsonPath, {throwIfNoEntry: false})?.isFile()) {
|
|
41
|
+
if (!fs.statSync(packageJsonPath, { throwIfNoEntry: false })?.isFile()) {
|
|
39
42
|
continue;
|
|
40
43
|
}
|
|
41
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath,
|
|
44
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
42
45
|
if (packageJson.name !== packageName) {
|
|
43
46
|
continue;
|
|
44
47
|
}
|
|
45
48
|
if (packageJson.version !== expectedVersion) {
|
|
46
49
|
throw new Error(
|
|
47
50
|
`${packageName}@${packageJson.version} does not match ` +
|
|
48
|
-
`react-native-pirate-wallet@${expectedVersion}
|
|
51
|
+
`react-native-pirate-wallet@${expectedVersion}`
|
|
49
52
|
);
|
|
50
53
|
}
|
|
51
|
-
return path.dirname(packageJsonPath);
|
|
54
|
+
return { root: path.dirname(packageJsonPath), packageJson };
|
|
52
55
|
}
|
|
53
56
|
throw new Error(
|
|
54
57
|
`${packageName}@${expectedVersion} is required to build ` +
|
|
55
|
-
|
|
58
|
+
"react-native-pirate-wallet for iOS"
|
|
56
59
|
);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
62
|
function linkTree(source, destination) {
|
|
60
|
-
fs.mkdirSync(destination, {recursive: true});
|
|
61
|
-
for (const entry of fs.readdirSync(source, {withFileTypes: true})) {
|
|
63
|
+
fs.mkdirSync(destination, { recursive: true });
|
|
64
|
+
for (const entry of fs.readdirSync(source, { withFileTypes: true })) {
|
|
62
65
|
const sourcePath = path.join(source, entry.name);
|
|
63
66
|
const destinationPath = path.join(destination, entry.name);
|
|
64
67
|
if (entry.isDirectory()) {
|
|
@@ -71,7 +74,7 @@ function linkTree(source, destination) {
|
|
|
71
74
|
try {
|
|
72
75
|
fs.linkSync(sourcePath, destinationPath);
|
|
73
76
|
} catch (error) {
|
|
74
|
-
if (![
|
|
77
|
+
if (!["EXDEV", "EPERM", "EACCES", "EMLINK"].includes(error.code)) {
|
|
75
78
|
throw error;
|
|
76
79
|
}
|
|
77
80
|
fs.copyFileSync(sourcePath, destinationPath);
|
|
@@ -79,45 +82,140 @@ function linkTree(source, destination) {
|
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
function runXcrun(args) {
|
|
86
|
+
const result = childProcess.spawnSync("xcrun", args, { encoding: "utf8" });
|
|
87
|
+
if (result.error) {
|
|
88
|
+
throw result.error;
|
|
89
|
+
}
|
|
90
|
+
if (result.status !== 0) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`xcrun ${args.join(" ")} failed:\n${result.stderr || result.stdout}`
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
return result.stdout.trim();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function verifyArchitectures(archive, expected) {
|
|
99
|
+
const actual = runXcrun(["lipo", "-archs", archive]).split(/\s+/).sort();
|
|
100
|
+
const wanted = [...expected].sort();
|
|
101
|
+
if (JSON.stringify(actual) !== JSON.stringify(wanted)) {
|
|
102
|
+
throw new Error(
|
|
103
|
+
`${archive} has architectures ${actual.join(
|
|
104
|
+
", "
|
|
105
|
+
)}; expected ${wanted.join(", ")}`
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function assertMatchingFile(left, right, label) {
|
|
111
|
+
const leftData = fs.readFileSync(left);
|
|
112
|
+
const rightData = fs.readFileSync(right);
|
|
113
|
+
if (!leftData.equals(rightData)) {
|
|
114
|
+
throw new Error(`iOS binary packages contain different ${label}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
82
118
|
function assemble() {
|
|
83
|
-
if (process.platform !==
|
|
119
|
+
if (process.platform !== "darwin") {
|
|
120
|
+
if (process.argv.includes("--force")) {
|
|
121
|
+
throw new Error("iOS XCFramework assembly requires macOS and xcrun lipo");
|
|
122
|
+
}
|
|
84
123
|
return;
|
|
85
124
|
}
|
|
86
125
|
|
|
87
126
|
const wrapperPackage = JSON.parse(
|
|
88
|
-
fs.readFileSync(path.join(packageRoot,
|
|
127
|
+
fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")
|
|
89
128
|
);
|
|
90
|
-
|
|
91
|
-
const expectedVersion =
|
|
129
|
+
function resolveExact(descriptor) {
|
|
130
|
+
const expectedVersion =
|
|
131
|
+
wrapperPackage.optionalDependencies?.[descriptor.name];
|
|
92
132
|
if (expectedVersion !== wrapperPackage.version) {
|
|
93
|
-
throw new Error(`${name} must use the exact wrapper version`);
|
|
133
|
+
throw new Error(`${descriptor.name} must use the exact wrapper version`);
|
|
94
134
|
}
|
|
95
|
-
const root = resolvePackage(name, expectedVersion);
|
|
96
135
|
return {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
framework: path.join(root, 'ios', 'Frameworks', frameworkName),
|
|
136
|
+
...descriptor,
|
|
137
|
+
...resolvePackage(descriptor.name, expectedVersion),
|
|
100
138
|
};
|
|
101
|
-
}
|
|
139
|
+
}
|
|
102
140
|
|
|
103
|
-
const
|
|
104
|
-
|
|
141
|
+
const device = resolveExact(devicePackage);
|
|
142
|
+
const simulators = simulatorPackages.map(resolveExact);
|
|
143
|
+
const deviceFramework = path.join(
|
|
144
|
+
device.root,
|
|
145
|
+
"ios",
|
|
146
|
+
"Frameworks",
|
|
147
|
+
frameworkName
|
|
105
148
|
);
|
|
106
|
-
|
|
107
|
-
|
|
149
|
+
const deviceSlice = path.join(deviceFramework, device.slice);
|
|
150
|
+
if (!fs.statSync(deviceSlice, { throwIfNoEntry: false })?.isDirectory()) {
|
|
151
|
+
throw new Error(
|
|
152
|
+
`${device.name} is missing XCFramework slice ${device.slice}`
|
|
153
|
+
);
|
|
108
154
|
}
|
|
109
155
|
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
156
|
+
const simulatorInputs = simulators.map((simulator) => {
|
|
157
|
+
const metadata = simulator.packageJson.pirateWalletNative;
|
|
158
|
+
if (
|
|
159
|
+
metadata?.platform !== "ios-simulator" ||
|
|
160
|
+
JSON.stringify(metadata.architectures) !==
|
|
161
|
+
JSON.stringify([simulator.architecture])
|
|
162
|
+
) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`${simulator.name} does not identify its expected simulator architecture`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
const archive = path.join(simulator.root, "ios", "libpirate_ffi_native.a");
|
|
168
|
+
const headers = path.join(simulator.root, "ios", "Headers");
|
|
169
|
+
verifyArchitectures(archive, [simulator.architecture]);
|
|
170
|
+
return { ...simulator, archive, headers };
|
|
171
|
+
});
|
|
114
172
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
173
|
+
const canonicalHeaders = path.join(deviceSlice, "Headers");
|
|
174
|
+
for (const simulator of simulatorInputs) {
|
|
175
|
+
for (const header of ["module.modulemap", "pirate_wallet_service.h"]) {
|
|
176
|
+
assertMatchingFile(
|
|
177
|
+
path.join(canonicalHeaders, header),
|
|
178
|
+
path.join(simulator.headers, header),
|
|
179
|
+
header
|
|
180
|
+
);
|
|
119
181
|
}
|
|
120
|
-
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const frameworksRoot = path.join(packageRoot, "ios", "Frameworks");
|
|
185
|
+
fs.mkdirSync(frameworksRoot, { recursive: true });
|
|
186
|
+
const temporaryRoot = fs.mkdtempSync(
|
|
187
|
+
path.join(frameworksRoot, `${frameworkName}.tmp-`)
|
|
188
|
+
);
|
|
189
|
+
const output = path.join(frameworksRoot, frameworkName);
|
|
190
|
+
try {
|
|
191
|
+
fs.copyFileSync(
|
|
192
|
+
path.join(deviceFramework, "Info.plist"),
|
|
193
|
+
path.join(temporaryRoot, "Info.plist")
|
|
194
|
+
);
|
|
195
|
+
linkTree(deviceSlice, path.join(temporaryRoot, device.slice));
|
|
196
|
+
|
|
197
|
+
const simulatorSlice = path.join(
|
|
198
|
+
temporaryRoot,
|
|
199
|
+
"ios-arm64_x86_64-simulator"
|
|
200
|
+
);
|
|
201
|
+
linkTree(canonicalHeaders, path.join(simulatorSlice, "Headers"));
|
|
202
|
+
const universalArchive = path.join(
|
|
203
|
+
simulatorSlice,
|
|
204
|
+
"libpirate_ffi_native.a"
|
|
205
|
+
);
|
|
206
|
+
runXcrun([
|
|
207
|
+
"lipo",
|
|
208
|
+
"-create",
|
|
209
|
+
...simulatorInputs.map((simulator) => simulator.archive),
|
|
210
|
+
"-output",
|
|
211
|
+
universalArchive,
|
|
212
|
+
]);
|
|
213
|
+
verifyArchitectures(universalArchive, ["arm64", "x86_64"]);
|
|
214
|
+
|
|
215
|
+
fs.rmSync(output, { recursive: true, force: true });
|
|
216
|
+
fs.renameSync(temporaryRoot, output);
|
|
217
|
+
} finally {
|
|
218
|
+
fs.rmSync(temporaryRoot, { recursive: true, force: true });
|
|
121
219
|
}
|
|
122
220
|
}
|
|
123
221
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const fs = require(
|
|
4
|
-
const path = require(
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
5
|
|
|
6
|
-
const packageRoot = path.resolve(__dirname,
|
|
6
|
+
const packageRoot = path.resolve(__dirname, "..");
|
|
7
7
|
|
|
8
8
|
function fail(message) {
|
|
9
9
|
console.error(`[react-native-pirate-wallet] ${message}`);
|
|
@@ -12,7 +12,7 @@ function fail(message) {
|
|
|
12
12
|
|
|
13
13
|
function requireFile(relativePath) {
|
|
14
14
|
const absolutePath = path.join(packageRoot, relativePath);
|
|
15
|
-
if (!fs.statSync(absolutePath, {throwIfNoEntry: false})?.isFile()) {
|
|
15
|
+
if (!fs.statSync(absolutePath, { throwIfNoEntry: false })?.isFile()) {
|
|
16
16
|
fail(`Required package file is missing: ${relativePath}`);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
@@ -28,96 +28,117 @@ function rejectPath(relativePath) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function collectFiles(directory) {
|
|
31
|
-
if (!fs.statSync(directory, {throwIfNoEntry: false})?.isDirectory()) {
|
|
31
|
+
if (!fs.statSync(directory, { throwIfNoEntry: false })?.isDirectory()) {
|
|
32
32
|
return [];
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
return fs.readdirSync(directory, {withFileTypes: true}).flatMap(entry => {
|
|
35
|
+
return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
|
|
36
36
|
const entryPath = path.join(directory, entry.name);
|
|
37
37
|
return entry.isDirectory() ? collectFiles(entryPath) : [entryPath];
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const packageJson = JSON.parse(
|
|
42
|
-
fs.readFileSync(path.join(packageRoot,
|
|
42
|
+
fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")
|
|
43
43
|
);
|
|
44
44
|
|
|
45
|
-
if (packageJson.name !==
|
|
45
|
+
if (packageJson.name !== "react-native-pirate-wallet") {
|
|
46
46
|
fail(`Unexpected package name: ${packageJson.name}`);
|
|
47
47
|
}
|
|
48
48
|
if (!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(packageJson.version)) {
|
|
49
|
-
fail(
|
|
49
|
+
fail(
|
|
50
|
+
`Package version is not valid semantic versioning: ${packageJson.version}`
|
|
51
|
+
);
|
|
50
52
|
}
|
|
51
53
|
if (packageJson.private === true) {
|
|
52
|
-
fail(
|
|
54
|
+
fail("The publishable package must not be marked private");
|
|
53
55
|
}
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
+
if (
|
|
57
|
+
packageJson.repository?.url !==
|
|
58
|
+
"https://github.com/PirateNetwork/Pirate-Unified-Light-Wallet.git"
|
|
59
|
+
) {
|
|
60
|
+
fail(
|
|
61
|
+
"The repository URL must match the GitHub repository used for npm provenance"
|
|
62
|
+
);
|
|
56
63
|
}
|
|
57
|
-
if (packageJson.publishConfig?.access !==
|
|
58
|
-
fail(
|
|
64
|
+
if (packageJson.publishConfig?.access !== "public") {
|
|
65
|
+
fail("publishConfig.access must remain public");
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
[
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
"LICENSE-MIT",
|
|
70
|
+
"README.md",
|
|
71
|
+
"react-native.config.js",
|
|
72
|
+
"react-native-pirate-wallet.podspec",
|
|
73
|
+
"scripts/assemble-ios-framework.js",
|
|
74
|
+
"scripts/resolve-android-packages.js",
|
|
75
|
+
"test/smoke.js",
|
|
76
|
+
"src/index.js",
|
|
77
|
+
"src/index.d.ts",
|
|
78
|
+
"android/src/main/AndroidManifest.xml",
|
|
79
|
+
"android/src/main/java/com/pirate/wallet/reactnative/PirateWalletReactNativeModule.kt",
|
|
80
|
+
"ios/PirateWalletReactNative.m",
|
|
81
|
+
"ios/PirateWalletReactNative.swift",
|
|
75
82
|
].forEach(requireFile);
|
|
76
83
|
|
|
77
|
-
if (process.argv.includes(
|
|
84
|
+
if (process.argv.includes("--publish-layout")) {
|
|
78
85
|
[
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
"android/.gradle",
|
|
87
|
+
"android/build",
|
|
88
|
+
"android/src/main/jniLibs",
|
|
89
|
+
"ios/Frameworks/PirateWalletNative.xcframework",
|
|
83
90
|
].forEach(rejectPath);
|
|
84
91
|
}
|
|
85
92
|
|
|
86
93
|
const binaryPackageNames = [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
"react-native-pirate-wallet-android",
|
|
95
|
+
"react-native-pirate-wallet-android-x86_64",
|
|
96
|
+
"react-native-pirate-wallet-ios-device",
|
|
97
|
+
"react-native-pirate-wallet-ios-simulator-arm64",
|
|
98
|
+
"react-native-pirate-wallet-ios-simulator-x86_64",
|
|
91
99
|
];
|
|
92
100
|
for (const binaryPackageName of binaryPackageNames) {
|
|
93
101
|
if (
|
|
94
|
-
packageJson.optionalDependencies?.[binaryPackageName] !==
|
|
102
|
+
packageJson.optionalDependencies?.[binaryPackageName] !==
|
|
103
|
+
packageJson.version
|
|
95
104
|
) {
|
|
96
105
|
fail(`${binaryPackageName} must use the same exact version as the wrapper`);
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
if (
|
|
101
|
-
!process.argv.includes(
|
|
102
|
-
(process.platform ===
|
|
110
|
+
!process.argv.includes("--publish-layout") &&
|
|
111
|
+
(process.platform === "darwin" || process.argv.includes("--all-platforms"))
|
|
103
112
|
) {
|
|
104
113
|
const staticLibraries = collectFiles(
|
|
105
|
-
path.join(
|
|
106
|
-
|
|
114
|
+
path.join(
|
|
115
|
+
packageRoot,
|
|
116
|
+
"ios",
|
|
117
|
+
"Frameworks",
|
|
118
|
+
"PirateWalletNative.xcframework"
|
|
119
|
+
)
|
|
120
|
+
).filter((file) => file.endsWith(".a"));
|
|
107
121
|
if (staticLibraries.length !== 2) {
|
|
108
|
-
fail(
|
|
122
|
+
fail(
|
|
123
|
+
"The iOS XCFramework must contain device and simulator static libraries"
|
|
124
|
+
);
|
|
109
125
|
}
|
|
110
126
|
for (const library of staticLibraries) {
|
|
111
127
|
if (fs.statSync(library).size === 0) {
|
|
112
|
-
fail(
|
|
128
|
+
fail(
|
|
129
|
+
`The iOS static library is empty: ${path.relative(
|
|
130
|
+
packageRoot,
|
|
131
|
+
library
|
|
132
|
+
)}`
|
|
133
|
+
);
|
|
113
134
|
}
|
|
114
135
|
}
|
|
115
136
|
}
|
|
116
137
|
|
|
117
138
|
try {
|
|
118
|
-
const {resolveAndroidJniLibsPaths} = require(
|
|
139
|
+
const { resolveAndroidJniLibsPaths } = require("./resolve-android-packages");
|
|
119
140
|
if (resolveAndroidJniLibsPaths().length !== 2) {
|
|
120
|
-
fail(
|
|
141
|
+
fail("Both Android binary packages must resolve");
|
|
121
142
|
}
|
|
122
143
|
} catch (error) {
|
|
123
144
|
fail(error.message);
|