Skip to main content

XcodeProject

Struct XcodeProject 

Source
pub struct XcodeProject {
    pub project_path: PathBuf,
    pub workspace_path: Option<PathBuf>,
    pub scheme: String,
    pub pbxproj_path: PathBuf,
}
Expand description

Represents an Xcode project on disk with its key paths and scheme

Fields§

§project_path: PathBuf

Path to .xcodeproj directory

§workspace_path: Option<PathBuf>

Path to .xcworkspace directory (if exists)

§scheme: String

Xcode scheme name

§pbxproj_path: PathBuf

Path to project.pbxproj inside the .xcodeproj

Implementations§

Source§

impl XcodeProject

Source

pub fn new(project_path: PathBuf, scheme: String) -> Result<Self>

Create from explicit paths

Source

pub fn discover(base_path: &str) -> Result<Self>

Discover an Xcode project by searching a base directory.

Searches for .xcodeproj in common locations:

  • {base_path}/App/App.xcodeproj (Capacitor convention)
  • {base_path}/*.xcodeproj (standard layout)
  • {base_path}/ios/App/App.xcodeproj (nested Capacitor)
  • {base_path}/ios/*.xcodeproj
Source

pub fn get_version(&self) -> Result<String>

Get the MARKETING_VERSION from project.pbxproj

Source

pub fn get_build_number(&self) -> Result<String>

Get the CURRENT_PROJECT_VERSION (build number) from project.pbxproj

Source

pub fn set_build_number(&self, num: &str) -> Result<()>

Set the CURRENT_PROJECT_VERSION (build number) in project.pbxproj

Source

pub fn bump_build_number(&self) -> Result<String>

Increment the CURRENT_PROJECT_VERSION by 1 and return the new value

Source

pub fn set_version(&self, version: &str) -> Result<()>

Set the MARKETING_VERSION in project.pbxproj

Source

pub fn bump_version(&self, part: &str) -> Result<String>

Bump the MARKETING_VERSION by the specified part (major, minor, patch)

Source

pub fn build_target_args(&self) -> Vec<String>

Returns the best path to use for xcodebuild commands. Prefers workspace over project path.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.