Skip to content

Coeur/Xcodeproj

This branch is 3 commits ahead of, 154 commits behind CocoaPods/Xcodeproj:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

dac0f51 · Oct 4, 2024
Jul 14, 2021
Jul 7, 2015
Oct 4, 2024
Oct 4, 2024
Jan 23, 2019
Oct 15, 2012
Aug 14, 2014
Feb 24, 2017
Jan 15, 2021
Oct 11, 2012
Oct 4, 2024
Apr 7, 2017
Jul 5, 2021
Jul 5, 2021
Feb 14, 2012
Mar 12, 2021
Jul 14, 2021
Dec 26, 2020

Repository files navigation

Xcodeproj

Build Status Coverage Code Climate

Xcodeproj lets you create and modify Xcode projects from Ruby. Script boring management tasks or build Xcode-friendly libraries. Also includes support for Xcode workspaces (.xcworkspace), configuration files (.xcconfig) and Xcode Scheme files (.xcscheme).

It is used in CocoaPods to create a collection of supplemental libraries or frameworks, for all platforms Xcode supports.

The API reference can be found here.

Installing Xcodeproj

Xcodeproj itself installs through RubyGems, the Ruby package manager. Install it by performing the following command:

$ [sudo] gem install xcodeproj

Quickstart

To begin editing an xcodeproj file start by opening it as an Xcodeproj with:

require 'xcodeproj'
project_path = '/your_path/your_project.xcodeproj'
project = Xcodeproj::Project.open(project_path)

Some Small Examples To Get You Started

Look through all targets

project.targets.each do |target|
  puts target.name
end

Get all source files for a target

target = project.targets.first
files = target.source_build_phase.files.to_a.map do |pbx_build_file|
	pbx_build_file.file_ref.real_path.to_s

end.select do |path|
  path.end_with?(".m", ".mm", ".swift")

end.select do |path|
  File.exists?(path)
end

Set a specific build configuration to all targets

project.targets.each do |target|
  target.build_configurations.each do |config|
    config.build_settings['MY_CUSTOM_FLAG'] ||= 'TRUE'
  end
end

Command Line Tool

Installing the Xcodeproj gem will also install a command-line tool xcodeproj which you can use to generate project diffs, target diffs, output all configurations and show a YAML representation.

For more information consult xcodeproj --help.

Collaborate

All Xcodeproj development happens on GitHub. Contributing patches is really easy and gratifying.

Follow @CocoaPods to get up to date information about what's going on in the CocoaPods world.

LICENSE

These works are available under the MIT license. See the LICENSE file for more info.

About

Create and modify Xcode projects from Ruby.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%