Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macOS-13, macOS-14 ]
os: [ macOS-14, macOS-15 ]
runs-on: ${{matrix.os}}

steps:
Expand All @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ macOS-13, macOS-14 ]
os: [ macOS-14, macOS-15 ]
sim: [ tvOS, watchOS ]
runs-on: ${{matrix.os}}

Expand Down
3 changes: 2 additions & 1 deletion dinghy-lib/src/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ fn ndk() -> Result<Option<path::PathBuf>> {

fn ndk_version(ndk: &path::Path) -> Result<String> {
let sources_prop_file = ndk.join("source.properties");
let props = fs::read_to_string(&sources_prop_file)?;
let props = fs::read_to_string(&sources_prop_file)
.with_context(|| format!("Reading prop file {sources_prop_file:?}"))?;
let revision_line = props
.split("\n")
.find(|l| l.starts_with("Pkg.Revision"))
Expand Down
19 changes: 16 additions & 3 deletions dinghy-lib/src/apple/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ impl IosDevice {
}

fn is_pre_ios_17(&self) -> Result<bool> {
Ok(semver::VersionReq::parse(&self.os)?.comparators.get(0).ok_or_else(|| anyhow!("Invalid iOS version: {}", self.os))?.major < 17)
Ok(semver::VersionReq::parse(&self.os)?
.comparators
.get(0)
.ok_or_else(|| anyhow!("Invalid iOS version: {}", self.os))?
.major
< 17)
}

fn is_locked(&self) -> Result<bool> {
Expand Down Expand Up @@ -547,7 +552,14 @@ fn launch_app(dev: &AppleSimDevice, app_args: &[&str], _envs: &[&str]) -> Result
.to_string_lossy()
.into_owned();
let stdout_param = &format!("--stdout={}", stdout);
let mut xcrun_args: Vec<&str> = vec!["simctl", "launch", "-w", stdout_param, &dev.id, "Dinghy"];
let mut xcrun_args: Vec<&str> = vec![
"simctl",
"launch",
"--wait-for-debugger",
stdout_param,
&dev.id,
"Dinghy",
];
xcrun_args.extend(app_args);
debug!("Launching app via xcrun using args: {:?}", xcrun_args);
let launch_output = process::Command::new("xcrun")
Expand All @@ -572,7 +584,8 @@ fn launch_app(dev: &AppleSimDevice, app_args: &[&str], _envs: &[&str]) -> Result
.arg("-s")
.arg(lldb_script_filename)
.output()?;
let test_contents = std::fs::read_to_string(stdout)?;
let test_contents = std::fs::read_to_string(&stdout)
.with_context(|| format!("Reading llvm stdout from {stdout}"))?;
println!("{}", test_contents);

let output: String = String::from_utf8_lossy(&output.stdout).to_string();
Expand Down
6 changes: 5 additions & 1 deletion dinghy-lib/src/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ pub struct SignatureSettings {
pub file: String,
pub entitlements: String,
pub name: String,
#[allow(dead_code)]
pub profile: String,
}

#[derive(Debug, Clone)]
pub struct SigningIdentity {
#[allow(dead_code)]
pub id: String,
pub name: String,
pub team: String,
Expand Down Expand Up @@ -274,7 +276,9 @@ fn devices_from_devicectl(devices: &mut HashMap<String, IosDevice>) -> Result<()
if !devicectl.status.success() {
bail!("xcrun command failed. Please check that \"xcrun devicectl list devices\" works.\n{devicectl:?}");
}
for device in json::parse(&std::fs::read_to_string(tmpjson)?)?["result"]["devices"].members() {
let txt = std::fs::read_to_string(&tmpjson)
.with_context(|| format!("Reading devicectl json output {tmpjson:?}"))?;
for device in json::parse(&txt)?["result"]["devices"].members() {
let Some(udid) = device["hardwareProperties"]["udid"]
.as_str()
.map(|s| s.to_string())
Expand Down
10 changes: 4 additions & 6 deletions dinghy-lib/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use itertools::Itertools;
use serde::de;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::io::Read;
use std::result;
use std::{collections, fs, path};
use std::{collections, path};

use crate::errors::*;

Expand Down Expand Up @@ -185,10 +184,9 @@ impl Configuration {
}

fn read_config_file<P: AsRef<path::Path>>(file: P) -> Result<ConfigurationFileContent> {
let mut data = String::new();
let mut fd = fs::File::open(file)?;
fd.read_to_string(&mut data)?;
Ok(::toml::from_str(&data)?)
let file = file.as_ref();
let data = std::fs::read_to_string(file).with_context(|| format!("Reading {file:?}"))?;
Ok(toml::from_str(&data)?)
}

pub fn dinghy_config<P: AsRef<path::Path>>(dir: P) -> Result<Configuration> {
Expand Down