Project

spinjector

0.0
The project is in a healthy, maintained state
Inject script phases into your Xcode project
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.12.0, < 3.0.0
~> 5.11
~> 12.3

Runtime

~> 0.1
~> 1.21
~> 0.2
 Project Readme

spinjector

Inject Script phase in your Xcode project easily.

How to install

gem install spinjector

How to use

Global configuration file

First, create a YAML configuration file under ./Configuration/spinjector_configuration.yaml (default path where spinjector looks for a configuration file).

scripts:
  foo:
    name: "Foo"
    script: |
      echo Foo
    execution_position: :after_compile

targets:
  TargetNameA:
    - foo
    - "helloworld.yaml"
    - "helloworld_explicit_script.yaml"
  TargetNameB:
    - "helloworld_short.yaml"
    - foo

Script configuration file

Then, for each script you want to inject in your Xcode project:

  • You can use scripts section in the global configuration file to define your script directly (eg. foo)...

  • ...Or create a script configuration file (eg. helloworld.yaml)

name: "Hello World"                  # required. Script phase name.

# One and only one :script_path or :script may appear.
# For now, it makes no sense to have 2 differents script sources.
script_path: "Script/helloworld.sh"  # required. Script file path.
script: |                            # required. Script.
  <some code lines>
  <other code lines>

input_paths:                         # optional.
  - ""

output_paths: # optional.
  - ""

input_file_list_paths:               # optional.
  - ""

output_file_list_paths:              # optional.
  - ""

dependency_file:                     # optional.

execution_position:                  # optional. [:before_compile | :after_compile | :before_headers | :after_headers | :after_all].

show_env_vars_in_log:                # optional. Set to '0' if you want to hide environment variables, any other values will allow them.

always_out_of_date:                  # optional. Set to '1' if the script should always run without dependency analysis.
  • If you use the script_path option, create the script file
echo Hello World

Execution

Finally, inject script phases

spinjector [-c] <path-to-your-global-configuration-file>

Enjoy your build phases Image of your build phases Image of hello world 2 build phase

How to contribute

  1. After all your changes are reviewed and merged
  2. Create a release branch
  3. Update the version in field s.version from file spinjector.gemspec
  4. Execute make publish

You may need to configure your account at step 4. if you've never pushed any gem. You can find all the informations you need on the official documentation.

Tests

To run the tests, simply run:

rake test