Merge pull request 'codex/ios-app' (#1) from codex/ios-app into main
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
55
AGENTS.md
Normal file
55
AGENTS.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# Repository instructions
|
||||||
|
|
||||||
|
## iOS simulator build and deployment
|
||||||
|
|
||||||
|
This Apple Silicon project builds the simulator app for `arm64`. Do not disable
|
||||||
|
code signing: the Rust build script consumes Xcode's generated simulator
|
||||||
|
entitlement paths. Do not request an `x86_64` simulator build unless the
|
||||||
|
`x86_64-apple-ios` Rust target has explicitly been installed.
|
||||||
|
|
||||||
|
Use this sequence from the repository root:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd ios
|
||||||
|
xcodegen generate
|
||||||
|
|
||||||
|
xcodebuild \
|
||||||
|
-project Gotcha.xcodeproj \
|
||||||
|
-scheme Gotcha \
|
||||||
|
-configuration Debug \
|
||||||
|
-sdk iphonesimulator \
|
||||||
|
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
|
||||||
|
ARCHS=arm64 \
|
||||||
|
ONLY_ACTIVE_ARCH=YES \
|
||||||
|
build
|
||||||
|
|
||||||
|
gotcha_build_dir="$(
|
||||||
|
xcodebuild \
|
||||||
|
-project Gotcha.xcodeproj \
|
||||||
|
-scheme Gotcha \
|
||||||
|
-configuration Debug \
|
||||||
|
-sdk iphonesimulator \
|
||||||
|
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
|
||||||
|
-showBuildSettings -json \
|
||||||
|
ARCHS=arm64 \
|
||||||
|
ONLY_ACTIVE_ARCH=YES |
|
||||||
|
plutil -extract 0.buildSettings.TARGET_BUILD_DIR raw -o - -
|
||||||
|
)"
|
||||||
|
xcrun simctl install booted "$gotcha_build_dir/Gotcha.app"
|
||||||
|
xcrun simctl launch booted de.rfc1437.gotcha
|
||||||
|
```
|
||||||
|
|
||||||
|
Before deploying, check for a booted simulator with
|
||||||
|
`xcrun simctl list devices available`. If none is booted, boot an available
|
||||||
|
iPhone (currently `xcrun simctl boot "iPhone 17 Pro"`) and open Simulator.
|
||||||
|
CoreSimulator access may require running `xcodebuild` and `simctl` outside the
|
||||||
|
workspace sandbox.
|
||||||
|
|
||||||
|
## Generated build data
|
||||||
|
|
||||||
|
Use Xcode's default DerivedData location; do not pass `-derivedDataPath`.
|
||||||
|
Cargo's ignored `target/` directory is a disposable build cache. Cargo does not
|
||||||
|
bound or garbage-collect stale target artifacts, so check it with
|
||||||
|
`du -sh target` and run `cargo clean` when disk space is worth a full rebuild.
|
||||||
|
Do not add a custom cache-pruning tool or disable incremental compilation just
|
||||||
|
to reduce routine cache usage.
|
||||||
4255
Cargo.lock
generated
4255
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
members = ["crates/gitea", "crates/cli"]
|
members = ["crates/gitea", "crates/cli", "crates/app"]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
rust-version = "1.85"
|
rust-version = "1.92"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
|
reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
|
||||||
@@ -14,3 +14,4 @@ serde_json = "1"
|
|||||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||||
rpassword = "7"
|
rpassword = "7"
|
||||||
serde_yaml = "0.9"
|
serde_yaml = "0.9"
|
||||||
|
slint = { version = "=1.17.1", default-features = false, features = ["std", "backend-winit", "renderer-skia", "compat-1-2"] }
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -9,7 +9,8 @@ application.
|
|||||||
- `gotcha_gitea`: reusable asynchronous Gitea API client with the complete
|
- `gotcha_gitea`: reusable asynchronous Gitea API client with the complete
|
||||||
typed Gitea 1.25 API and model surface
|
typed Gitea 1.25 API and model surface
|
||||||
- `gotcha`: CLI for typed common operations and arbitrary API requests
|
- `gotcha`: CLI for typed common operations and arbitrary API requests
|
||||||
- iOS/Slint app: next crate, bundle identifier `de.rfc1437.gotcha`
|
- `gotcha-app`: Slint iOS client for servers, owned repositories, favorites,
|
||||||
|
open issues, and issue details; bundle identifier `de.rfc1437.gotcha`
|
||||||
|
|
||||||
The generated API modules and models cover every Gitea 1.25 operation. The
|
The generated API modules and models cover every Gitea 1.25 operation. The
|
||||||
low-level request API remains available for newer instance-specific endpoints;
|
low-level request API remains available for newer instance-specific endpoints;
|
||||||
@@ -57,5 +58,21 @@ accepted as command-line arguments or environment variables.
|
|||||||
1. Exercise and type API areas in the CLI: repositories, issues and pull
|
1. Exercise and type API areas in the CLI: repositories, issues and pull
|
||||||
requests, Actions, notifications, organizations, packages, administration.
|
requests, Actions, notifications, organizations, packages, administration.
|
||||||
2. Add the Slint shell and move proven read workflows into touch-first screens.
|
2. Add the Slint shell and move proven read workflows into touch-first screens.
|
||||||
3. Add write workflows and iOS integrations such as secure token storage,
|
3. Add write workflows and iOS integrations such as sharing, notifications,
|
||||||
sharing, notifications, and background refresh.
|
and background refresh.
|
||||||
|
|
||||||
|
## iOS app
|
||||||
|
|
||||||
|
Server tokens are kept in the Apple Keychain; the JSON preferences contain only
|
||||||
|
server metadata and favorites. The app requires Xcode, XcodeGen, an installed
|
||||||
|
iOS Simulator runtime, and Rust's
|
||||||
|
`aarch64-apple-ios` and `aarch64-apple-ios-sim` targets. Generate the project
|
||||||
|
after installing those prerequisites:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd ios
|
||||||
|
xcodegen generate
|
||||||
|
open Gotcha.xcodeproj
|
||||||
|
```
|
||||||
|
|
||||||
|
For a fast host-side check, run `cargo test -p gotcha-app`.
|
||||||
|
|||||||
19
crates/app/Cargo.toml
Normal file
19
crates/app/Cargo.toml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[package]
|
||||||
|
name = "gotcha-app"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Lightweight Slint client for Gitea on iOS"
|
||||||
|
edition.workspace = true
|
||||||
|
license.workspace = true
|
||||||
|
rust-version.workspace = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "gotcha-app"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
gotcha_gitea = { path = "../gitea" }
|
||||||
|
serde.workspace = true
|
||||||
|
serde_json.workspace = true
|
||||||
|
security-framework = "3"
|
||||||
|
slint.workspace = true
|
||||||
|
tokio.workspace = true
|
||||||
1430
crates/app/src/main.rs
Normal file
1430
crates/app/src/main.rs
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ios/Assets.xcassets/AppIcon.appiconset/AppIcon.png
Normal file
BIN
ios/Assets.xcassets/AppIcon.appiconset/AppIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
14
ios/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
14
ios/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "AppIcon.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"platform" : "ios",
|
||||||
|
"size" : "1024x1024"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
6
ios/Assets.xcassets/Contents.json
Normal file
6
ios/Assets.xcassets/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
10
ios/Gotcha.entitlements
Normal file
10
ios/Gotcha.entitlements
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>keychain-access-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>$(AppIdentifierPrefix)$(CFBundleIdentifier)</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
311
ios/Gotcha.xcodeproj/project.pbxproj
Normal file
311
ios/Gotcha.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 77;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
E7AC0B140F5CFC5EF226D174 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDAABE6B13ADC6D08D9438AF /* Assets.xcassets */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
5FB3250A93766966A60A685E /* Gotcha.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Gotcha.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
DDAABE6B13ADC6D08D9438AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
A8558BC8DD12191B80F52573 = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
DDAABE6B13ADC6D08D9438AF /* Assets.xcassets */,
|
||||||
|
F059299C038F3CAFCE470831 /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
F059299C038F3CAFCE470831 /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
5FB3250A93766966A60A685E /* Gotcha.app */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
60C9DF1AB4A7858833302BA5 /* Gotcha */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 7E8DF3DDA64C8C998FF3BB1D /* Build configuration list for PBXNativeTarget "Gotcha" */;
|
||||||
|
buildPhases = (
|
||||||
|
409DBF67E9C2743801B8F8A4 /* Sources */,
|
||||||
|
6334AD54CF86DAD2EC201EBC /* Build Rust app */,
|
||||||
|
9EDD4380917C29EE67EE344B /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Gotcha;
|
||||||
|
packageProductDependencies = (
|
||||||
|
);
|
||||||
|
productName = Gotcha;
|
||||||
|
productReference = 5FB3250A93766966A60A685E /* Gotcha.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
C30A6F1B592A907D96D6AB40 /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = YES;
|
||||||
|
LastUpgradeCheck = 1430;
|
||||||
|
TargetAttributes = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 807BC8918EC1B0F31384F2B7 /* Build configuration list for PBXProject "Gotcha" */;
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
Base,
|
||||||
|
en,
|
||||||
|
);
|
||||||
|
mainGroup = A8558BC8DD12191B80F52573;
|
||||||
|
minimizedProjectReferenceProxies = 1;
|
||||||
|
preferredProjectObjectVersion = 77;
|
||||||
|
productRefGroup = F059299C038F3CAFCE470831 /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
60C9DF1AB4A7858833302BA5 /* Gotcha */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
9EDD4380917C29EE67EE344B /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
E7AC0B140F5CFC5EF226D174 /* Assets.xcassets in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
6334AD54CF86DAD2EC201EBC /* Build Rust app */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputFileListPaths = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Build Rust app";
|
||||||
|
outputFileListPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
"$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)",
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "./build_for_ios_with_cargo.bash gotcha-app\n";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
409DBF67E9C2743801B8F8A4 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
2F34E9C13F86A9A4A187A561 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Gotcha.entitlements;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = de.rfc1437.gotcha;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
5698E9C0385C353DCF255CDD /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = Gotcha.entitlements;
|
||||||
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
|
INFOPLIST_FILE = Info.plist;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = de.rfc1437.gotcha;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
6638D4C74FE4AF377E805256 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"DEBUG=1",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
AA31619080EBF75C58A16A96 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
7E8DF3DDA64C8C998FF3BB1D /* Build configuration list for PBXNativeTarget "Gotcha" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
2F34E9C13F86A9A4A187A561 /* Debug */,
|
||||||
|
5698E9C0385C353DCF255CDD /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Debug;
|
||||||
|
};
|
||||||
|
807BC8918EC1B0F31384F2B7 /* Build configuration list for PBXProject "Gotcha" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
6638D4C74FE4AF377E805256 /* Debug */,
|
||||||
|
AA31619080EBF75C58A16A96 /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Debug;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = C30A6F1B592A907D96D6AB40 /* Project object */;
|
||||||
|
}
|
||||||
7
ios/Gotcha.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
ios/Gotcha.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
30
ios/Info.plist
Normal file
30
ios/Info.plist
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>Gotcha</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>UILaunchScreen</key>
|
||||||
|
<dict/>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
48
ios/build_for_ios_with_cargo.bash
Executable file
48
ios/build_for_ios_with_cargo.bash
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH:$HOME/.cargo/bin"
|
||||||
|
export RUSTC="$(rustup which --toolchain stable rustc)"
|
||||||
|
export RUSTDOC="$(rustup which --toolchain stable rustdoc)"
|
||||||
|
export CARGO_TARGET_DIR="$DERIVED_FILE_DIR/cargo"
|
||||||
|
export CARGO_PROFILE_RELEASE_DEBUG="${CARGO_PROFILE_RELEASE_DEBUG:-1}"
|
||||||
|
|
||||||
|
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||||
|
profile=debug
|
||||||
|
else
|
||||||
|
profile=release
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${LLVM_TARGET_TRIPLE_SUFFIX:-}" == "-simulator" ]]; then
|
||||||
|
separator=$'\x1f'
|
||||||
|
entitlement_flags="-Clink-arg=-Wl,-sectcreate,__TEXT,__entitlements,$LD_ENTITLEMENTS_SECTION"
|
||||||
|
entitlement_flags+="$separator-Clink-arg=-Wl,-sectcreate,__TEXT,__ents_der,$LD_ENTITLEMENTS_SECTION_DER"
|
||||||
|
export CARGO_ENCODED_RUSTFLAGS="${CARGO_ENCODED_RUSTFLAGS:+$CARGO_ENCODED_RUSTFLAGS$separator}$entitlement_flags"
|
||||||
|
fi
|
||||||
|
|
||||||
|
executables=()
|
||||||
|
for arch in $ARCHS; do
|
||||||
|
if [[ "$arch" == "arm64" && "${LLVM_TARGET_TRIPLE_SUFFIX:-}" == "-simulator" ]]; then
|
||||||
|
target=aarch64-apple-ios-sim
|
||||||
|
elif [[ "$arch" == "arm64" ]]; then
|
||||||
|
target=aarch64-apple-ios
|
||||||
|
elif [[ "$arch" == "x86_64" ]]; then
|
||||||
|
target=x86_64-apple-ios
|
||||||
|
else
|
||||||
|
echo "Unsupported iOS architecture: $arch" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$profile" == "debug" ]]; then
|
||||||
|
rustup run stable cargo build --locked --target "$target" --bin "$1"
|
||||||
|
else
|
||||||
|
rustup run stable cargo build --locked --release --target "$target" --bin "$1"
|
||||||
|
fi
|
||||||
|
executables+=("$CARGO_TARGET_DIR/$target/$profile/$1")
|
||||||
|
done
|
||||||
|
|
||||||
|
lipo -create -output "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" "${executables[@]}"
|
||||||
|
|
||||||
|
if [[ -n "${DWARF_DSYM_FOLDER_PATH:-}" && -n "${DWARF_DSYM_FILE_NAME:-}" ]]; then
|
||||||
|
dsymutil "$TARGET_BUILD_DIR/$EXECUTABLE_PATH" -o "$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME"
|
||||||
|
fi
|
||||||
29
ios/project.yml
Normal file
29
ios/project.yml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Gotcha
|
||||||
|
options:
|
||||||
|
bundleIdPrefix: de.rfc1437
|
||||||
|
settings:
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING: NO
|
||||||
|
targets:
|
||||||
|
Gotcha:
|
||||||
|
type: application
|
||||||
|
platform: iOS
|
||||||
|
deploymentTarget: "17.0"
|
||||||
|
settings:
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER: de.rfc1437.gotcha
|
||||||
|
CODE_SIGN_ENTITLEMENTS: Gotcha.entitlements
|
||||||
|
info:
|
||||||
|
path: Info.plist
|
||||||
|
properties:
|
||||||
|
CFBundleDisplayName: Gotcha
|
||||||
|
UILaunchScreen: {}
|
||||||
|
UISupportedInterfaceOrientations:
|
||||||
|
- UIInterfaceOrientationPortrait
|
||||||
|
sources:
|
||||||
|
- Assets.xcassets
|
||||||
|
postCompileScripts:
|
||||||
|
- name: Build Rust app
|
||||||
|
basedOnDependencyAnalysis: false
|
||||||
|
script: |
|
||||||
|
./build_for_ios_with_cargo.bash gotcha-app
|
||||||
|
outputFiles:
|
||||||
|
- $(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)
|
||||||
Reference in New Issue
Block a user