Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update documentation on build phases #209

Merged
merged 3 commits into from
May 27, 2020
Merged
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
23 changes: 20 additions & 3 deletions docs/Cakefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,32 @@ end

##### Shell Script Build Phase

You can create a Shell Script buld phase to run a script when building.
You can create a Shell Script build phase to run a script when building.
The following creates a simple script printing `Hello World`:

```ruby
target.shell_script_build_phase "Build Phase Name", <<-SCRIPT
echo "Hello World"
target.shell_script_build_phase "Build Phase Name", "echo 'Hello World'"
end
```

You can optionally define input- and output (file list) paths, combinbed with a multi-line script, like this:

```ruby
myScript = <<-SCRIPT
echo "This is a multi-line script"
echo "Hello World"
SCRIPT
target.shell_script_build_phase "Build Phase Name", myScript do |phase|
phase.input_paths = ["$(SRCROOT)/$(TARGET_NAME)/**/*.txt"]
phase.output_paths = ["$(SRCROOT)/$(TARGET_NAME)/OutputFiles/MyFile.txt"]
phase.input_file_list_paths = ["$(SRCROOT)/$(TARGET_NAME)/**/*.xcfilelist"]
phase.output_file_list_paths = ["$(SRCROOT)/$(TARGET_NAME)/OutputFiles/MyFileList.xcfilelist"]
end
```

Note: to move the build phase before all other build phases (right before the `Compile Sources` phase), use `target.pre_shell_script_build_phase` instead.


## Configurations

Xcake allows you define a hierarchy of build configuations like you would in Xcode
Expand Down