Skip to content

Commit

Permalink
ios devices runner
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 28, 2024
1 parent 23efaab commit bf1e93d
Show file tree
Hide file tree
Showing 17 changed files with 1,097 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[target.aarch64-apple-ios]
runner = "cargo-box runner"
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/target


# Added by cargo
#
# already existing elements were commented out

xcuserdata

/target
.DS_Store
.box
Cargo.lock
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ members = [
"cidre-macros",
]

exclude = [
"cargo-box"
]

# [profile.dev]
# opt-level = 1

Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,25 @@
- [x] macOS
- [x] iOS/iPadOS
- [x] tvOS
- [x] watchOS
- [ ] watchOS
- [ ] visionOS

### iOS devices runner

Run tests on your iPhone or iPad.

1. Run `cargo install --path ./cargo-box` to install cargo box plugin
2. Run `cargo box teams` to find out your DEVELOMPENT_TEAM id
3. Run `cargo box devices` to find out your DEVICE_ID
4. Create `.box` file with contents:
```
BOX_ORG_ID = unique org id, for instance org.cidre
DEVELOPMENT_TEAM = team id from steep 2
DEVICE_ID = device id from step 3
```
5. Run `cargo t --target aarch64-apple-ios`
6. Run `cargo r --target aarch64-apple-ios --example`

### Versioning (API Availability)

Deployment targets are controlled via features `macos_x_x`, `ios_x_x`, `tvos_x_x`, `watchos_x_x`, `visionos_x_x`.
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cargo b --target aarch64-apple-ios
cargo b --target aarch64-apple-ios-sim
cargo +nightly b -Zbuild-std --target aarch64-apple-tvos
cargo +nightly b -Zbuild-std --target aarch64-apple-tvos-sim
# cargo +nightly b -Zbuild-std --target arm64_32-apple-watchos
cargo b --target aarch64-apple-darwin
cargo b --target x86_64-apple-darwin
# cargo +nightly b -Zbuild-std --target aarch64-apple-visionos
Expand Down
1 change: 1 addition & 0 deletions cargo-box/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
15 changes: 15 additions & 0 deletions cargo-box/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "cargo-box"
version = "0.1.0"
edition = "2021"
description = "iOS runner"
license = "MIT"

[dependencies]
clap = { version = "4.5", features = ["derive"] }
serde = { version = "1.0.215", features = ["derive"] }
serde_json = "1.0.133"
cargo_toml = "0.21"
dotenv = "0.15.0"

cidre = { path = "../cidre", default-features = false, features = ["ns", "cg", "cf", "sec"] }
10 changes: 10 additions & 0 deletions cargo-box/box/box.entitlements
Original file line number Diff line number Diff line change
@@ -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>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
190 changes: 190 additions & 0 deletions cargo-box/box/box.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
D2B940072D12B915004F24BF /* bin in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2B940052D12B900004F24BF /* bin */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
D2B93FFB2D11B5E0004F24BF /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
files = (
D2B940072D12B915004F24BF /* bin in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
D2798B842CFCC59D00A4ABEF /* cfg.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = cfg.xcconfig; sourceTree = "<group>"; };
D28FC8DE2CFCB6E200FE81B8 /* box.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = box.entitlements; sourceTree = "<group>"; };
D2B940052D12B900004F24BF /* bin */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = bin; path = "$(PRODUCT_NAME)"; sourceTree = "<group>"; };
D2BD41F22CFC8A5D000CF128 /* box.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = box.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
D2BD41EF2CFC8A5D000CF128 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
D2BD41E92CFC8A5D000CF128 = {
isa = PBXGroup;
children = (
D2798B842CFCC59D00A4ABEF /* cfg.xcconfig */,
D28FC8DE2CFCB6E200FE81B8 /* box.entitlements */,
D2B940052D12B900004F24BF /* bin */,
D2BD41F32CFC8A5D000CF128 /* Products */,
);
sourceTree = "<group>";
};
D2BD41F32CFC8A5D000CF128 /* Products */ = {
isa = PBXGroup;
children = (
D2BD41F22CFC8A5D000CF128 /* box.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
D2BD41F12CFC8A5D000CF128 /* box */ = {
isa = PBXNativeTarget;
buildConfigurationList = D2BD42012CFC8A5E000CF128 /* Build configuration list for PBXNativeTarget "box" */;
buildPhases = (
D2BD41EE2CFC8A5D000CF128 /* Sources */,
D2BD41EF2CFC8A5D000CF128 /* Frameworks */,
D2BD41F02CFC8A5D000CF128 /* Resources */,
D2B93FFB2D11B5E0004F24BF /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = box;
packageProductDependencies = (
);
productName = box;
productReference = D2BD41F22CFC8A5D000CF128 /* box.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
D2BD41EA2CFC8A5D000CF128 /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1620;
LastUpgradeCheck = 1620;
TargetAttributes = {
D2BD41F12CFC8A5D000CF128 = {
CreatedOnToolsVersion = 16.2;
};
};
};
buildConfigurationList = D2BD41ED2CFC8A5D000CF128 /* Build configuration list for PBXProject "box" */;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = D2BD41E92CFC8A5D000CF128;
minimizedProjectReferenceProxies = 1;
preferredProjectObjectVersion = 77;
productRefGroup = D2BD41F32CFC8A5D000CF128 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D2BD41F12CFC8A5D000CF128 /* box */,
);
};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
D2BD41F02CFC8A5D000CF128 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
D2BD41EE2CFC8A5D000CF128 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
D2BD41FF2CFC8A5E000CF128 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D2798B842CFCC59D00A4ABEF /* cfg.xcconfig */;
buildSettings = {
};
name = Debug;
};
D2BD42002CFC8A5E000CF128 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D2798B842CFCC59D00A4ABEF /* cfg.xcconfig */;
buildSettings = {
};
name = Release;
};
D2BD42022CFC8A5E000CF128 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Debug;
};
D2BD42032CFC8A5E000CF128 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
D2BD41ED2CFC8A5D000CF128 /* Build configuration list for PBXProject "box" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D2BD41FF2CFC8A5E000CF128 /* Debug */,
D2BD42002CFC8A5E000CF128 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D2BD42012CFC8A5E000CF128 /* Build configuration list for PBXNativeTarget "box" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D2BD42022CFC8A5E000CF128 /* Debug */,
D2BD42032CFC8A5E000CF128 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D2BD41EA2CFC8A5D000CF128 /* Project object */;
}
78 changes: 78 additions & 0 deletions cargo-box/box/box.xcodeproj/xcshareddata/xcschemes/box.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1620"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2BD41F12CFC8A5D000CF128"
BuildableName = "foo.app"
BlueprintName = "box"
ReferencedContainer = "container:box.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2BD41F12CFC8A5D000CF128"
BuildableName = "foo.app"
BlueprintName = "box"
ReferencedContainer = "container:box.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2BD41F12CFC8A5D000CF128"
BuildableName = "foo.app"
BlueprintName = "box"
ReferencedContainer = "container:box.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit bf1e93d

Please # to comment.