Unified · Split
| @@ -1,30 +0,0 @@ | ||
| 1 | −"use strict"; | |
| 2 | − | |
| 3 | −// One-off: apply the widget asset-catalog wiring to the already-generated | |
| 4 | −// ios/ project so the current build compiles ExpoWidgetsTarget/Assets.xcassets | |
| 5 | −// without a full `expo prebuild`. The durable equivalent lives in | |
| 6 | −// plugins/withWidgetLogoAsset.cjs and runs on prebuild. | |
| 7 | − | |
| 8 | −const path = require("path"); | |
| 9 | −const fs = require("fs"); | |
| 10 | − | |
| 11 | −const xcodePath = require.resolve("xcode", { | |
| 12 | − paths: [ | |
| 13 | − require.resolve("@expo/config-plugins", { paths: [require.resolve("expo/package.json")] }), | |
| 14 | − ], | |
| 15 | −}); | |
| 16 | −const xcode = require(xcodePath); | |
| 17 | −const { addWidgetAssetCatalog } = require("../plugins/lib/addWidgetAssetCatalog.cjs"); | |
| 18 | − | |
| 19 | −const pbxprojPath = path.join(__dirname, "..", "ios", "T3CodeDev.xcodeproj", "project.pbxproj"); | |
| 20 | −const proj = xcode.project(pbxprojPath); | |
| 21 | −proj.parseSync(); | |
| 22 | − | |
| 23 | −const added = addWidgetAssetCatalog(proj, { targetName: "ExpoWidgetsTarget" }); | |
| 24 | − | |
| 25 | −if (added) { | |
| 26 | − fs.writeFileSync(pbxprojPath, proj.writeSync()); | |
| 27 | − console.log("Added widget asset-compile phase to ExpoWidgetsTarget."); | |
| 28 | −} else { | |
| 29 | − console.log("No change: phase already present."); | |
| 30 | −} | |