xcodebuild_rake 2.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gemrc +1 -0
- data/.gitignore +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +25 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/xcodebuild_rake_init +8 -0
- data/docs/configuration.md +43 -0
- data/docs/installation.md +11 -0
- data/docs/prerequisites.md +34 -0
- data/docs/usage.md +71 -0
- data/lib/.DS_Store +0 -0
- data/lib/ExportOptions.plist +10 -0
- data/lib/model/build_configuration.rb +90 -0
- data/lib/model/release_configuration.rb +46 -0
- data/lib/model/test_destination.rb +41 -0
- data/lib/model/upload_configuration.rb +63 -0
- data/lib/modules/applause_tool.rb +18 -0
- data/lib/modules/plist.rb +31 -0
- data/lib/modules/s3.rb +19 -0
- data/lib/modules/xcode.rb +142 -0
- data/lib/modules/zip.rb +18 -0
- data/lib/tasks/applause_pod.rake +75 -0
- data/lib/tasks/framework.rake +49 -0
- data/lib/tasks/notify.rake +9 -0
- data/lib/tasks/podspec.rake +85 -0
- data/lib/tasks/testapp.rake +48 -0
- data/lib/tasks/version_number.rake +83 -0
- data/lib/xcodebuild_rake.rb +29 -0
- data/lib/xcodebuild_rake/version.rb +3 -0
- data/lib/xcodebuild_safe.sh +38 -0
- data/templates/Rakefile +54 -0
- data/templates/build.yaml +15 -0
- data/xcodebuild_rake.gemspec +32 -0
- metadata +157 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: df45156398ee3c6d3a50194def99c6716f7dfb11
|
4
|
+
data.tar.gz: bcd569f47991bcd12f8b50c19d86aeab4b0d2eb3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3958fd0ca7031fe19bcaef150ae5b65580faca3d98a8e85e48dfeda6c58d908bf9f831b1ef8b5a5270c50cdd9880f8e9b5e4d65bc204eb7a6f4b52e11f41f23f
|
7
|
+
data.tar.gz: def5e8cbf38b9e3122fadad8de79b52b343b04566e93c8e9907bfbd501c8ad3d0739f8d3e3be4a6f997a4ff600474da69a9b82ee0a08f50c197260ad6ee3cb21
|
data/.gemrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gem: --no-ri --no-rdoc
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
!/lib/
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at lprzytula@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Applause inc. All rights reserved.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# XcodebuildRake
|
2
|
+
|
3
|
+
Simple Ruby Rake build script for Xcode projects. It uses `xcodebuild` and `xcpretty` tools.
|
4
|
+
|
5
|
+
## Installation and usage
|
6
|
+
|
7
|
+
- [**Prerequisites**](./docs/prerequisites.md)
|
8
|
+
- [**Installation**](./docs/installation.md)
|
9
|
+
- [**Configuration**](./docs/configuration.md)
|
10
|
+
- [**Usage**](./docs/usage.md)
|
11
|
+
|
12
|
+
## Development
|
13
|
+
|
14
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
15
|
+
|
16
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
17
|
+
|
18
|
+
## Contributing
|
19
|
+
|
20
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ApplauseAQI/xcodebuild-rake. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
21
|
+
|
22
|
+
|
23
|
+
## License
|
24
|
+
|
25
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "xcodebuild_rake"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
templates_dir = File.join(File.dirname(__FILE__), '../templates')
|
4
|
+
current_dir = Dir.pwd
|
5
|
+
puts "Adding Rakefile"
|
6
|
+
FileUtils.cp(File.join(templates_dir, "Rakefile"), File.join(current_dir, "Rakefile"))
|
7
|
+
puts "Adding build.yaml"
|
8
|
+
FileUtils.cp(File.join(templates_dir, "build.yaml"), File.join(current_dir, "build.yaml"))
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# Configuration
|
2
|
+
|
3
|
+
The main two files which must be placed next to `.xcodeproj` are `Rakefile` and `build.yaml`.
|
4
|
+
|
5
|
+
To initialize those files with default values simply execute from the root of your project:
|
6
|
+
|
7
|
+
```
|
8
|
+
$ xcodebuild_rake_init
|
9
|
+
```
|
10
|
+
|
11
|
+
## Build.yaml
|
12
|
+
|
13
|
+
This file contains `setups` which are used to invoke `xcodebuild`, parameters reflects the arguments you would provide manually to CLI tool.
|
14
|
+
|
15
|
+
By default there are 2 setups:
|
16
|
+
```
|
17
|
+
setups:
|
18
|
+
|
19
|
+
- name: Default
|
20
|
+
sdk: iphoneos
|
21
|
+
workspace:
|
22
|
+
scheme:
|
23
|
+
configuration: Release
|
24
|
+
|
25
|
+
- name: Specs
|
26
|
+
sdk: iphonesimulator
|
27
|
+
xcpretty-flags: -c -t -r junit
|
28
|
+
destination:
|
29
|
+
platform: iOS Simulator
|
30
|
+
name: iPhone 6
|
31
|
+
os: 9.0
|
32
|
+
```
|
33
|
+
|
34
|
+
|
35
|
+
Setup `Default` is used for building and archiving and it's base setup for any other. Which means that you don't need to repeat setup for fields which can be take from default one. Setup `Specs` is used for `test` task.
|
36
|
+
|
37
|
+
`scheme` property is left blank for you to fill in your default scheme.
|
38
|
+
|
39
|
+
If you're using workspace fill in setting `workspace`, otherwise you can remove it.
|
40
|
+
|
41
|
+
## Rakefile
|
42
|
+
|
43
|
+
You must modify `PRODUCT_NAME` constant from the `Rakefile`, use the value of `PRODUCT_NAME` from your Xcode settings (most likely `.xcodeproj` or `.xcworkspace` name)
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Prerequisites
|
2
|
+
|
3
|
+
The build script fetches it dependencies using `bundler` and configuration file `Gemfile`. In order to make sure that all ruby dependencies are sandboxed within the project it's recommended to use RVM ([rvm.io](https://rvm.io)).
|
4
|
+
|
5
|
+
To install RVM on your machine invoke the following
|
6
|
+
|
7
|
+
```
|
8
|
+
$ curl -sSL https://get.rvm.io | bash -s stable --ruby
|
9
|
+
```
|
10
|
+
and then simply install desired version of Ruby:
|
11
|
+
```
|
12
|
+
$ rvm install 2.2.1
|
13
|
+
$ rvm use 2.2.1
|
14
|
+
```
|
15
|
+
|
16
|
+
Create `gemset` for your project (e.g. MyProject):
|
17
|
+
|
18
|
+
```
|
19
|
+
$ rvm use 2.2.1@my-project --create
|
20
|
+
|
21
|
+
```
|
22
|
+
|
23
|
+
Lastly install `bundler`:
|
24
|
+
```
|
25
|
+
$ gem install bundler
|
26
|
+
```
|
27
|
+
|
28
|
+
## Uploading applications to Applause SDK / Beta
|
29
|
+
|
30
|
+
In order to upload .ipa or .apk files to Applause SDK or Beta, install applause-tool cli using pip:
|
31
|
+
|
32
|
+
```
|
33
|
+
$ pip install applause-tool
|
34
|
+
```
|
data/docs/usage.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Usage
|
2
|
+
|
3
|
+
Rakefile is based on our in-house build script (soon to be extract as submodule or ruby gem), which provides helpers functions for executing builds from command line.
|
4
|
+
|
5
|
+
Build script setup is defined in the `build.yaml` file. There you can find a `Default` configuration which is a starting point for each task. Plus all additional configurations for specific tasks, e.g. "Specs" configuration defines destination of the test execution.
|
6
|
+
|
7
|
+
Once the build-script is extracted into separate project the documentation of the `build.yaml` will be provided.
|
8
|
+
|
9
|
+
###Clean
|
10
|
+
|
11
|
+
To clean the project invoke the following:
|
12
|
+
|
13
|
+
```
|
14
|
+
$ rake clean
|
15
|
+
```
|
16
|
+
|
17
|
+
### Build
|
18
|
+
|
19
|
+
To build the project invoke the following:
|
20
|
+
|
21
|
+
```
|
22
|
+
$ rake build
|
23
|
+
```
|
24
|
+
|
25
|
+
Result of the task can be found under `build` directory.
|
26
|
+
|
27
|
+
### Archive
|
28
|
+
|
29
|
+
To archive the project for distribution invoke the following:
|
30
|
+
|
31
|
+
```
|
32
|
+
$ rake archive
|
33
|
+
```
|
34
|
+
|
35
|
+
The result of this task are zipped .app and .dSYM files that are located `build` directory.
|
36
|
+
|
37
|
+
### Test
|
38
|
+
|
39
|
+
To build the project invoke the following:
|
40
|
+
|
41
|
+
```
|
42
|
+
$ rake test
|
43
|
+
```
|
44
|
+
|
45
|
+
The JUnit formatted test output XML can be found under `build/reports/junit.xml`.
|
46
|
+
|
47
|
+
|
48
|
+
### Watch
|
49
|
+
|
50
|
+
To speed up the local development and receive quick feedback when something goes wrong you can use `watch` task. To use this task you first need to install two tools: `fswatch` (repo [here](https://github.com/emcrisostomo/fswatch)):
|
51
|
+
|
52
|
+
```
|
53
|
+
$ brew install fswatch
|
54
|
+
```
|
55
|
+
|
56
|
+
and `terminal-notifier` (repo [here](https://github.com/alloy/terminal-notifier)) which is added to `Gemfile`. This way, whenever something goes wrong you will get a Mac OS notification.
|
57
|
+
|
58
|
+
Once you have it on your machine, simply invoke the `watch` task:
|
59
|
+
|
60
|
+
```
|
61
|
+
$ rake watch
|
62
|
+
```
|
63
|
+
|
64
|
+
From now on, every time you change something in your source code, it will be immediately incrementally complied. This feedback is extremely useful when one starts his journey with Swift lang.
|
65
|
+
|
66
|
+
|
67
|
+
You can also execute tests for each change with the following task:
|
68
|
+
|
69
|
+
```
|
70
|
+
$ rake watch_test
|
71
|
+
```
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>method</key>
|
6
|
+
<string>enterprise</string>
|
7
|
+
<key>compileBitcode</key>
|
8
|
+
<true/>
|
9
|
+
</dict>
|
10
|
+
</plist>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# Copyright (c) 2017 Applause Inc. All rights reserved.
|
2
|
+
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
BUILD_CONFIGURATION_YAML_PATH = 'build.yaml'
|
6
|
+
|
7
|
+
YAML_SETUPS_KEY = 'setups'
|
8
|
+
YAML_DEFAULT_SETUP_NAME = 'Default'
|
9
|
+
YAML_SETUP_NAME_KEY = 'name'
|
10
|
+
YAML_SETUP_WORKSPACE_KEY = 'workspace'
|
11
|
+
YAML_SETUP_PROJECT_KEY = 'project'
|
12
|
+
YAML_SETUP_SCHEME_KEY = 'scheme'
|
13
|
+
YAML_SETUP_SDK_KEY = 'sdk'
|
14
|
+
YAML_SETUP_CONF_KEY = 'configuration'
|
15
|
+
YAML_SETUP_DESTINATION_KEY = 'destination'
|
16
|
+
YAML_SETUP_RELEASE_CONFIGURATION_KEY = 'release_configuration'
|
17
|
+
|
18
|
+
class BuildConfiguration
|
19
|
+
attr_accessor :project, :project_load, :scheme, :sdk, :configuration
|
20
|
+
attr_accessor :release_configuration
|
21
|
+
attr_accessor :test_destination
|
22
|
+
attr_accessor :use_xcpretty, :xcpretty_flags
|
23
|
+
|
24
|
+
def initialize()
|
25
|
+
@use_xcpretty = true
|
26
|
+
@xcpretty_flags = "-c"
|
27
|
+
end
|
28
|
+
|
29
|
+
def parse_setup(setup)
|
30
|
+
if setup.has_key?(YAML_SETUP_WORKSPACE_KEY)
|
31
|
+
@project = setup[YAML_SETUP_WORKSPACE_KEY]
|
32
|
+
@project_load = "-workspace"
|
33
|
+
end
|
34
|
+
if setup.has_key?(YAML_SETUP_PROJECT_KEY)
|
35
|
+
@project = setup[YAML_SETUP_PROJECT_KEY]
|
36
|
+
@project_load = "-project"
|
37
|
+
end
|
38
|
+
if setup.has_key?(YAML_SETUP_SCHEME_KEY)
|
39
|
+
@scheme = setup[YAML_SETUP_SCHEME_KEY]
|
40
|
+
end
|
41
|
+
if setup.has_key?(YAML_SETUP_SDK_KEY)
|
42
|
+
@sdk = setup[YAML_SETUP_SDK_KEY]
|
43
|
+
end
|
44
|
+
if setup.has_key?(YAML_SETUP_CONF_KEY)
|
45
|
+
@configuration = setup[YAML_SETUP_CONF_KEY]
|
46
|
+
end
|
47
|
+
if setup.has_key?(YAML_SETUP_XCPRETTY_KEY)
|
48
|
+
@use_xcpretty = setup[YAML_SETUP_XCPRETTY_KEY]
|
49
|
+
end
|
50
|
+
if setup.has_key?(YAML_SETUP_XCPRETTY_FLAGS_KEY)
|
51
|
+
@xcpretty_flags = setup[YAML_SETUP_XCPRETTY_FLAGS_KEY]
|
52
|
+
end
|
53
|
+
if setup.has_key?(YAML_SETUP_RELEASE_CONFIGURATION_KEY)
|
54
|
+
if self.release_configuration.nil?
|
55
|
+
@release_configuration = ReleaseConfiguration.new
|
56
|
+
end
|
57
|
+
@release_configuration.parse_setup(setup[YAML_SETUP_RELEASE_CONFIGURATION_KEY])
|
58
|
+
end
|
59
|
+
if setup.has_key?(YAML_SETUP_DESTINATION_KEY)
|
60
|
+
if self.test_destination.nil?
|
61
|
+
@test_destination = TestDestination.new
|
62
|
+
end
|
63
|
+
@test_destination.parse_setup(setup[YAML_SETUP_DESTINATION_KEY])
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
class << self
|
68
|
+
def load(setup_name)
|
69
|
+
build_config = BuildConfiguration.new
|
70
|
+
yaml = YAML.load_file(BUILD_CONFIGURATION_YAML_PATH)
|
71
|
+
if yaml.has_key?(YAML_SETUPS_KEY)
|
72
|
+
setups = yaml[YAML_SETUPS_KEY]
|
73
|
+
parse_named_setup setups, build_config, YAML_DEFAULT_SETUP_NAME
|
74
|
+
if setup_name != YAML_DEFAULT_SETUP_NAME
|
75
|
+
parse_named_setup setups, build_config, setup_name
|
76
|
+
end
|
77
|
+
end
|
78
|
+
return build_config
|
79
|
+
end
|
80
|
+
|
81
|
+
private
|
82
|
+
def parse_named_setup(setups, build_config, setup_name)
|
83
|
+
filtered_setups = setups.select { |s| s[YAML_SETUP_NAME_KEY] == setup_name}
|
84
|
+
setup = filtered_setups.first
|
85
|
+
if setup
|
86
|
+
build_config.parse_setup(setup)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|