@trentrand/react-native-app-clip 0.6.2-beta.0
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 +132 -0
- package/app.plugin.js +1 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.d.ts +4 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.d.ts.map +1 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.ios.d.ts +4 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.ios.d.ts.map +1 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.ios.js +5 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.ios.js.map +1 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.js +15 -0
- package/build/ReactNativeAppClipModule/ReactNativeAppClipModule.js.map +1 -0
- package/build/ReactNativeAppClipModule/index.d.ts +3 -0
- package/build/ReactNativeAppClipModule/index.d.ts.map +1 -0
- package/build/ReactNativeAppClipModule/index.js +3 -0
- package/build/ReactNativeAppClipModule/index.js.map +1 -0
- package/build/ReactNativeAppClipModule/types.d.ts +9 -0
- package/build/ReactNativeAppClipModule/types.d.ts.map +1 -0
- package/build/ReactNativeAppClipModule/types.js +2 -0
- package/build/ReactNativeAppClipModule/types.js.map +1 -0
- package/build/getBundleIdentifier/getBundleIdentifier.d.ts +4 -0
- package/build/getBundleIdentifier/getBundleIdentifier.d.ts.map +1 -0
- package/build/getBundleIdentifier/getBundleIdentifier.ios.d.ts +4 -0
- package/build/getBundleIdentifier/getBundleIdentifier.ios.d.ts.map +1 -0
- package/build/getBundleIdentifier/getBundleIdentifier.ios.js +11 -0
- package/build/getBundleIdentifier/getBundleIdentifier.ios.js.map +1 -0
- package/build/getBundleIdentifier/getBundleIdentifier.js +5 -0
- package/build/getBundleIdentifier/getBundleIdentifier.js.map +1 -0
- package/build/getBundleIdentifier/index.d.ts +3 -0
- package/build/getBundleIdentifier/index.d.ts.map +1 -0
- package/build/getBundleIdentifier/index.js +3 -0
- package/build/getBundleIdentifier/index.js.map +1 -0
- package/build/getBundleIdentifier/types.d.ts +2 -0
- package/build/getBundleIdentifier/types.d.ts.map +1 -0
- package/build/getBundleIdentifier/types.js +2 -0
- package/build/getBundleIdentifier/types.js.map +1 -0
- package/build/index.d.ts +15 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +23 -0
- package/build/index.js.map +1 -0
- package/build/isClip/index.d.ts +3 -0
- package/build/isClip/index.d.ts.map +1 -0
- package/build/isClip/index.js +3 -0
- package/build/isClip/index.js.map +1 -0
- package/build/isClip/isClip.clip.d.ts +9 -0
- package/build/isClip/isClip.clip.d.ts.map +1 -0
- package/build/isClip/isClip.clip.js +10 -0
- package/build/isClip/isClip.clip.js.map +1 -0
- package/build/isClip/isClip.d.ts +4 -0
- package/build/isClip/isClip.d.ts.map +1 -0
- package/build/isClip/isClip.ios.d.ts +4 -0
- package/build/isClip/isClip.ios.d.ts.map +1 -0
- package/build/isClip/isClip.ios.js +9 -0
- package/build/isClip/isClip.ios.js.map +1 -0
- package/build/isClip/isClip.js +5 -0
- package/build/isClip/isClip.js.map +1 -0
- package/build/isClip/types.d.ts +2 -0
- package/build/isClip/types.d.ts.map +1 -0
- package/build/isClip/types.js +2 -0
- package/build/isClip/types.js.map +1 -0
- package/expo-module.config.json +6 -0
- package/ios/ReactNativeAppClip.podspec +27 -0
- package/ios/ReactNativeAppClipModule.swift +82 -0
- package/ios/reactnativeappclip.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/reactnativeappclip.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/package.json +53 -0
- package/plugin/build/cliPlugin.d.ts +3 -0
- package/plugin/build/cliPlugin.js +26 -0
- package/plugin/build/index.d.ts +17 -0
- package/plugin/build/index.js +63 -0
- package/plugin/build/lib/getAppClipEntitlements.d.ts +8 -0
- package/plugin/build/lib/getAppClipEntitlements.js +39 -0
- package/plugin/build/withCompression.d.ts +5 -0
- package/plugin/build/withCompression.js +100 -0
- package/plugin/build/withConfig.d.ts +8 -0
- package/plugin/build/withConfig.js +66 -0
- package/plugin/build/withEntitlements.d.ts +8 -0
- package/plugin/build/withEntitlements.js +30 -0
- package/plugin/build/withPlist.d.ts +7 -0
- package/plugin/build/withPlist.js +73 -0
- package/plugin/build/withPodfile.d.ts +5 -0
- package/plugin/build/withPodfile.js +82 -0
- package/plugin/build/withXcode.d.ts +8 -0
- package/plugin/build/withXcode.js +51 -0
- package/plugin/build/xcode/addBuildPhases.d.ts +12 -0
- package/plugin/build/xcode/addBuildPhases.js +44 -0
- package/plugin/build/xcode/addPbxGroup.d.ts +6 -0
- package/plugin/build/xcode/addPbxGroup.js +69 -0
- package/plugin/build/xcode/addProductFile.d.ts +5 -0
- package/plugin/build/xcode/addProductFile.js +21 -0
- package/plugin/build/xcode/addTargetDependency.d.ts +4 -0
- package/plugin/build/xcode/addTargetDependency.js +14 -0
- package/plugin/build/xcode/addToPbxNativeTargetSection.d.ts +24 -0
- package/plugin/build/xcode/addToPbxNativeTargetSection.js +21 -0
- package/plugin/build/xcode/addToPbxProjectSection.d.ts +4 -0
- package/plugin/build/xcode/addToPbxProjectSection.js +14 -0
- package/plugin/build/xcode/addXCConfigurationList.d.ts +8 -0
- package/plugin/build/xcode/addXCConfigurationList.js +38 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withXcode = void 0;
|
|
4
|
+
const config_plugins_1 = require("expo/config-plugins");
|
|
5
|
+
const addBuildPhases_1 = require("./xcode/addBuildPhases");
|
|
6
|
+
const addPbxGroup_1 = require("./xcode/addPbxGroup");
|
|
7
|
+
const addProductFile_1 = require("./xcode/addProductFile");
|
|
8
|
+
const addTargetDependency_1 = require("./xcode/addTargetDependency");
|
|
9
|
+
const addToPbxNativeTargetSection_1 = require("./xcode/addToPbxNativeTargetSection");
|
|
10
|
+
const addToPbxProjectSection_1 = require("./xcode/addToPbxProjectSection");
|
|
11
|
+
const addXCConfigurationList_1 = require("./xcode/addXCConfigurationList");
|
|
12
|
+
const withXcode = (config, { name, targetName, bundleIdentifier, deploymentTarget, enableCompression }) => {
|
|
13
|
+
return (0, config_plugins_1.withXcodeProject)(config, (config) => {
|
|
14
|
+
const xcodeProject = config.modResults;
|
|
15
|
+
const targetUuid = xcodeProject.generateUuid();
|
|
16
|
+
const groupName = "Embed App Clips";
|
|
17
|
+
const { projectName, platformProjectRoot } = config.modRequest;
|
|
18
|
+
const xCConfigurationList = (0, addXCConfigurationList_1.addXCConfigurationList)(xcodeProject, {
|
|
19
|
+
name,
|
|
20
|
+
targetName,
|
|
21
|
+
currentProjectVersion: config.ios?.buildNumber || "1",
|
|
22
|
+
bundleIdentifier,
|
|
23
|
+
deploymentTarget,
|
|
24
|
+
});
|
|
25
|
+
const productFile = (0, addProductFile_1.addProductFile)(xcodeProject, {
|
|
26
|
+
targetName,
|
|
27
|
+
groupName,
|
|
28
|
+
});
|
|
29
|
+
const target = (0, addToPbxNativeTargetSection_1.addToPbxNativeTargetSection)(xcodeProject, {
|
|
30
|
+
targetName,
|
|
31
|
+
targetUuid,
|
|
32
|
+
productFile,
|
|
33
|
+
xCConfigurationList,
|
|
34
|
+
});
|
|
35
|
+
(0, addToPbxProjectSection_1.addToPbxProjectSection)(xcodeProject, target);
|
|
36
|
+
(0, addTargetDependency_1.addTargetDependency)(xcodeProject, target);
|
|
37
|
+
(0, addPbxGroup_1.addPbxGroup)(xcodeProject, {
|
|
38
|
+
projectName: projectName,
|
|
39
|
+
targetName,
|
|
40
|
+
platformProjectRoot,
|
|
41
|
+
});
|
|
42
|
+
(0, addBuildPhases_1.addBuildPhases)(xcodeProject, {
|
|
43
|
+
targetUuid,
|
|
44
|
+
groupName,
|
|
45
|
+
productFile,
|
|
46
|
+
enableCompression,
|
|
47
|
+
});
|
|
48
|
+
return config;
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.withXcode = withXcode;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { XcodeProject } from "expo/config-plugins";
|
|
2
|
+
export declare function addBuildPhases(xcodeProject: XcodeProject, { targetUuid, groupName, productFile, enableCompression, }: {
|
|
3
|
+
targetUuid: string;
|
|
4
|
+
groupName: string;
|
|
5
|
+
productFile: {
|
|
6
|
+
uuid: string;
|
|
7
|
+
target: string;
|
|
8
|
+
basename: string;
|
|
9
|
+
group: string;
|
|
10
|
+
};
|
|
11
|
+
enableCompression?: boolean;
|
|
12
|
+
}): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.addBuildPhases = addBuildPhases;
|
|
7
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
8
|
+
function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, enableCompression, }) {
|
|
9
|
+
const buildPath = `"$(CONTENTS_FOLDER_PATH)/AppClips"`;
|
|
10
|
+
const folderType = "watch2_app"; // "watch2_app" uses the same subfolder spec (16), app_clip does not exist in cordova-node-xcode yet
|
|
11
|
+
const buildPhaseFiles = ["AppDelegate.swift"];
|
|
12
|
+
// Add shell script build phase "Start Packager"
|
|
13
|
+
xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Start Packager", targetUuid, {
|
|
14
|
+
shellPath: "/bin/sh",
|
|
15
|
+
shellScript: 'if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\nexport RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"\necho "export RCT_METRO_PORT=${RCT_METRO_PORT}" > `$NODE_BINARY --print "require(\'path\').dirname(require.resolve(\'react-native/package.json\')) + \'/scripts/.packager.env\'"`\nif [ -z "${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then\n echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"\n exit 2\n fi\n else\n open `$NODE_BINARY --print "require(\'path\').dirname(require.resolve(\'expo/package.json\')) + \'/scripts/launchPackager.command\'"` || echo "Can\'t start packager automatically"\n fi\nfi\n',
|
|
16
|
+
}, buildPath);
|
|
17
|
+
// Sources build phase
|
|
18
|
+
xcodeProject.addBuildPhase(buildPhaseFiles, "PBXSourcesBuildPhase", groupName, targetUuid, folderType, buildPath);
|
|
19
|
+
// Copy files build phase
|
|
20
|
+
xcodeProject.addBuildPhase([], "PBXCopyFilesBuildPhase", groupName, xcodeProject.getFirstTarget().uuid, folderType, buildPath);
|
|
21
|
+
xcodeProject
|
|
22
|
+
.buildPhaseObject("PBXCopyFilesBuildPhase", groupName, productFile.target)
|
|
23
|
+
.files.push({
|
|
24
|
+
value: productFile.uuid,
|
|
25
|
+
comment: node_util_1.default.format("%s in %s", productFile.basename, productFile.group), // longComment(file);
|
|
26
|
+
});
|
|
27
|
+
xcodeProject.addToPbxBuildFileSection(productFile);
|
|
28
|
+
// Frameworks build phase
|
|
29
|
+
xcodeProject.addBuildPhase([], "PBXFrameworksBuildPhase", groupName, targetUuid, folderType, buildPath);
|
|
30
|
+
// Resources build phase
|
|
31
|
+
xcodeProject.addBuildPhase(["Images.xcassets", "SplashScreen.storyboard", "Supporting/Expo.plist"], "PBXResourcesBuildPhase", groupName, targetUuid, folderType, buildPath);
|
|
32
|
+
// Add shell script build phase
|
|
33
|
+
xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Bundle React Native code and images", targetUuid, {
|
|
34
|
+
shellPath: "/bin/sh",
|
|
35
|
+
shellScript: 'export BUILDING_FOR_APP_CLIP=1\nif [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\n# The project root by default is one level up from the ios directory\nexport PROJECT_ROOT="$PROJECT_DIR"/..\n\nif [[ "$CONFIGURATION" = *Debug* ]]; then\n export SKIP_BUNDLING=1\nfi\nif [[ -z "$ENTRY_FILE" ]]; then\n # Set the entry JS file using the bundler\'s entry resolution.\n export ENTRY_FILE="$("$NODE_BINARY" -e "require(\'expo/scripts/resolveAppEntry\')" "$PROJECT_ROOT" ios relative | tail -n 1)"\nfi\n\nif [[ -z "$CLI_PATH" ]]; then\n # Use Expo CLI\n export CLI_PATH="$("$NODE_BINARY" --print "require.resolve(\'@expo/cli\')")"\nfi\nif [[ -z "$BUNDLE_COMMAND" ]]; then\n # Default Expo CLI command for bundling\n export BUNDLE_COMMAND="export:embed"\nfi\n\n`"$NODE_BINARY" --print "require(\'path\').dirname(require.resolve(\'react-native/package.json\')) + \'/scripts/react-native-xcode.sh\'"`\n\n',
|
|
36
|
+
}, buildPath);
|
|
37
|
+
// Add compression build phase if enabled
|
|
38
|
+
if (enableCompression) {
|
|
39
|
+
xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Compress JS Bundle", targetUuid, {
|
|
40
|
+
shellPath: "/bin/sh",
|
|
41
|
+
shellScript: 'if [[ "$CONFIGURATION" != "Release" ]]; then\n exit 0\nfi\n\nBUNDLE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle"\n\nif [ -f "$BUNDLE" ]; then\n node -e "const fs=require(\'fs\');const zlib=require(\'zlib\');fs.createReadStream(\'${BUNDLE}\').pipe(zlib.createDeflate({level:9})).pipe(fs.createWriteStream(\'${BUNDLE}.zlib\')).on(\'finish\', ()=>fs.unlinkSync(\'${BUNDLE}\'))"\nfi\n',
|
|
42
|
+
}, buildPath);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.addPbxGroup = addPbxGroup;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
function addPbxGroup(xcodeProject, { projectName, targetName, platformProjectRoot, }) {
|
|
10
|
+
const targetPath = node_path_1.default.join(platformProjectRoot, targetName);
|
|
11
|
+
if (!node_fs_1.default.existsSync(targetPath)) {
|
|
12
|
+
node_fs_1.default.mkdirSync(targetPath, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
const filesToCopy = [
|
|
15
|
+
"SplashScreen.storyboard",
|
|
16
|
+
"AppDelegate.swift",
|
|
17
|
+
];
|
|
18
|
+
for (const file of filesToCopy) {
|
|
19
|
+
const source = node_path_1.default.join(platformProjectRoot, projectName, file);
|
|
20
|
+
copyFileSync(source, targetPath);
|
|
21
|
+
}
|
|
22
|
+
// Copy Images.xcassets
|
|
23
|
+
const imagesXcassetsSource = node_path_1.default.join(platformProjectRoot, projectName, "Images.xcassets");
|
|
24
|
+
copyFolderRecursiveSync(imagesXcassetsSource, targetPath);
|
|
25
|
+
// Add PBX group
|
|
26
|
+
const { uuid: pbxGroupUuid } = xcodeProject.addPbxGroup([
|
|
27
|
+
"AppDelegate.swift",
|
|
28
|
+
"Info.plist",
|
|
29
|
+
"Images.xcassets",
|
|
30
|
+
"SplashScreen.storyboard",
|
|
31
|
+
`${targetName}.entitlements`,
|
|
32
|
+
"Supporting/Expo.plist",
|
|
33
|
+
/* "main.jsbundle", */
|
|
34
|
+
], targetName, targetName);
|
|
35
|
+
// Add PBXGroup to top level group
|
|
36
|
+
const groups = xcodeProject.hash.project.objects.PBXGroup;
|
|
37
|
+
if (pbxGroupUuid) {
|
|
38
|
+
for (const key of Object.keys(groups)) {
|
|
39
|
+
if (groups[key].name === undefined && groups[key].path === undefined) {
|
|
40
|
+
xcodeProject.addToPbxGroup(pbxGroupUuid, key);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function copyFileSync(source, target) {
|
|
46
|
+
let targetFile = target;
|
|
47
|
+
if (node_fs_1.default.existsSync(target) && node_fs_1.default.lstatSync(target).isDirectory()) {
|
|
48
|
+
targetFile = node_path_1.default.join(target, node_path_1.default.basename(source));
|
|
49
|
+
}
|
|
50
|
+
node_fs_1.default.writeFileSync(targetFile, node_fs_1.default.readFileSync(source));
|
|
51
|
+
}
|
|
52
|
+
function copyFolderRecursiveSync(source, target) {
|
|
53
|
+
const targetPath = node_path_1.default.join(target, node_path_1.default.basename(source));
|
|
54
|
+
if (!node_fs_1.default.existsSync(targetPath)) {
|
|
55
|
+
node_fs_1.default.mkdirSync(targetPath, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
if (node_fs_1.default.lstatSync(source).isDirectory()) {
|
|
58
|
+
const files = node_fs_1.default.readdirSync(source);
|
|
59
|
+
for (const file of files) {
|
|
60
|
+
const currentPath = node_path_1.default.join(source, file);
|
|
61
|
+
if (node_fs_1.default.lstatSync(currentPath).isDirectory()) {
|
|
62
|
+
copyFolderRecursiveSync(currentPath, targetPath);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
copyFileSync(currentPath, targetPath);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addProductFile = addProductFile;
|
|
4
|
+
function addProductFile(xcodeProject, { targetName, groupName }) {
|
|
5
|
+
const options = {
|
|
6
|
+
basename: `${targetName}.app`,
|
|
7
|
+
// fileRef: xcodeProject.generateUuid(),
|
|
8
|
+
// uuid: xcodeProject.generateUuid(),
|
|
9
|
+
group: groupName,
|
|
10
|
+
explicitFileType: "wrapper.application",
|
|
11
|
+
/* fileEncoding: 4, */
|
|
12
|
+
settings: {
|
|
13
|
+
ATTRIBUTES: ["RemoveHeadersOnCopy"],
|
|
14
|
+
},
|
|
15
|
+
includeInIndex: 0,
|
|
16
|
+
path: `${targetName}.app`,
|
|
17
|
+
sourceTree: "BUILT_PRODUCTS_DIR",
|
|
18
|
+
};
|
|
19
|
+
const productFile = xcodeProject.addProductFile(targetName, options);
|
|
20
|
+
return productFile;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTargetDependency = addTargetDependency;
|
|
4
|
+
function addTargetDependency(xcodeProject, target) {
|
|
5
|
+
if (!xcodeProject.hash.project.objects.PBXTargetDependency) {
|
|
6
|
+
xcodeProject.hash.project.objects.PBXTargetDependency = {};
|
|
7
|
+
}
|
|
8
|
+
if (!xcodeProject.hash.project.objects.PBXContainerItemProxy) {
|
|
9
|
+
xcodeProject.hash.project.objects.PBXContainerItemProxy = {};
|
|
10
|
+
}
|
|
11
|
+
xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [
|
|
12
|
+
target.uuid,
|
|
13
|
+
]);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { XcodeProject } from "expo/config-plugins";
|
|
2
|
+
export declare function addToPbxNativeTargetSection(xcodeProject: XcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }: {
|
|
3
|
+
targetName: string;
|
|
4
|
+
targetUuid: string;
|
|
5
|
+
productFile: {
|
|
6
|
+
fileRef: string;
|
|
7
|
+
};
|
|
8
|
+
xCConfigurationList: {
|
|
9
|
+
uuid: string;
|
|
10
|
+
};
|
|
11
|
+
}): {
|
|
12
|
+
uuid: string;
|
|
13
|
+
pbxNativeTarget: {
|
|
14
|
+
isa: string;
|
|
15
|
+
name: string;
|
|
16
|
+
productName: string;
|
|
17
|
+
productReference: string;
|
|
18
|
+
productType: string;
|
|
19
|
+
buildConfigurationList: string;
|
|
20
|
+
buildPhases: never[];
|
|
21
|
+
buildRules: never[];
|
|
22
|
+
dependencies: never[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToPbxNativeTargetSection = addToPbxNativeTargetSection;
|
|
4
|
+
function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }) {
|
|
5
|
+
const target = {
|
|
6
|
+
uuid: targetUuid,
|
|
7
|
+
pbxNativeTarget: {
|
|
8
|
+
isa: "PBXNativeTarget",
|
|
9
|
+
name: targetName,
|
|
10
|
+
productName: targetName,
|
|
11
|
+
productReference: productFile.fileRef,
|
|
12
|
+
productType: `"com.apple.product-type.application.on-demand-install-capable"`,
|
|
13
|
+
buildConfigurationList: xCConfigurationList.uuid,
|
|
14
|
+
buildPhases: [],
|
|
15
|
+
buildRules: [],
|
|
16
|
+
dependencies: [],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
xcodeProject.addToPbxNativeTargetSection(target);
|
|
20
|
+
return target;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addToPbxProjectSection = addToPbxProjectSection;
|
|
4
|
+
function addToPbxProjectSection(xcodeProject, target) {
|
|
5
|
+
xcodeProject.addToPbxProjectSection(target);
|
|
6
|
+
// Add target attributes to project section
|
|
7
|
+
if (!xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid]
|
|
8
|
+
.attributes.TargetAttributes) {
|
|
9
|
+
xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes = {};
|
|
10
|
+
}
|
|
11
|
+
xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes[target.uuid] = {
|
|
12
|
+
LastSwiftMigration: 1250,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { XcodeProject } from "expo/config-plugins";
|
|
2
|
+
export declare function addXCConfigurationList(xcodeProject: XcodeProject, { name, targetName, currentProjectVersion, bundleIdentifier, deploymentTarget, }: {
|
|
3
|
+
name: string;
|
|
4
|
+
targetName: string;
|
|
5
|
+
currentProjectVersion: string;
|
|
6
|
+
bundleIdentifier: string;
|
|
7
|
+
deploymentTarget: string;
|
|
8
|
+
}): any;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addXCConfigurationList = addXCConfigurationList;
|
|
4
|
+
function addXCConfigurationList(xcodeProject, { name, targetName, currentProjectVersion, bundleIdentifier, deploymentTarget, }) {
|
|
5
|
+
const commonBuildSettings = {
|
|
6
|
+
ASSETCATALOG_COMPILER_APPICON_NAME: "AppIcon",
|
|
7
|
+
CLANG_ENABLE_MODULES: "YES",
|
|
8
|
+
CURRENT_PROJECT_VERSION: `"${currentProjectVersion}"`,
|
|
9
|
+
INFOPLIST_FILE: `${targetName}/Info.plist`,
|
|
10
|
+
IPHONEOS_DEPLOYMENT_TARGET: `"${deploymentTarget}"`,
|
|
11
|
+
// LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks",
|
|
12
|
+
// OTHER_LDFLAGS: `("$(inherited)","-ObjC","-lc++",)`,
|
|
13
|
+
PRODUCT_BUNDLE_IDENTIFIER: `"${bundleIdentifier}"`,
|
|
14
|
+
PRODUCT_NAME: `"${name}"`,
|
|
15
|
+
SWIFT_VERSION: "5.0",
|
|
16
|
+
VERSIONING_SYSTEM: `"apple-generic"`,
|
|
17
|
+
// TARGETED_DEVICE_FAMILY: `"1,2"`,
|
|
18
|
+
CODE_SIGN_ENTITLEMENTS: `${targetName}/${targetName}.entitlements`,
|
|
19
|
+
};
|
|
20
|
+
const buildConfigurationsList = [
|
|
21
|
+
{
|
|
22
|
+
name: "Debug",
|
|
23
|
+
isa: "XCBuildConfiguration",
|
|
24
|
+
buildSettings: {
|
|
25
|
+
...commonBuildSettings,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Release",
|
|
30
|
+
isa: "XCBuildConfiguration",
|
|
31
|
+
buildSettings: {
|
|
32
|
+
...commonBuildSettings,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList, "Release", `Build configuration list for PBXNativeTarget "${targetName}"`);
|
|
37
|
+
return xCConfigurationList;
|
|
38
|
+
}
|