ios-box 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +32 -0
- data/LICENSE.txt +20 -0
- data/README.md +41 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/ios-box.gemspec +83 -0
- data/lib/ios-box.rb +1 -0
- data/lib/ios_box.rb +239 -0
- data/spec/ios-box_spec.rb +8 -0
- data/spec/spec_helper.rb +12 -0
- metadata +182 -0
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gem "plist"
|
7
|
+
gem "pbxproject"
|
8
|
+
|
9
|
+
# Add dependencies to develop your gem here.
|
10
|
+
# Include everything needed to run rake, tests, features, etc.
|
11
|
+
group :development do
|
12
|
+
gem "rspec", "~> 2.3.0"
|
13
|
+
gem "bundler", "~> 1.0.0"
|
14
|
+
gem "jeweler", "~> 1.5.2"
|
15
|
+
gem "rcov", ">= 0"
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.2)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.5.2)
|
7
|
+
bundler (~> 1.0.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
pbxproject (0.1.0)
|
11
|
+
plist (3.1.0)
|
12
|
+
rake (0.8.7)
|
13
|
+
rcov (0.9.9)
|
14
|
+
rspec (2.3.0)
|
15
|
+
rspec-core (~> 2.3.0)
|
16
|
+
rspec-expectations (~> 2.3.0)
|
17
|
+
rspec-mocks (~> 2.3.0)
|
18
|
+
rspec-core (2.3.1)
|
19
|
+
rspec-expectations (2.3.0)
|
20
|
+
diff-lcs (~> 1.1.2)
|
21
|
+
rspec-mocks (2.3.0)
|
22
|
+
|
23
|
+
PLATFORMS
|
24
|
+
ruby
|
25
|
+
|
26
|
+
DEPENDENCIES
|
27
|
+
bundler (~> 1.0.0)
|
28
|
+
jeweler (~> 1.5.2)
|
29
|
+
pbxproject
|
30
|
+
plist
|
31
|
+
rcov
|
32
|
+
rspec (~> 2.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Mikko Kokkonen
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
IosBox
|
2
|
+
======
|
3
|
+
|
4
|
+
IosBox is collection of Rake Tasks that makes developing iOS apps more easy.
|
5
|
+
It includes rake tasks that take care of updating app Info.plist with proper
|
6
|
+
version information (e.g. build date, GIT hash, etc).
|
7
|
+
Further version will integrate deployment options, such as deploy beta versions
|
8
|
+
to TestFlight.
|
9
|
+
|
10
|
+
Installation
|
11
|
+
============
|
12
|
+
|
13
|
+
Install `IosBox` gem if you haven't done yet so
|
14
|
+
$ gem install ios-box
|
15
|
+
|
16
|
+
Create in the root of your project folder `Rakefile` -file with following contents:
|
17
|
+
|
18
|
+
require 'ios-box'
|
19
|
+
|
20
|
+
IosBox::Tasks.new do |config|
|
21
|
+
config.target = "iosboxdev"
|
22
|
+
end
|
23
|
+
|
24
|
+
Integrate toolbox with your XCode project by executing following command:
|
25
|
+
|
26
|
+
$ rake iosbox:integrate
|
27
|
+
|
28
|
+
Notice! This command will modify your XCode project file and therefore can make your project to stop working.
|
29
|
+
Make sure you have proper backups done.
|
30
|
+
|
31
|
+
Usage
|
32
|
+
=====
|
33
|
+
|
34
|
+
Run `rake -T` in project folder to see available commands.
|
35
|
+
|
36
|
+
Copyright
|
37
|
+
=========
|
38
|
+
|
39
|
+
Copyright (c) 2011 Mikko Kokkonen. See LICENSE.txt for
|
40
|
+
further details.
|
41
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
11
|
+
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "ios-box"
|
16
|
+
gem.homepage = "http://github.com/mikian/ios-box"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{Automates some common tasks in iOS development}
|
19
|
+
gem.description = %Q{ios-box offers automation and easy tasks for some most common tasks in iOS development.}
|
20
|
+
gem.email = "mikko.kokkonen@me.com"
|
21
|
+
gem.authors = ["Mikko Kokkonen"]
|
22
|
+
|
23
|
+
gem.files.include %w(lib/**/*.rb)
|
24
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
25
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
26
|
+
gem.add_runtime_dependency 'pbxproject'
|
27
|
+
gem.add_runtime_dependency 'plist'
|
28
|
+
gem.add_runtime_dependency 'grit'
|
29
|
+
|
30
|
+
gem.add_development_dependency 'rspec', '> 1.2.3'
|
31
|
+
end
|
32
|
+
Jeweler::RubygemsDotOrgTasks.new
|
33
|
+
|
34
|
+
require 'rspec/core'
|
35
|
+
require 'rspec/core/rake_task'
|
36
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
37
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
38
|
+
end
|
39
|
+
|
40
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
41
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
42
|
+
spec.rcov = true
|
43
|
+
end
|
44
|
+
|
45
|
+
task :default => :spec
|
46
|
+
|
47
|
+
require 'rake/rdoctask'
|
48
|
+
Rake::RDocTask.new do |rdoc|
|
49
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
50
|
+
|
51
|
+
rdoc.rdoc_dir = 'rdoc'
|
52
|
+
rdoc.title = "ios-box #{version}"
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.0
|
data/ios-box.gemspec
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ios-box}
|
8
|
+
s.version = "0.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Mikko Kokkonen"]
|
12
|
+
s.date = %q{2011-04-23}
|
13
|
+
s.description = %q{ios-box offers automation and easy tasks for some most common tasks in iOS development.}
|
14
|
+
s.email = %q{mikko.kokkonen@me.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.md"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".rspec",
|
22
|
+
"Gemfile",
|
23
|
+
"Gemfile.lock",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.md",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"ios-box.gemspec",
|
29
|
+
"lib/ios-box.rb",
|
30
|
+
"lib/ios_box.rb",
|
31
|
+
"spec/ios-box_spec.rb",
|
32
|
+
"spec/spec_helper.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/mikian/ios-box}
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.6.2}
|
38
|
+
s.summary = %q{Automates some common tasks in iOS development}
|
39
|
+
s.test_files = [
|
40
|
+
"spec/ios-box_spec.rb",
|
41
|
+
"spec/spec_helper.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_runtime_dependency(%q<plist>, [">= 0"])
|
49
|
+
s.add_runtime_dependency(%q<pbxproject>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
51
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
52
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
53
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
54
|
+
s.add_runtime_dependency(%q<pbxproject>, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<plist>, [">= 0"])
|
56
|
+
s.add_runtime_dependency(%q<grit>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<rspec>, ["> 1.2.3"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<plist>, [">= 0"])
|
60
|
+
s.add_dependency(%q<pbxproject>, [">= 0"])
|
61
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
62
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
63
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
64
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
65
|
+
s.add_dependency(%q<pbxproject>, [">= 0"])
|
66
|
+
s.add_dependency(%q<plist>, [">= 0"])
|
67
|
+
s.add_dependency(%q<grit>, [">= 0"])
|
68
|
+
s.add_dependency(%q<rspec>, ["> 1.2.3"])
|
69
|
+
end
|
70
|
+
else
|
71
|
+
s.add_dependency(%q<plist>, [">= 0"])
|
72
|
+
s.add_dependency(%q<pbxproject>, [">= 0"])
|
73
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
74
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
75
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
76
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
77
|
+
s.add_dependency(%q<pbxproject>, [">= 0"])
|
78
|
+
s.add_dependency(%q<plist>, [">= 0"])
|
79
|
+
s.add_dependency(%q<grit>, [">= 0"])
|
80
|
+
s.add_dependency(%q<rspec>, ["> 1.2.3"])
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
data/lib/ios-box.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'ios_box'
|
data/lib/ios_box.rb
ADDED
@@ -0,0 +1,239 @@
|
|
1
|
+
require 'rake/tasklib'
|
2
|
+
require 'pbxproject'
|
3
|
+
require 'yaml'
|
4
|
+
require 'ostruct'
|
5
|
+
require 'grit'
|
6
|
+
require 'plist'
|
7
|
+
|
8
|
+
module IosBox
|
9
|
+
class Tasks < ::Rake::TaskLib
|
10
|
+
def initialize(namespace = :iosbox, &block)
|
11
|
+
@config = Config.new(
|
12
|
+
:configuration => "Adhoc",
|
13
|
+
:build_style => :months,
|
14
|
+
:bundle_version_style => "V.b",
|
15
|
+
:buildCache => ".buildCache"
|
16
|
+
)
|
17
|
+
yield @config
|
18
|
+
|
19
|
+
# Load build cache
|
20
|
+
@buildCache = BuildCache.load(@config.buildCache) || BuildCache.new
|
21
|
+
@namespace = namespace
|
22
|
+
define
|
23
|
+
end
|
24
|
+
|
25
|
+
class BuildCache
|
26
|
+
def self.load file = ".buildCache"
|
27
|
+
return unless File.file?(file)
|
28
|
+
YAML.load_file(file)
|
29
|
+
end
|
30
|
+
|
31
|
+
def save file = ".buildCache"
|
32
|
+
File.open(file, 'w') { |io| YAML.dump(self, io) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class Config < OpenStruct
|
37
|
+
def initialize args
|
38
|
+
super
|
39
|
+
self.plist = File.join(ENV['PROJECT_DIR'] || '', ENV['INFOPLIST_FILE'] || '')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def define
|
46
|
+
# General namespace
|
47
|
+
namespace(@namespace) do
|
48
|
+
desc "Integrates IosBox to XCode build phases"
|
49
|
+
task :integrate do
|
50
|
+
# Get our xcodeproject from config or find it
|
51
|
+
xcode = @config.project || Dir["*.xcodeproj"].first
|
52
|
+
|
53
|
+
raise "Cannot find project.pbxproj in #{xcode}" unless File.file? "#{xcode}/project.pbxproj"
|
54
|
+
pbx = PBXProject::PBXProject.new :file => "#{xcode}/project.pbxproj"
|
55
|
+
pbx.parse
|
56
|
+
|
57
|
+
# Add build:prepare task to build phases
|
58
|
+
initPhase = PBXProject::PBXTypes::PBXShellScriptBuildPhase.new :shellPath => '/bin/sh', :shellScript => "\"(cd $PROJECT_DIR; rake #{@namespace}:build:prepare)\""
|
59
|
+
pbx.add_item initPhase
|
60
|
+
|
61
|
+
# Add to target
|
62
|
+
target = pbx.find_item :name => @config.target, :type => PBXProject::PBXTypes::PBXNativeTarget
|
63
|
+
target.add_build_phase initPhase, 0
|
64
|
+
|
65
|
+
# Save our project file
|
66
|
+
pbx.write_to :file => "#{xcode}/project.pbxproj"
|
67
|
+
end
|
68
|
+
|
69
|
+
# Version mungle
|
70
|
+
desc "Returns current version string"
|
71
|
+
task :version do
|
72
|
+
@plist = Plist::parse_xml(@config.plist)
|
73
|
+
@config._short_version = @plist["CFBundleShortVersionString"]
|
74
|
+
puts " Short Version: #{@config._short_version}"
|
75
|
+
end
|
76
|
+
|
77
|
+
namespace :version do
|
78
|
+
@ver = {:major => nil, :minor => nil, :patch => nil}
|
79
|
+
def _prepare
|
80
|
+
@git = Grit::Repo.new("#{ENV['PROJECT_DIR']}")
|
81
|
+
@config._commit = @git.commit("HEAD").id_abbrev
|
82
|
+
|
83
|
+
@plist = Plist::parse_xml(@config.plist)
|
84
|
+
if (m = @plist["CFBundleShortVersionString"].match(/(\d+)\.(\d+)(\.(\d+))?/))
|
85
|
+
@ver[:major] = Integer(m[1]) if m[1]
|
86
|
+
@ver[:minor] = Integer(m[2]) if m[2]
|
87
|
+
@ver[:patch] = Integer(m[4]) if m[4]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def _write_back
|
92
|
+
@plist = Plist::parse_xml(@config.plist) unless @plist
|
93
|
+
ver_str = "%d.%d%s" % [ @ver[:major], @ver[:minor], @ver[:patch] ? ".#{@ver[:patch]}" : "" ]
|
94
|
+
@plist["CFBundleShortVersionString"] = ver_str
|
95
|
+
@plist.save_plist(@config.plist)
|
96
|
+
end
|
97
|
+
|
98
|
+
desc "Generates Bundle Version"
|
99
|
+
task :bundlever => ["version", "version:buildnum"] do
|
100
|
+
# Build our components
|
101
|
+
comp = {
|
102
|
+
"M" => @ver[:major],
|
103
|
+
"m" => @ver[:minor],
|
104
|
+
"p" => @ver[:patch],
|
105
|
+
"P" => @ver[:patch] ? ".#{@ver[:patch]}" : "",
|
106
|
+
"b" => @config._build_number,
|
107
|
+
"S" => @config._short_version,
|
108
|
+
"V" => @ver[:major] * 10 + @ver[:minor],
|
109
|
+
"v" => @ver[:major] * 100 + @ver[:minor] * 10 + (@ver[:patch] ? @ver[:patch] : 0),
|
110
|
+
"g" => @config._commit,
|
111
|
+
}
|
112
|
+
compre = Regexp.new("[" + comp.keys.join("") + "]")
|
113
|
+
|
114
|
+
style = case @config.bundle_version_style
|
115
|
+
when :short_version
|
116
|
+
"S"
|
117
|
+
when :buildnum
|
118
|
+
"b"
|
119
|
+
when :githash
|
120
|
+
"g"
|
121
|
+
else
|
122
|
+
@config.bundle_version_style
|
123
|
+
end
|
124
|
+
|
125
|
+
@config._bundle_version = style.gsub(compre) do |s|
|
126
|
+
comp[s]
|
127
|
+
end
|
128
|
+
|
129
|
+
puts "Bundle Version: #{@config._bundle_version}"
|
130
|
+
end
|
131
|
+
|
132
|
+
desc "Generate new build number, depending on selected scheme"
|
133
|
+
task :buildnum do
|
134
|
+
_prepare
|
135
|
+
buildnum = case @config.build_style
|
136
|
+
when :months
|
137
|
+
# Open repository and find out
|
138
|
+
prj_begin = Time.now
|
139
|
+
if (@config.first_revision)
|
140
|
+
prj_begin = @git.commit(@config.first_revision).authored_date
|
141
|
+
elsif (@config.first_date)
|
142
|
+
prj_begin = @config.first_date
|
143
|
+
else
|
144
|
+
prj_begin = @git.log.last.authored_date
|
145
|
+
end
|
146
|
+
|
147
|
+
months = ((Time.now.month + 12 * Time.now.year) - (prj_begin.month + 12 * prj_begin.year))
|
148
|
+
"%d%02d" % [months, Time.now.day]
|
149
|
+
end
|
150
|
+
|
151
|
+
@config._build_number = buildnum
|
152
|
+
puts " Build number: #{buildnum}"
|
153
|
+
end
|
154
|
+
|
155
|
+
desc "Writes exact version number"
|
156
|
+
task :write, :version do |t, args|
|
157
|
+
@plist = Plist::parse_xml(@config.plist)
|
158
|
+
@plist["CFBundleShortVersionString"] = args[:version]
|
159
|
+
@plist.save_plist(@config.plist)
|
160
|
+
puts "Short Version: #{args[:version]}"
|
161
|
+
end
|
162
|
+
|
163
|
+
desc "Bumps version up"
|
164
|
+
task :bump do
|
165
|
+
_prepare
|
166
|
+
|
167
|
+
# if we have patch, bump it up
|
168
|
+
if (@ver[:patch])
|
169
|
+
@ver[:patch] += 1
|
170
|
+
elsif (@ver[:minor])
|
171
|
+
@ver[:minor] += 1
|
172
|
+
else
|
173
|
+
@ver[:major] += 1
|
174
|
+
end
|
175
|
+
_write_back
|
176
|
+
puts "Bumped Version: " + "%d.%d%s" % [ @ver[:major], @ver[:minor], @ver[:patch] ? ".#{@ver[:patch]}" : "" ]
|
177
|
+
end
|
178
|
+
|
179
|
+
namespace :bump do
|
180
|
+
desc "Bumps major version up"
|
181
|
+
task :major do
|
182
|
+
_prepare
|
183
|
+
@ver[:major] = @ver[:major] ? @ver[:major] + 1 : 1
|
184
|
+
@ver[:minor] = 0
|
185
|
+
@ver[:patch] = nil
|
186
|
+
_write_back
|
187
|
+
puts "Bumped Version: " + "%d.%d%s" % [ @ver[:major], @ver[:minor], @ver[:patch] ? ".#{@ver[:patch]}" : "" ]
|
188
|
+
end
|
189
|
+
|
190
|
+
desc "Bumps minor version up"
|
191
|
+
task :minor do
|
192
|
+
_prepare
|
193
|
+
@ver[:minor] = @ver[:minor] ? @ver[:minor] + 1 : 1
|
194
|
+
@ver[:patch] = nil
|
195
|
+
_write_back
|
196
|
+
puts "Bumped Version: " + "%d.%d%s" % [ @ver[:major], @ver[:minor], @ver[:patch] ? ".#{@ver[:patch]}" : "" ]
|
197
|
+
end
|
198
|
+
|
199
|
+
desc "Bumps patch version up"
|
200
|
+
task :patch do
|
201
|
+
_prepare
|
202
|
+
@ver[:patch] = @ver[:patch] ? @ver[:patch] + 1 : 1
|
203
|
+
_write_back
|
204
|
+
puts "Bumped Version: " + "%d.%d%s" % [ @ver[:major], @ver[:minor], @ver[:patch] ? ".#{@ver[:patch]}" : "" ]
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
|
210
|
+
namespace :build do
|
211
|
+
|
212
|
+
desc "Prepares build environment"
|
213
|
+
task :prepare => ["version:bundlever"] do
|
214
|
+
# Save our environment variables
|
215
|
+
["BUILT_PRODUCTS_DIR", "BUILD_DIR", "CONFIGURATION", "CONFIGURATION_BUILD_DIR",
|
216
|
+
"PROJECT_DIR", "INFOPLIST_FILE", "TARGET_NAME"].each { |v|
|
217
|
+
@buildCache.instance_variable_set("@#{v.downcase}", ENV[v])
|
218
|
+
}
|
219
|
+
@buildCache.save
|
220
|
+
|
221
|
+
# Save version info
|
222
|
+
product_plist = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH'])
|
223
|
+
`/usr/bin/plutil -convert xml1 \"#{product_plist}\"`
|
224
|
+
pl = Plist::parse_xml(product_plist)
|
225
|
+
if (pl)
|
226
|
+
pl["CFBundleVersion"] = @config._bundle_version
|
227
|
+
pl["IBBuildNum"] = @config._build_number
|
228
|
+
pl["IBBuildDate"] = Time.new.strftime("%a %e %b %Y %H:%M:%S %Z %z")
|
229
|
+
pl["IBBuildType"] = ENV['CONFIGURATION']
|
230
|
+
pl["GCGitCommitHash"] = @config._commit # for hoptoadapp
|
231
|
+
pl.save_plist(product_plist)
|
232
|
+
end
|
233
|
+
`/usr/bin/plutil -convert binary1 \"#{product_plist}\"`
|
234
|
+
end
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
4
|
+
require 'ios-box'
|
5
|
+
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ios-box
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Mikko Kokkonen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-23 00:00:00 +09:00
|
14
|
+
default_executable:
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: plist
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pbxproject
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: rspec
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.3.0
|
46
|
+
type: :development
|
47
|
+
prerelease: false
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: bundler
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.0.0
|
57
|
+
type: :development
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: jeweler
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.5.2
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rcov
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: pbxproject
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: "0"
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: plist
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: "0"
|
101
|
+
type: :runtime
|
102
|
+
prerelease: false
|
103
|
+
version_requirements: *id008
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: grit
|
106
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
112
|
+
type: :runtime
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: *id009
|
115
|
+
- !ruby/object:Gem::Dependency
|
116
|
+
name: rspec
|
117
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ">"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 1.2.3
|
123
|
+
type: :development
|
124
|
+
prerelease: false
|
125
|
+
version_requirements: *id010
|
126
|
+
description: ios-box offers automation and easy tasks for some most common tasks in iOS development.
|
127
|
+
email: mikko.kokkonen@me.com
|
128
|
+
executables: []
|
129
|
+
|
130
|
+
extensions: []
|
131
|
+
|
132
|
+
extra_rdoc_files:
|
133
|
+
- LICENSE.txt
|
134
|
+
- README.md
|
135
|
+
files:
|
136
|
+
- .document
|
137
|
+
- .rspec
|
138
|
+
- Gemfile
|
139
|
+
- Gemfile.lock
|
140
|
+
- LICENSE.txt
|
141
|
+
- README.md
|
142
|
+
- Rakefile
|
143
|
+
- VERSION
|
144
|
+
- ios-box.gemspec
|
145
|
+
- lib/ios-box.rb
|
146
|
+
- lib/ios_box.rb
|
147
|
+
- spec/ios-box_spec.rb
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
has_rdoc: true
|
150
|
+
homepage: http://github.com/mikian/ios-box
|
151
|
+
licenses:
|
152
|
+
- MIT
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
hash: -258283987276610379
|
164
|
+
segments:
|
165
|
+
- 0
|
166
|
+
version: "0"
|
167
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: "0"
|
173
|
+
requirements: []
|
174
|
+
|
175
|
+
rubyforge_project:
|
176
|
+
rubygems_version: 1.6.2
|
177
|
+
signing_key:
|
178
|
+
specification_version: 3
|
179
|
+
summary: Automates some common tasks in iOS development
|
180
|
+
test_files:
|
181
|
+
- spec/ios-box_spec.rb
|
182
|
+
- spec/spec_helper.rb
|