Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

Improve documentation

Vishnu Mohandas4e2906e61808
diff --git a/mobile/native/darwin/Apps/ensu/README.md b/mobile/native/darwin/Apps/ensu/README.md
index 6e0a15888d..3683c5c47d 100644
--- a/mobile/native/darwin/Apps/ensu/README.md
+++ b/mobile/native/darwin/Apps/ensu/README.md
@@ -7,6 +7,7 @@ All commands below assume you run them from `darwin/Apps/ensu`.
## Quick scripts
```bash
+./setup-mac.sh # Check prerequisites, build local xcframework, resolve packages
./build.sh # Debug build for iOS simulator (prefers booted iPhone)
./build.sh device # Debug build for connected iOS device
./build.sh archive # Release archive (.xcarchive)
@@ -34,7 +35,12 @@ Run `./build.sh --help` or `./run.sh --help` for full options.
The Xcode build script (`scripts/build-rust.sh`) builds Rust static libs, but it does
regenerate the `core`, `db`, and `sync` Swift bindings into `ensu/Generated/` as part of the build.
`../Packages/Rust/tool/generate_bindings.sh` and `../Packages/Rust/tool/build_xcframework.sh`
-handle the InferenceRS bindings and xcframework.
+handle the InferenceRS bindings and xcframework. `./build.sh` will build the
+local `InferenceRSFFI.xcframework` automatically if it is missing, then re-resolve
+Swift package dependencies before building.
+
+If Xcode still shows “Missing package product …” in the IDE, use
+`File > Packages > Resolve Package Versions` after the xcframework has been generated.
### Debug Build (Simulator)
```bash
diff --git a/mobile/native/darwin/Apps/ensu/build.sh b/mobile/native/darwin/Apps/ensu/build.sh
index 16bd6d8a8f..2666a73efb 100755
--- a/mobile/native/darwin/Apps/ensu/build.sh
+++ b/mobile/native/darwin/Apps/ensu/build.sh
@@ -5,6 +5,8 @@ ROOT="$(cd "$(dirname "$0")" && pwd)"
PROJECT="ensu.xcodeproj"
SCHEME="ensu"
DERIVED_DATA_PATH="$ROOT/build"
+INFERENCE_RS_PACKAGE_DIR="$(cd "$ROOT/../../Packages/Rust" && pwd)"
+INFERENCE_RS_XCFRAMEWORK="$INFERENCE_RS_PACKAGE_DIR/InferenceRSFFI.xcframework"
MODE="sim"
DESTINATION_ID=""
@@ -30,11 +32,34 @@ run_xcodebuild() {
local rc=$?
echo "xcodebuild failed (exit $rc). Last 30 lines:" >&2
tail -30 "$log" >&2
- rm -f "$log"
+ echo >&2
+ echo "Full xcodebuild log: $log" >&2
exit $rc
fi
}
+resolve_package_dependencies() {
+ echo "==> Resolving Swift package dependencies"
+ run_xcodebuild \
+ -resolvePackageDependencies \
+ -project "$PROJECT" \
+ -scheme "$SCHEME" \
+ -derivedDataPath "$DERIVED_DATA_PATH" \
+ "${XCODE_EXTRA_ARGS[@]}"
+}
+
+ensure_inference_rs_xcframework() {
+ if [[ -d "$INFERENCE_RS_XCFRAMEWORK" ]]; then
+ return
+ fi
+
+ echo "==> Building local InferenceRS xcframework"
+ (
+ cd "$INFERENCE_RS_PACKAGE_DIR"
+ ./tool/build_xcframework.sh
+ )
+}
+
usage() {
cat <<'EOF'
Build Ensu Apple app.
@@ -199,6 +224,9 @@ if [[ -n "$ENDPOINT" ]]; then
export ENTE_API_ENDPOINT="$ENDPOINT"
fi
+ensure_inference_rs_xcframework
+resolve_package_dependencies
+
build_archive() {
mkdir -p "$(dirname "$ARCHIVE_PATH")"
echo "==> Building Release archive"
diff --git a/mobile/native/darwin/Apps/ensu/ensu.xcodeproj/project.pbxproj b/mobile/native/darwin/Apps/ensu/ensu.xcodeproj/project.pbxproj
index 52b645fa3c..78e271383e 100644
--- a/mobile/native/darwin/Apps/ensu/ensu.xcodeproj/project.pbxproj
+++ b/mobile/native/darwin/Apps/ensu/ensu.xcodeproj/project.pbxproj
@@ -7,45 +7,42 @@
objects = {
/* Begin PBXBuildFile section */
- DACC3DC92E618D6A00DAF993 /* EnteNetwork in Frameworks */ = {isa = PBXBuildFile; productRef = DACC3DC82E618D6A00DAF993 /* EnteNetwork */; };
- 21BBA57867859DAD206D6A46 /* EnteNetwork in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DACC3DC82E618D6A00DAF993 /* EnteNetwork */; };
+ 21BBA57867859DAD206D6A46 /* EnteNetwork in Frameworks */ = {isa = PBXBuildFile; productRef = DACC3DC82E618D6A00DAF993 /* EnteNetwork */; };
DAB0F20D2F5E123400ABCD01 /* InferenceRS in Frameworks */ = {isa = PBXBuildFile; productRef = DAB0F20C2F5E123400ABCD01 /* InferenceRS */; };
- DAB0F20E2F5E123400ABCD01 /* InferenceRS in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DAB0F20C2F5E123400ABCD01 /* InferenceRS */; };
+ DAB0F20E2F5E123400ABCD01 /* InferenceRS in Frameworks */ = {isa = PBXBuildFile; productRef = DAB0F20C2F5E123400ABCD01 /* InferenceRS */; };
+ DACC3DC92E618D6A00DAF993 /* EnteNetwork in Frameworks */ = {isa = PBXBuildFile; productRef = DACC3DC82E618D6A00DAF993 /* EnteNetwork */; };
DAF584672E61BB8300F8A08F /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = DAF584662E61BB8300F8A08F /* ZIPFoundation */; };
- DAF584682E61BB8300F8A08F /* ZIPFoundation in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DAF584662E61BB8300F8A08F /* ZIPFoundation */; };
- DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */ = {isa = PBXBuildFile; productRef = DBA3E91B2F7A6B9000AA11BB /* SwiftMath */; };
- DBA3E91D2F7A6B9000AA11BB /* SwiftMath in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DBA3E91B2F7A6B9000AA11BB /* SwiftMath */; };
+ DAF584682E61BB8300F8A08F /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = DAF584662E61BB8300F8A08F /* ZIPFoundation */; };
DB9F1C3C2F9D123400ABCD02 /* Markdown in Frameworks */ = {isa = PBXBuildFile; productRef = DB9F1C3B2F9D123400ABCD02 /* Markdown */; };
- DB9F1C3D2F9D123400ABCD02 /* Markdown in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DB9F1C3B2F9D123400ABCD02 /* Markdown */; };
+ DB9F1C3D2F9D123400ABCD02 /* Markdown in Frameworks */ = {isa = PBXBuildFile; productRef = DB9F1C3B2F9D123400ABCD02 /* Markdown */; };
+ DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */ = {isa = PBXBuildFile; productRef = DBA3E91B2F7A6B9000AA11BB /* SwiftMath */; };
+ DBA3E91D2F7A6B9000AA11BB /* SwiftMath in Frameworks */ = {isa = PBXBuildFile; productRef = DBA3E91B2F7A6B9000AA11BB /* SwiftMath */; };
DBC1A0032FD0123400ABCD02 /* RiveRuntime in Frameworks */ = {isa = PBXBuildFile; productRef = DBC1A0022FD0123400ABCD02 /* RiveRuntime */; };
- DBC1A0042FD0123400ABCD02 /* RiveRuntime in Frameworks (macOS) */ = {isa = PBXBuildFile; productRef = DBC1A0022FD0123400ABCD02 /* RiveRuntime */; };
+ DBC1A0042FD0123400ABCD02 /* RiveRuntime in Frameworks */ = {isa = PBXBuildFile; productRef = DBC1A0022FD0123400ABCD02 /* RiveRuntime */; };
/* End PBXBuildFile section */
-
/* Begin PBXFileReference section */
- DA72BC612E5F87A000D128FF /* ensu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ensu.app; sourceTree = BUILT_PRODUCTS_DIR; };
77E1DDDF900AB047CB554122 /* Ensu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ensu.app; sourceTree = BUILT_PRODUCTS_DIR; };
- DA72BC732E5F87A100D128FF /* castTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = castTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
- DA72BC7D2E5F87A100D128FF /* castUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = castUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+ DA72BC612E5F87A000D128FF /* ensu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ensu.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
- DA01087C2E682336006E79AE /* Exceptions for "ensu" folder in "ensu" target */ = {
+ 8E70A4C58F3DCEC48083BAFB /* Exceptions for "ensu" folder in "ensu-macos" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
- Info-macOS.plist,
+ "Info-macOS.plist",
Info.plist,
+ LaunchScreen.storyboard,
);
- target = DA72BC602E5F87A000D128FF /* ensu */;
+ target = EC53501B1BEF7BA36025B216 /* ensu-macos */;
};
- 8E70A4C58F3DCEC48083BAFB /* Exceptions for "ensu" folder in "ensu-macos" target */ = {
+ DA01087C2E682336006E79AE /* Exceptions for "ensu" folder in "ensu" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
- Info-macOS.plist,
+ "Info-macOS.plist",
Info.plist,
- LaunchScreen.storyboard,
);
- target = EC53501B1BEF7BA36025B216 /* ensu-macos */;
+ target = DA72BC602E5F87A000D128FF /* ensu */;
};
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
@@ -62,43 +59,29 @@
/* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */
- DA72BC5E2E5F87A000D128FF /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- DACC3DC92E618D6A00DAF993 /* EnteNetwork in Frameworks */,
- DAB0F20D2F5E123400ABCD01 /* InferenceRS in Frameworks */,
- DAF584672E61BB8300F8A08F /* ZIPFoundation in Frameworks */,
- DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */,
- DB9F1C3C2F9D123400ABCD02 /* Markdown in Frameworks */,
- DBC1A0032FD0123400ABCD02 /* RiveRuntime in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
0BCBB02794980AFFDC386B69 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 21BBA57867859DAD206D6A46 /* EnteNetwork in Frameworks (macOS) */,
- DAB0F20E2F5E123400ABCD01 /* InferenceRS in Frameworks (macOS) */,
- DAF584682E61BB8300F8A08F /* ZIPFoundation in Frameworks (macOS) */,
- DBA3E91D2F7A6B9000AA11BB /* SwiftMath in Frameworks (macOS) */,
- DB9F1C3D2F9D123400ABCD02 /* Markdown in Frameworks (macOS) */,
- DBC1A0042FD0123400ABCD02 /* RiveRuntime in Frameworks (macOS) */,
+ 21BBA57867859DAD206D6A46 /* EnteNetwork in Frameworks */,
+ DAB0F20E2F5E123400ABCD01 /* InferenceRS in Frameworks */,
+ DAF584682E61BB8300F8A08F /* ZIPFoundation in Frameworks */,
+ DBA3E91D2F7A6B9000AA11BB /* SwiftMath in Frameworks */,
+ DB9F1C3D2F9D123400ABCD02 /* Markdown in Frameworks */,
+ DBC1A0042FD0123400ABCD02 /* RiveRuntime in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
- DA72BC702E5F87A100D128FF /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- DA72BC7A2E5F87A100D128FF /* Frameworks */ = {
+ DA72BC5E2E5F87A000D128FF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ DACC3DC92E618D6A00DAF993 /* EnteNetwork in Frameworks */,
+ DAB0F20D2F5E123400ABCD01 /* InferenceRS in Frameworks */,
+ DAF584672E61BB8300F8A08F /* ZIPFoundation in Frameworks */,
+ DBA3E91C2F7A6B9000AA11BB /* SwiftMath in Frameworks */,
+ DB9F1C3C2F9D123400ABCD02 /* Markdown in Frameworks */,
+ DBC1A0032FD0123400ABCD02 /* RiveRuntime in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -191,46 +174,6 @@
productReference = 77E1DDDF900AB047CB554122 /* Ensu.app */;
productType = "com.apple.product-type.application";
};
- DA72BC722E5F87A100D128FF /* castTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = DA72BC8A2E5F87A100D128FF /* Build configuration list for PBXNativeTarget "castTests" */;
- buildPhases = (
- DA72BC6F2E5F87A100D128FF /* Sources */,
- DA72BC702E5F87A100D128FF /* Frameworks */,
- DA72BC712E5F87A100D128FF /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- DA72BC752E5F87A100D128FF /* PBXTargetDependency */,
- );
- name = castTests;
- packageProductDependencies = (
- );
- productName = tvTests;
- productReference = DA72BC732E5F87A100D128FF /* castTests.xctest */;
- productType = "com.apple.product-type.bundle.unit-test";
- };
- DA72BC7C2E5F87A100D128FF /* castUITests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = DA72BC8D2E5F87A100D128FF /* Build configuration list for PBXNativeTarget "castUITests" */;
- buildPhases = (
- DA72BC792E5F87A100D128FF /* Sources */,
- DA72BC7A2E5F87A100D128FF /* Frameworks */,
- DA72BC7B2E5F87A100D128FF /* Resources */,
- );
- buildRules = (
- );
- dependencies = (
- DA72BC7F2E5F87A100D128FF /* PBXTargetDependency */,
- );
- name = castUITests;
- packageProductDependencies = (
- );
- productName = tvUITests;
- productReference = DA72BC7D2E5F87A100D128FF /* castUITests.xctest */;
- productType = "com.apple.product-type.bundle.ui-testing";
- };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -247,14 +190,6 @@
EC53501B1BEF7BA36025B216 = {
CreatedOnToolsVersion = 16.3;
};
- DA72BC722E5F87A100D128FF = {
- CreatedOnToolsVersion = 16.3;
- TestTargetID = DA72BC602E5F87A000D128FF;
- };
- DA72BC7C2E5F87A100D128FF = {
- CreatedOnToolsVersion = 16.3;
- TestTargetID = DA72BC602E5F87A000D128FF;
- };
};
};
buildConfigurationList = DA72BC5C2E5F87A000D128FF /* Build configuration list for PBXProject "ensu" */;
@@ -286,13 +221,6 @@
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
- DA72BC5F2E5F87A000D128FF /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
1FDE2B245F9DADEF5E026D0B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -300,14 +228,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- DA72BC712E5F87A100D128FF /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- DA72BC7B2E5F87A100D128FF /* Resources */ = {
+ DA72BC5F2E5F87A000D128FF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -317,7 +238,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
- CC142736A470612F436ECF8E /* Build Rust (core/db/sync) */ = {
+ 25484CE4873ED7217FB27990 /* Build Rust (core/db/sync) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -343,7 +264,7 @@
shellPath = /bin/sh;
shellScript = "ENTE_API_ENDPOINT=\"${ENTE_API_ENDPOINT}\" \"${SRCROOT}/scripts/build-rust.sh\"\n";
};
- 25484CE4873ED7217FB27990 /* Build Rust (core/db/sync) */ = {
+ CC142736A470612F436ECF8E /* Build Rust (core/db/sync) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -372,13 +293,6 @@
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
- DA72BC5D2E5F87A000D128FF /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
BB83D829CC14232E7E8BDD51 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -386,14 +300,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
- DA72BC6F2E5F87A100D128FF /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- DA72BC792E5F87A100D128FF /* Sources */ = {
+ DA72BC5D2E5F87A000D128FF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -402,8 +309,105 @@
};
/* End PBXSourcesBuildPhase section */
-
/* Begin XCBuildConfiguration section */
+ 903C407D9F16DA01750450CF /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMac;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 12;
+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;
+ ENABLE_PREVIEWS = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GENERATE_INFOPLIST_FILE = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/ensu/Generated",
+ );
+ INFOPLIST_FILE = "ensu/Info-macOS.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = Ensu;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TARGET_TEMP_DIR)/ensu_rust",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
+ MARKETING_VERSION = 0.1.12;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-framework",
+ SystemConfiguration,
+ "-force_load",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libcore.a",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
+ );
+ OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap";
+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
+ PRODUCT_NAME = Ensu;
+ SDKROOT = macosx;
+ SUPPORTED_PLATFORMS = macosx;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INCLUDE_PATHS = "$(inherited) $(SRCROOT)/ensu/Generated";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+ 951526E3C06548C816E1D750 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMac;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 12;
+ DEVELOPMENT_TEAM = 6Z68YJY9Q2;
+ ENABLE_PREVIEWS = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GENERATE_INFOPLIST_FILE = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/ensu/Generated",
+ );
+ INFOPLIST_FILE = "ensu/Info-macOS.plist";
+ INFOPLIST_KEY_CFBundleDisplayName = Ensu;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(TARGET_TEMP_DIR)/ensu_rust",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 13.0;
+ MARKETING_VERSION = 0.1.12;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-framework",
+ SystemConfiguration,
+ "-force_load",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libcore.a",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
+ "$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
+ );
+ OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap";
+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
+ PRODUCT_NAME = Ensu;
+ SDKROOT = macosx;
+ SUPPORTED_PLATFORMS = macosx;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INCLUDE_PATHS = "$(inherited) $(SRCROOT)/ensu/Generated";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
DA72BC852E5F87A100D128FF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -458,6 +462,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
@@ -465,7 +470,6 @@
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- IPHONEOS_DEPLOYMENT_TARGET = 16.0;
};
name = Debug;
};
@@ -517,12 +521,12 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
- IPHONEOS_DEPLOYMENT_TARGET = 16.0;
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -538,10 +542,14 @@
DEVELOPMENT_TEAM = 6Z68YJY9Q2;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ ENTE_API_ENDPOINT = "";
GENERATE_INFOPLIST_FILE = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/ensu/Generated",
+ );
INFOPLIST_FILE = ensu/Info.plist;
- ENTE_API_ENDPOINT = "";
- INFOPLIST_KEY_CFBundleDisplayName = "Ensu";
+ INFOPLIST_KEY_CFBundleDisplayName = Ensu;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
@@ -550,22 +558,11 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 0.1.12;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
- PRODUCT_NAME = "$(TARGET_NAME)";
- PROVISIONING_PROFILE_SPECIFIER = "";
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- SWIFT_INCLUDE_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(TARGET_TEMP_DIR)/ensu_rust",
);
+ MARKETING_VERSION = 0.1.12;
OTHER_LDFLAGS = (
"$(inherited)",
"-force_load",
@@ -573,16 +570,12 @@
"$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
"$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
);
- OTHER_SWIFT_FLAGS = (
- "$(inherited)",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap",
- );
+ OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap";
+ PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INCLUDE_PATHS = "$(inherited) $(SRCROOT)/ensu/Generated";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
@@ -599,10 +592,14 @@
DEVELOPMENT_TEAM = 6Z68YJY9Q2;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ ENTE_API_ENDPOINT = "";
GENERATE_INFOPLIST_FILE = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/ensu/Generated",
+ );
INFOPLIST_FILE = ensu/Info.plist;
- ENTE_API_ENDPOINT = "";
- INFOPLIST_KEY_CFBundleDisplayName = "Ensu";
+ INFOPLIST_KEY_CFBundleDisplayName = Ensu;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UIRequiresFullScreen = YES;
@@ -611,257 +608,32 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 0.1.12;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
- PRODUCT_NAME = "$(TARGET_NAME)";
- PROVISIONING_PROFILE_SPECIFIER = "";
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- SWIFT_INCLUDE_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(TARGET_TEMP_DIR)/ensu_rust",
);
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-force_load",
- "$(TARGET_TEMP_DIR)/ensu_rust/libcore.a",
- "$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
- "$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
- );
- OTHER_SWIFT_FLAGS = (
- "$(inherited)",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap",
- );
- SWIFT_EMIT_LOC_STRINGS = YES;
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = "1,2";
- };
- name = Release;
- };
- 951526E3C06548C816E1D750 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMac;
- ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
- CODE_SIGN_IDENTITY = "Apple Development";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 12;
- DEVELOPMENT_TEAM = 6Z68YJY9Q2;
- ENABLE_PREVIEWS = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GENERATE_INFOPLIST_FILE = NO;
- INFOPLIST_FILE = ensu/Info-macOS.plist;
- INFOPLIST_KEY_CFBundleDisplayName = "Ensu";
- INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/../Frameworks",
- );
- MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 0.1.12;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
- PRODUCT_NAME = Ensu;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- SWIFT_INCLUDE_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(TARGET_TEMP_DIR)/ensu_rust",
- );
OTHER_LDFLAGS = (
"$(inherited)",
- "-framework",
- "SystemConfiguration",
"-force_load",
"$(TARGET_TEMP_DIR)/ensu_rust/libcore.a",
"$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
"$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
);
- OTHER_SWIFT_FLAGS = (
- "$(inherited)",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap",
- );
- SDKROOT = macosx;
- SUPPORTED_PLATFORMS = macosx;
- SWIFT_EMIT_LOC_STRINGS = YES;
- SWIFT_VERSION = 5.0;
- };
- name = Debug;
- };
- 903C407D9F16DA01750450CF /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ASSETCATALOG_COMPILER_APPICON_NAME = AppIconMac;
- ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
- CODE_SIGN_IDENTITY = "Apple Development";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 12;
- DEVELOPMENT_TEAM = 6Z68YJY9Q2;
- ENABLE_PREVIEWS = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = NO;
- GENERATE_INFOPLIST_FILE = NO;
- INFOPLIST_FILE = ensu/Info-macOS.plist;
- INFOPLIST_KEY_CFBundleDisplayName = "Ensu";
- INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.photography";
- LD_RUNPATH_SEARCH_PATHS = (
- "$(inherited)",
- "@executable_path/../Frameworks",
- );
- MACOSX_DEPLOYMENT_TARGET = 13.0;
- MARKETING_VERSION = 0.1.12;
+ OTHER_SWIFT_FLAGS = "$(inherited) -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap -Xcc -fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap";
PRODUCT_BUNDLE_IDENTIFIER = io.ente.ensu;
- PRODUCT_NAME = Ensu;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- SWIFT_INCLUDE_PATHS = (
- "$(inherited)",
- "$(SRCROOT)/ensu/Generated",
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(TARGET_TEMP_DIR)/ensu_rust",
- );
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-framework",
- "SystemConfiguration",
- "-force_load",
- "$(TARGET_TEMP_DIR)/ensu_rust/libcore.a",
- "$(TARGET_TEMP_DIR)/ensu_rust/libdb.a",
- "$(TARGET_TEMP_DIR)/ensu_rust/libsync.a",
- );
- OTHER_SWIFT_FLAGS = (
- "$(inherited)",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/coreFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/dbFFI.modulemap",
- "-Xcc",
- "-fmodule-map-file=$(SRCROOT)/ensu/Generated/syncFFI.modulemap",
- );
- SDKROOT = macosx;
- SUPPORTED_PLATFORMS = macosx;
- SWIFT_EMIT_LOC_STRINGS = YES;
- SWIFT_VERSION = 5.0;
- };
- name = Release;
- };
- DA72BC8B2E5F87A100D128FF /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = SN6GQPQWGV;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 0.1.0;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.photos.tv.castTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_EMIT_LOC_STRINGS = NO;
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = 3;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tv.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/tv";
- TVOS_DEPLOYMENT_TARGET = 18.4;
- };
- name = Debug;
- };
- DA72BC8C2E5F87A100D128FF /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- BUNDLE_LOADER = "$(TEST_HOST)";
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = SN6GQPQWGV;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 0.1.0;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.photos.tvTests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_EMIT_LOC_STRINGS = NO;
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = 3;
- TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tv.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/tv";
- TVOS_DEPLOYMENT_TARGET = 18.4;
- };
- name = Release;
- };
- DA72BC8E2E5F87A100D128FF /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = SN6GQPQWGV;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 0.1.0;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.photos.tv.castUITests;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_EMIT_LOC_STRINGS = NO;
- SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = 3;
- TEST_TARGET_NAME = tv;
- };
- name = Debug;
- };
- DA72BC8F2E5F87A100D128FF /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = SN6GQPQWGV;
- GENERATE_INFOPLIST_FILE = YES;
- MARKETING_VERSION = 0.1.0;
- PRODUCT_BUNDLE_IDENTIFIER = io.ente.photos.tvUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_EMIT_LOC_STRINGS = NO;
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ SWIFT_INCLUDE_PATHS = "$(inherited) $(SRCROOT)/ensu/Generated";
SWIFT_VERSION = 5.0;
- TARGETED_DEVICE_FAMILY = 3;
- TEST_TARGET_NAME = tv;
+ TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- DA72BC5C2E5F87A000D128FF /* Build configuration list for PBXProject "ensu" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DA72BC852E5F87A100D128FF /* Debug */,
- DA72BC862E5F87A100D128FF /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- DA72BC872E5F87A100D128FF /* Build configuration list for PBXNativeTarget "ensu" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- DA72BC882E5F87A100D128FF /* Debug */,
- DA72BC892E5F87A100D128FF /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
9C5C5C140967470293DCAAF2 /* Build configuration list for PBXNativeTarget "ensu-macos" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@@ -871,20 +643,20 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- DA72BC8A2E5F87A100D128FF /* Build configuration list for PBXNativeTarget "castTests" */ = {
+ DA72BC5C2E5F87A000D128FF /* Build configuration list for PBXProject "ensu" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- DA72BC8B2E5F87A100D128FF /* Debug */,
- DA72BC8C2E5F87A100D128FF /* Release */,
+ DA72BC852E5F87A100D128FF /* Debug */,
+ DA72BC862E5F87A100D128FF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- DA72BC8D2E5F87A100D128FF /* Build configuration list for PBXNativeTarget "castUITests" */ = {
+ DA72BC872E5F87A100D128FF /* Build configuration list for PBXNativeTarget "ensu" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- DA72BC8E2E5F87A100D128FF /* Debug */,
- DA72BC8F2E5F87A100D128FF /* Release */,
+ DA72BC882E5F87A100D128FF /* Debug */,
+ DA72BC892E5F87A100D128FF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
@@ -892,14 +664,14 @@
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
- DACC3DC62E618D5300DAF993 /* XCLocalSwiftPackageReference "../../Packages/EnteNetwork" */ = {
- isa = XCLocalSwiftPackageReference;
- relativePath = ../../Packages/EnteNetwork;
- };
DAB0F20B2F5E123400ABCD01 /* XCLocalSwiftPackageReference "../../Packages/Rust" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = ../../Packages/Rust;
};
+ DACC3DC62E618D5300DAF993 /* XCLocalSwiftPackageReference "../../Packages/EnteNetwork" */ = {
+ isa = XCLocalSwiftPackageReference;
+ relativePath = ../../Packages/EnteNetwork;
+ };
/* End XCLocalSwiftPackageReference section */
/* Begin XCRemoteSwiftPackageReference section */
@@ -938,18 +710,13 @@
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
- DACC3DC82E618D6A00DAF993 /* EnteNetwork */ = {
- isa = XCSwiftPackageProductDependency;
- productName = EnteNetwork;
- };
DAB0F20C2F5E123400ABCD01 /* InferenceRS */ = {
isa = XCSwiftPackageProductDependency;
productName = InferenceRS;
};
- DBA3E91B2F7A6B9000AA11BB /* SwiftMath */ = {
+ DACC3DC82E618D6A00DAF993 /* EnteNetwork */ = {
isa = XCSwiftPackageProductDependency;
- package = DBA3E91A2F7A6B9000AA11BB /* XCRemoteSwiftPackageReference "SwiftMath" */;
- productName = SwiftMath;
+ productName = EnteNetwork;
};
DAF584662E61BB8300F8A08F /* ZIPFoundation */ = {
isa = XCSwiftPackageProductDependency;
@@ -961,6 +728,11 @@
package = DB9F1C3A2F9D123400ABCD02 /* XCRemoteSwiftPackageReference "swift-markdown" */;
productName = Markdown;
};
+ DBA3E91B2F7A6B9000AA11BB /* SwiftMath */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = DBA3E91A2F7A6B9000AA11BB /* XCRemoteSwiftPackageReference "SwiftMath" */;
+ productName = SwiftMath;
+ };
DBC1A0022FD0123400ABCD02 /* RiveRuntime */ = {
isa = XCSwiftPackageProductDependency;
package = DBC1A0012FD0123400ABCD02 /* XCRemoteSwiftPackageReference "rive-ios" */;
diff --git a/mobile/native/darwin/Apps/ensu/setup-mac.sh b/mobile/native/darwin/Apps/ensu/setup-mac.sh
new file mode 100755
index 0000000000..b4dd40e231
--- /dev/null
+++ b/mobile/native/darwin/Apps/ensu/setup-mac.sh
@@ -0,0 +1,168 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+# Bootstraps the local macOS prerequisites needed to archive ensu.
+#
+# This script intentionally stops before provisioning and TestFlight upload.
+# It covers the setup steps we had to take locally to make `archive` work:
+# 1. Ensure required local developer tools are installed.
+# 2. Ensure the required Rust Apple targets are installed.
+# 3. Ensure the expected uniffi-bindgen version is available.
+# 4. Build the local InferenceRS xcframework used by SwiftPM.
+# 5. Resolve Swift package dependencies for the Xcode project.
+# 6. Print the archive command to run next.
+#
+# Usage:
+# ./setup-mac.sh
+# ./setup-mac.sh --archive
+
+ROOT="$(cd "$(dirname "$0")" && pwd)"
+RUST_PACKAGE_DIR="$(cd "$ROOT/../../Packages/Rust" && pwd)"
+XCFRAMEWORK_SCRIPT="$RUST_PACKAGE_DIR/tool/build_xcframework.sh"
+PROJECT="ensu.xcodeproj"
+SCHEME="ensu"
+DERIVED_DATA_PATH="$ROOT/build"
+ARCHIVE_PATH="$DERIVED_DATA_PATH/Archive/ensu.xcarchive"
+
+ARCHIVE_AFTER_SETUP=0
+
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ --archive)
+ ARCHIVE_AFTER_SETUP=1
+ shift
+ ;;
+ -h|--help)
+ cat <<'EOF'
+Prepare a Mac to archive ensu locally.
+
+Usage:
+ ./setup-mac.sh [--archive]
+
+Options:
+ --archive Run the archive command after setup succeeds.
+EOF
+ exit 0
+ ;;
+ *)
+ echo "Unknown argument: $1" >&2
+ exit 1
+ ;;
+ esac
+done
+
+print_step() {
+ echo
+ echo "==> $1"
+}
+
+require_command() {
+ local name="$1"
+ local hint="${2:-}"
+ if command -v "$name" >/dev/null 2>&1; then
+ return
+ fi
+
+ echo "Missing required command: $name" >&2
+ if [[ -n "$hint" ]]; then
+ echo "$hint" >&2
+ fi
+ exit 1
+}
+
+require_rust_target() {
+ local target="$1"
+ if rustup target list --installed | grep -qx "$target"; then
+ return
+ fi
+
+ echo "Missing required Rust target: $target" >&2
+ echo "Install Apple targets with:" >&2
+ echo " rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios aarch64-apple-darwin x86_64-apple-darwin" >&2
+ exit 1
+}
+
+require_uniffi_bindgen() {
+ if command -v uniffi-bindgen >/dev/null 2>&1; then
+ local version
+ version="$(uniffi-bindgen --version 2>/dev/null || true)"
+ if printf "%s" "$version" | grep -q "0.31."; then
+ return
+ fi
+ echo "Found incompatible ${version:-uniffi-bindgen version}." >&2
+ else
+ echo "Missing required command: uniffi-bindgen" >&2
+ fi
+
+ echo "Install a compatible version with:" >&2
+ echo " cargo install --locked --version 0.31.0 uniffi --features cli --bin uniffi-bindgen" >&2
+ exit 1
+}
+
+print_step "Checking required local tools"
+require_command xcodebuild "Install Xcode and Xcode command line tools."
+require_command cargo "Install Rust and ensure cargo is on PATH."
+require_command rustup "Install rustup and ensure it is on PATH."
+require_command cmake "Install CMake, for example with 'brew install cmake'."
+require_command lipo "Install Xcode command line tools and ensure lipo is on PATH."
+require_command python3 "Install python3 and ensure it is on PATH."
+require_uniffi_bindgen
+
+print_step "Checking required Rust Apple targets"
+require_rust_target aarch64-apple-ios
+require_rust_target aarch64-apple-ios-sim
+require_rust_target x86_64-apple-ios
+require_rust_target aarch64-apple-darwin
+require_rust_target x86_64-apple-darwin
+
+print_step "Building local InferenceRS xcframework"
+(
+ cd "$RUST_PACKAGE_DIR"
+ ./tool/build_xcframework.sh
+)
+
+print_step "Resolving Swift package dependencies"
+(
+ cd "$ROOT"
+ xcodebuild \
+ -resolvePackageDependencies \
+ -project "$PROJECT" \
+ -scheme "$SCHEME" \
+ -derivedDataPath "$DERIVED_DATA_PATH"
+)
+
+print_step "Setup complete"
+cat <<EOF
+Local archive prerequisites are ready.
+
+Archive command:
+ cd "$ROOT"
+ xcodebuild \\
+ -project $PROJECT \\
+ -scheme $SCHEME \\
+ -configuration Release \\
+ -sdk iphoneos \\
+ -destination 'generic/platform=iOS' \\
+ -archivePath $ARCHIVE_PATH \\
+ archive
+
+Notes:
+ - Provisioning/TestFlight export is intentionally not handled here.
+ - If Xcode still shows missing package products, run:
+ File > Packages > Resolve Package Versions
+EOF
+
+if [[ "$ARCHIVE_AFTER_SETUP" == "1" ]]; then
+ print_step "Archiving ensu"
+ (
+ cd "$ROOT"
+ xcodebuild \
+ -project "$PROJECT" \
+ -scheme "$SCHEME" \
+ -configuration Release \
+ -sdk iphoneos \
+ -destination 'generic/platform=iOS' \
+ -archivePath "$ARCHIVE_PATH" \
+ archive
+ )
+fi
diff --git a/mobile/native/darwin/Packages/Rust/README.md b/mobile/native/darwin/Packages/Rust/README.md
index 904e3788c7..63c4d85989 100644
--- a/mobile/native/darwin/Packages/Rust/README.md
+++ b/mobile/native/darwin/Packages/Rust/README.md
@@ -20,6 +20,14 @@ Note: The script applies the llama.cpp mtmd patch (requires `python3`). Set
## Build the xcframework
+Prerequisites on macOS:
+
+- `cargo`
+- `xcodebuild`
+- `lipo`
+- `cmake`
+- `uniffi-bindgen`
+
From the repo root:
```bash
diff --git a/mobile/native/darwin/Packages/Rust/tool/build_xcframework.sh b/mobile/native/darwin/Packages/Rust/tool/build_xcframework.sh
index 87980498fe..8d0288b01d 100755
--- a/mobile/native/darwin/Packages/Rust/tool/build_xcframework.sh
+++ b/mobile/native/darwin/Packages/Rust/tool/build_xcframework.sh
@@ -9,6 +9,45 @@ PATCH_SCRIPT="$CORE_ROOT/tool/patch_llama_mtmd.sh"
APPLY_LLAMA_MTMD_PATCH="${APPLY_LLAMA_MTMD_PATCH:-1}"
LIB_NAME="libinference_rs_uniffi.a"
+require_command() {
+ local name="$1"
+ local hint="${2:-}"
+ if command -v "$name" >/dev/null 2>&1; then
+ return
+ fi
+
+ echo "Missing required command: $name" >&2
+ if [[ -n "$hint" ]]; then
+ echo "$hint" >&2
+ fi
+ exit 1
+}
+
+require_command cargo "Install Rust and ensure cargo is on PATH."
+require_command rustup "Install rustup and ensure it is on PATH."
+require_command xcodebuild "Install Xcode command line tools and ensure xcodebuild is on PATH."
+require_command lipo "Install Xcode command line tools and ensure lipo is on PATH."
+require_command cmake "Install CMake, for example with 'brew install cmake'."
+require_command uniffi-bindgen "Install a compatible version with 'cargo install --locked --version 0.31.0 uniffi --features cli --bin uniffi-bindgen'."
+
+require_rust_target() {
+ local target="$1"
+ if rustup target list --installed | grep -qx "$target"; then
+ return
+ fi
+
+ echo "Missing required Rust target: $target" >&2
+ echo "Install Apple targets with:" >&2
+ echo " rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios aarch64-apple-darwin x86_64-apple-darwin" >&2
+ exit 1
+}
+
+require_rust_target aarch64-apple-ios
+require_rust_target aarch64-apple-ios-sim
+require_rust_target x86_64-apple-ios
+require_rust_target aarch64-apple-darwin
+require_rust_target x86_64-apple-darwin
+
if [[ "$APPLY_LLAMA_MTMD_PATCH" != "0" && -f "$PATCH_SCRIPT" ]]; then
if ! command -v python3 >/dev/null 2>&1; then
echo "python3 is required to apply the llama mtmd patch." >&2
diff --git a/mobile/native/darwin/Packages/Rust/tool/generate_bindings.sh b/mobile/native/darwin/Packages/Rust/tool/generate_bindings.sh
index 27b72e7b1c..3df24f86c3 100755
--- a/mobile/native/darwin/Packages/Rust/tool/generate_bindings.sh
+++ b/mobile/native/darwin/Packages/Rust/tool/generate_bindings.sh
@@ -9,6 +9,42 @@ PATCH_SCRIPT="$CORE_ROOT/tool/patch_llama_mtmd.sh"
APPLY_LLAMA_MTMD_PATCH="${APPLY_LLAMA_MTMD_PATCH:-1}"
OUT_DIR="$ROOT/Sources/InferenceRS"
+require_command() {
+ local name="$1"
+ local hint="${2:-}"
+ if command -v "$name" >/dev/null 2>&1; then
+ return
+ fi
+
+ echo "Missing required command: $name" >&2
+ if [[ -n "$hint" ]]; then
+ echo "$hint" >&2
+ fi
+ exit 1
+}
+
+require_compatible_uniffi_bindgen() {
+ require_command cargo "Install Rust and ensure cargo is on PATH."
+
+ if command -v uniffi-bindgen >/dev/null 2>&1; then
+ local version
+ version="$(uniffi-bindgen --version 2>/dev/null || true)"
+ if printf "%s" "$version" | grep -q "0.31."; then
+ return
+ fi
+ echo "Found incompatible ${version:-uniffi-bindgen version}." >&2
+ else
+ echo "Missing required command: uniffi-bindgen" >&2
+ fi
+
+ echo "Install a compatible version with:" >&2
+ echo " cargo install --locked --version 0.31.0 uniffi --features cli --bin uniffi-bindgen" >&2
+ exit 1
+}
+
+require_command cargo "Install Rust and ensure cargo is on PATH."
+require_compatible_uniffi_bindgen
+
if [[ "$APPLY_LLAMA_MTMD_PATCH" != "0" && -f "$PATCH_SCRIPT" ]]; then
if ! command -v python3 >/dev/null 2>&1; then
echo "python3 is required to apply the llama mtmd patch." >&2