1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use super::{IOSContext, IOSError};
use crate::core::{Manager, Task};

/// This task creates a universal binary from one or multiple
/// architecture-specific static libraries for iOS.
pub struct CreateUniversalBinary;

impl Task for CreateUniversalBinary {
    type Context = IOSContext;
    type Error = IOSError;

    fn verb(&self) -> &str {
        "Creating"
    }

    fn message(&self) -> &str {
        "Universal Binary"
    }

    fn detail(&self) -> &str {
        "for iOS"
    }

    fn run(
        &self,
        mut context: Self::Context,
        _manager: &mut Manager,
    ) -> Result<Self::Context, Self::Error> {
        if context.products.len() == 1 {
            let path = context.products.values().next().unwrap().to_owned();
            context.universal_binary_path = Some(path);
            Ok(context)
        } else {
            todo!("Creating universal binaries for iOS has not yet been implemented.")
        }
    }
}