@hot-updater/apple-helper 1.0.5 → 1.0.7

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/dist/index.cjs CHANGED
@@ -229,12 +229,13 @@ const isXcbeautifyAvailable = async () => {
229
229
  return false;
230
230
  }
231
231
  };
232
- const createRawXcodebuildProcess = ({ args, sourceDir }) => {
232
+ const createRawXcodebuildProcess = ({ args, env, sourceDir }) => {
233
233
  return (0, execa.execa)("xcodebuild", args, {
234
234
  cwd: sourceDir,
235
235
  all: true,
236
236
  env: {
237
237
  ...process.env,
238
+ ...env,
238
239
  NSUnbufferedIO: "YES"
239
240
  }
240
241
  });
@@ -266,7 +267,7 @@ const processOutputStream = async ({ outputStream, logger }) => {
266
267
  if (!outputStream) return;
267
268
  await logger.processStream(outputStream);
268
269
  };
269
- const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failureMessage, logPrefix }) => {
270
+ const runXcodebuildWithLogging = async ({ args, env, sourceDir, successMessage, failureMessage, logPrefix }) => {
270
271
  const useXcbeautify = await isXcbeautifyAvailable();
271
272
  const logger = createXcodebuildLogger({ logPrefix });
272
273
  await logger.start();
@@ -279,6 +280,7 @@ const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failu
279
280
  if (useXcbeautify) {
280
281
  const xcodebuildProcess = createRawXcodebuildProcess({
281
282
  args,
283
+ env,
282
284
  sourceDir
283
285
  });
284
286
  const xcbeautifyProcess = createXcbeautifyProcess({ cwd: sourceDir });
@@ -302,6 +304,7 @@ const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failu
302
304
  } else {
303
305
  const xcodebuildProcess = createRawXcodebuildProcess({
304
306
  args,
307
+ env,
305
308
  sourceDir
306
309
  });
307
310
  activeProcesses.push(xcodebuildProcess);
@@ -329,7 +332,9 @@ const archiveXcodeProject = async ({ sourceDir, platform, installPods, destinati
329
332
  const tmpDir = await createRandomTmpDir();
330
333
  const archiveName = `${xcodeProject.name.replace(".xcworkspace", "").replace(".xcodeproj", "")}.xcarchive`;
331
334
  const archivePath = path.default.join(tmpDir, archiveName);
335
+ const minBundleId = (0, _hot_updater_plugin_core.generateMinBundleId)();
332
336
  const archiveArgs = prepareArchiveArgs({
337
+ minBundleId,
333
338
  archivePath,
334
339
  platform,
335
340
  sourceDir,
@@ -349,6 +354,7 @@ Command xcodebuild ${archiveArgs.join(" ")}
349
354
  try {
350
355
  await runXcodebuildWithLogging({
351
356
  args: archiveArgs,
357
+ env: { HOT_UPDATER_MIN_BUNDLE_ID: minBundleId },
352
358
  failureMessage: "Archive failed",
353
359
  logPrefix,
354
360
  sourceDir,
@@ -359,7 +365,7 @@ Command xcodebuild ${archiveArgs.join(" ")}
359
365
  throw prettifyXcodebuildError(error);
360
366
  }
361
367
  };
362
- const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xcodeProject, configuration = "Release", xcconfig, extraParams, destination = [] }) => {
368
+ const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xcodeProject, configuration = "Release", xcconfig, extraParams, destination = [], minBundleId }) => {
363
369
  const args = [
364
370
  xcodeProject.isWorkspace ? "-workspace" : "-project",
365
371
  path.default.join(sourceDir, xcodeProject.name),
@@ -370,7 +376,7 @@ const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xco
370
376
  "archive",
371
377
  "-archivePath",
372
378
  archivePath,
373
- `HOT_UPDATER_MIN_BUNDLE_ID=${(0, _hot_updater_plugin_core.generateMinBundleId)()}`
379
+ `HOT_UPDATER_MIN_BUNDLE_ID=${minBundleId}`
374
380
  ];
375
381
  if (xcconfig) args.push("-xcconfig", xcconfig);
376
382
  if (extraParams) args.push(...extraParams);
@@ -401,7 +407,9 @@ const buildXcodeProject = async ({ sourceDir, platform, xcodeScheme, configurati
401
407
  platform,
402
408
  useGeneric: useGenericDestination
403
409
  }));
410
+ const minBundleId = (0, _hot_updater_plugin_core.generateMinBundleId)();
404
411
  const buildArgs = prepareBuildArgs({
412
+ minBundleId,
405
413
  configuration,
406
414
  derivedDataPath,
407
415
  deviceType,
@@ -423,6 +431,7 @@ Command xcodebuild ${buildArgs.join(" ")}
423
431
  try {
424
432
  await runXcodebuildWithLogging({
425
433
  args: buildArgs,
434
+ env: { HOT_UPDATER_MIN_BUNDLE_ID: minBundleId },
426
435
  sourceDir,
427
436
  logPrefix,
428
437
  successMessage: "Build completed successfully",
@@ -440,7 +449,7 @@ Command xcodebuild ${buildArgs.join(" ")}
440
449
  throw prettifyXcodebuildError(error);
441
450
  }
442
451
  };
443
- const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, configuration, deviceType, resolvedDestinations, derivedDataPath, extraParams }) => {
452
+ const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, configuration, deviceType, resolvedDestinations, derivedDataPath, extraParams, minBundleId }) => {
444
453
  const sdk = deviceType === "simulator" ? platformConfigs[platform].simulatorSdk : platformConfigs[platform].deviceSdk;
445
454
  const args = [
446
455
  xcodeProject.isWorkspace ? "-workspace" : "-project",
@@ -453,7 +462,7 @@ const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, conf
453
462
  sdk,
454
463
  "-derivedDataPath",
455
464
  derivedDataPath,
456
- `HOT_UPDATER_MIN_BUNDLE_ID=${(0, _hot_updater_plugin_core.generateMinBundleId)()}`,
465
+ `HOT_UPDATER_MIN_BUNDLE_ID=${minBundleId}`,
457
466
  "build"
458
467
  ];
459
468
  if (extraParams) args.push(...extraParams);
package/dist/index.mjs CHANGED
@@ -203,12 +203,13 @@ const isXcbeautifyAvailable = async () => {
203
203
  return false;
204
204
  }
205
205
  };
206
- const createRawXcodebuildProcess = ({ args, sourceDir }) => {
206
+ const createRawXcodebuildProcess = ({ args, env, sourceDir }) => {
207
207
  return execa("xcodebuild", args, {
208
208
  cwd: sourceDir,
209
209
  all: true,
210
210
  env: {
211
211
  ...process.env,
212
+ ...env,
212
213
  NSUnbufferedIO: "YES"
213
214
  }
214
215
  });
@@ -240,7 +241,7 @@ const processOutputStream = async ({ outputStream, logger }) => {
240
241
  if (!outputStream) return;
241
242
  await logger.processStream(outputStream);
242
243
  };
243
- const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failureMessage, logPrefix }) => {
244
+ const runXcodebuildWithLogging = async ({ args, env, sourceDir, successMessage, failureMessage, logPrefix }) => {
244
245
  const useXcbeautify = await isXcbeautifyAvailable();
245
246
  const logger = createXcodebuildLogger({ logPrefix });
246
247
  await logger.start();
@@ -253,6 +254,7 @@ const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failu
253
254
  if (useXcbeautify) {
254
255
  const xcodebuildProcess = createRawXcodebuildProcess({
255
256
  args,
257
+ env,
256
258
  sourceDir
257
259
  });
258
260
  const xcbeautifyProcess = createXcbeautifyProcess({ cwd: sourceDir });
@@ -276,6 +278,7 @@ const runXcodebuildWithLogging = async ({ args, sourceDir, successMessage, failu
276
278
  } else {
277
279
  const xcodebuildProcess = createRawXcodebuildProcess({
278
280
  args,
281
+ env,
279
282
  sourceDir
280
283
  });
281
284
  activeProcesses.push(xcodebuildProcess);
@@ -303,7 +306,9 @@ const archiveXcodeProject = async ({ sourceDir, platform, installPods, destinati
303
306
  const tmpDir = await createRandomTmpDir();
304
307
  const archiveName = `${xcodeProject.name.replace(".xcworkspace", "").replace(".xcodeproj", "")}.xcarchive`;
305
308
  const archivePath = path.join(tmpDir, archiveName);
309
+ const minBundleId = generateMinBundleId();
306
310
  const archiveArgs = prepareArchiveArgs({
311
+ minBundleId,
307
312
  archivePath,
308
313
  platform,
309
314
  sourceDir,
@@ -323,6 +328,7 @@ Command xcodebuild ${archiveArgs.join(" ")}
323
328
  try {
324
329
  await runXcodebuildWithLogging({
325
330
  args: archiveArgs,
331
+ env: { HOT_UPDATER_MIN_BUNDLE_ID: minBundleId },
326
332
  failureMessage: "Archive failed",
327
333
  logPrefix,
328
334
  sourceDir,
@@ -333,7 +339,7 @@ Command xcodebuild ${archiveArgs.join(" ")}
333
339
  throw prettifyXcodebuildError(error);
334
340
  }
335
341
  };
336
- const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xcodeProject, configuration = "Release", xcconfig, extraParams, destination = [] }) => {
342
+ const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xcodeProject, configuration = "Release", xcconfig, extraParams, destination = [], minBundleId }) => {
337
343
  const args = [
338
344
  xcodeProject.isWorkspace ? "-workspace" : "-project",
339
345
  path.join(sourceDir, xcodeProject.name),
@@ -344,7 +350,7 @@ const prepareArchiveArgs = ({ xcodeScheme, archivePath, platform, sourceDir, xco
344
350
  "archive",
345
351
  "-archivePath",
346
352
  archivePath,
347
- `HOT_UPDATER_MIN_BUNDLE_ID=${generateMinBundleId()}`
353
+ `HOT_UPDATER_MIN_BUNDLE_ID=${minBundleId}`
348
354
  ];
349
355
  if (xcconfig) args.push("-xcconfig", xcconfig);
350
356
  if (extraParams) args.push(...extraParams);
@@ -375,7 +381,9 @@ const buildXcodeProject = async ({ sourceDir, platform, xcodeScheme, configurati
375
381
  platform,
376
382
  useGeneric: useGenericDestination
377
383
  }));
384
+ const minBundleId = generateMinBundleId();
378
385
  const buildArgs = prepareBuildArgs({
386
+ minBundleId,
379
387
  configuration,
380
388
  derivedDataPath,
381
389
  deviceType,
@@ -397,6 +405,7 @@ Command xcodebuild ${buildArgs.join(" ")}
397
405
  try {
398
406
  await runXcodebuildWithLogging({
399
407
  args: buildArgs,
408
+ env: { HOT_UPDATER_MIN_BUNDLE_ID: minBundleId },
400
409
  sourceDir,
401
410
  logPrefix,
402
411
  successMessage: "Build completed successfully",
@@ -414,7 +423,7 @@ Command xcodebuild ${buildArgs.join(" ")}
414
423
  throw prettifyXcodebuildError(error);
415
424
  }
416
425
  };
417
- const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, configuration, deviceType, resolvedDestinations, derivedDataPath, extraParams }) => {
426
+ const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, configuration, deviceType, resolvedDestinations, derivedDataPath, extraParams, minBundleId }) => {
418
427
  const sdk = deviceType === "simulator" ? platformConfigs[platform].simulatorSdk : platformConfigs[platform].deviceSdk;
419
428
  const args = [
420
429
  xcodeProject.isWorkspace ? "-workspace" : "-project",
@@ -427,7 +436,7 @@ const prepareBuildArgs = ({ xcodeProject, sourceDir, platform, xcodeScheme, conf
427
436
  sdk,
428
437
  "-derivedDataPath",
429
438
  derivedDataPath,
430
- `HOT_UPDATER_MIN_BUNDLE_ID=${generateMinBundleId()}`,
439
+ `HOT_UPDATER_MIN_BUNDLE_ID=${minBundleId}`,
431
440
  "build"
432
441
  ];
433
442
  if (extraParams) args.push(...extraParams);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hot-updater/apple-helper",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -29,8 +29,8 @@
29
29
  "dependencies": {
30
30
  "execa": "9.5.2",
31
31
  "fast-xml-parser": "5.8.0",
32
- "@hot-updater/cli-tools": "1.0.5",
33
- "@hot-updater/plugin-core": "1.0.5"
32
+ "@hot-updater/cli-tools": "1.0.7",
33
+ "@hot-updater/plugin-core": "1.0.7"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^20"