UNPKG

react-native-legal

Version:
29 lines (28 loc) 1.43 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.withIosLegal = void 0; const path_1 = __importDefault(require("path")); const config_plugins_1 = require("expo/config-plugins"); const common_1 = require("../../../plugin-utils/build/common"); const addSettingsBundle_1 = require("./addSettingsBundle"); const registerLicensePlistBuildPhase_1 = require("./registerLicensePlistBuildPhase"); /** * Implementation of config plugin for iOS setup * * It scans the NPM dependencies, generates LicensePlist-compatible metadata, * configures Settings.bundle and registers a shell script generating LicensePlist metadata for iOS dependencies */ const withIosLegal = (config) => { (0, config_plugins_1.withXcodeProject)(config, async (exportedConfig) => { const licenses = (0, common_1.scanDependencies)(path_1.default.join(exportedConfig.modRequest.projectRoot, 'package.json')); (0, common_1.generateLicensePlistNPMOutput)(licenses, exportedConfig.modRequest.platformProjectRoot); return exportedConfig; }); config = (0, addSettingsBundle_1.addSettingsBundle)(config); config = (0, registerLicensePlistBuildPhase_1.registerLicensePlistBuildPhase)(config); return config; }; exports.withIosLegal = withIosLegal;