juretta-ipt 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +50 -25
- data/lib/ipt/rake_helper.rb +25 -0
- data/lib/ipt/version.rb +33 -2
- data/tasks/gitignore.tmpl +9 -0
- data/tasks/iphone_tools.rake +35 -8
- metadata +3 -2
data/README.md
CHANGED
@@ -18,18 +18,6 @@ Installation
|
|
18
18
|
require 'rubygems'
|
19
19
|
gem 'juretta-ipt'
|
20
20
|
load 'iphone_tools.rake'
|
21
|
-
|
22
|
-
CLANG
|
23
|
-
-----
|
24
|
-
If you want to use the static code analysis task (highly recommended). You have to download the checker binary.
|
25
|
-
|
26
|
-
stefan@macbook-pro-2:~/temp$ curl -OL http://keeda.stanford.edu/~kremenek/checker/checker-107.tar.bz2
|
27
|
-
stefan@macbook-pro-2:~/temp$ tar xjf checker-107.tar.bz2 -C /Users/stefan/dev/iphone/clang
|
28
|
-
|
29
|
-
Add the path to the extracted directory to your PATH environment variable. E.g. in ~/.bash_profile
|
30
|
-
|
31
|
-
export CLANG=/Users/stefan/dev/iphone/clang/checker-107
|
32
|
-
export PATH=$PATH:$CLANG
|
33
21
|
|
34
22
|
Rake tasks
|
35
23
|
==========
|
@@ -58,6 +46,16 @@ to show the available tasks:
|
|
58
46
|
Static code analysis
|
59
47
|
--------------------
|
60
48
|
|
49
|
+
If you want to use the static code analysis task (highly recommended). You have to download the checker binary.
|
50
|
+
|
51
|
+
stefan@macbook-pro-2:~/temp$ curl -OL http://keeda.stanford.edu/~kremenek/checker/checker-107.tar.bz2
|
52
|
+
stefan@macbook-pro-2:~/temp$ tar xjf checker-107.tar.bz2 -C /Users/stefan/dev/iphone/clang
|
53
|
+
|
54
|
+
Add the path to the extracted directory to your PATH environment variable. E.g. in ~/.bash_profile
|
55
|
+
|
56
|
+
export CLANG=/Users/stefan/dev/iphone/clang/checker-107
|
57
|
+
export PATH=$PATH:$CLANG
|
58
|
+
|
61
59
|
> The LLVM/Clang static analyzer is a standalone tool that find bugs in C and Objective-C programs.
|
62
60
|
|
63
61
|
Run 'rake ipt:analyze' to run the clang checker. The output of the analyzer is
|
@@ -69,9 +67,6 @@ Please visit the [LLVM/Clang homepage](http://clang.llvm.org/StaticAnalysis.html
|
|
69
67
|
about the "Clang checker".
|
70
68
|
You should probably read the [Recommended Usage Guidelines](http://clang.llvm.org/StaticAnalysisUsage.html#RecommendedUsageGuidelines).
|
71
69
|
|
72
|
-
To run the code analysis run:
|
73
|
-
rake ipt:analyze
|
74
|
-
|
75
70
|
|
76
71
|
Generate HTML-Readme files
|
77
72
|
--------------------------
|
@@ -93,15 +88,27 @@ Supported formats:
|
|
93
88
|
[4]: http://textism.com/tools/textile/
|
94
89
|
[5]: http://rdoc.sourceforge.net/doc/
|
95
90
|
|
96
|
-
Unit testing with rbiphonetest
|
97
|
-
------------------------------
|
98
91
|
|
99
|
-
|
100
|
-
|
92
|
+
List (TODO|FIXME) Markers in your source code files
|
93
|
+
---------------------------------------------------
|
101
94
|
|
102
|
-
|
95
|
+
Suppose you added a TODO marker in one of your classes.
|
96
|
+
|
97
|
+
Run
|
98
|
+
|
99
|
+
rake ipt:todo
|
100
|
+
|
101
|
+
to list TODO|FIXME|IMPROVE markers in the source code.
|
102
|
+
|
103
|
+
Classes/DomainSearch.m
|
104
|
+
95: // TODO: Do we need a custom NSAutoreleasePool??
|
103
105
|
|
104
106
|
|
107
|
+
Easily create AdHoc distribution builds.
|
108
|
+
---------------------------------------
|
109
|
+
|
110
|
+
**More documentation needed.**
|
111
|
+
|
105
112
|
Xcode and git
|
106
113
|
=============
|
107
114
|
|
@@ -115,10 +122,16 @@ Run the
|
|
115
122
|
task to generate an HTML and XMl changelog file in the 'doc' subdirectory in your Xcode project directory.
|
116
123
|
The updated changelog files will be added and commited to your local git repository automatically.
|
117
124
|
|
118
|
-
Xcode
|
119
|
-
|
120
|
-
|
121
|
-
|
125
|
+
Xcode specific .gitignore
|
126
|
+
-------------------------
|
127
|
+
|
128
|
+
The
|
129
|
+
|
130
|
+
rake ipt:git:ignore
|
131
|
+
|
132
|
+
target either creates a new .gitignore file in your project directory or
|
133
|
+
adds the following lines to your existing .gitignore file (but only if the are not already in there):
|
134
|
+
|
122
135
|
|
123
136
|
build
|
124
137
|
*.mode1v3
|
@@ -130,6 +143,8 @@ user specific settings:
|
|
130
143
|
*.perspective
|
131
144
|
*.perspectivev3
|
132
145
|
|
146
|
+
git now will ignore Xcode build artifacts and user specific settings.
|
147
|
+
|
133
148
|
Xcode git build number script
|
134
149
|
-----------------------------
|
135
150
|
|
@@ -192,4 +207,14 @@ executable.
|
|
192
207
|
pl.save_plist(PLIST_FILE)
|
193
208
|
end
|
194
209
|
end
|
195
|
-
|
210
|
+
|
211
|
+
Useful Tools
|
212
|
+
============
|
213
|
+
|
214
|
+
rbiphonetest
|
215
|
+
------------
|
216
|
+
|
217
|
+
Have a look at [rbiphonetest][6] if you want to easily test your Foundation classes. The rbiphonetest git repository lives here: [http://github.com/drnic/rbiphonetest/tree/master](http://github.com/drnic/rbiphonetest/tree/master)
|
218
|
+
|
219
|
+
[6]: http://drnicwilliams.com/2008/07/04/unit-testing-iphone-apps-with-ruby-rbiphonetest/
|
220
|
+
|
data/lib/ipt/rake_helper.rb
CHANGED
@@ -27,4 +27,29 @@ module RakeHelper
|
|
27
27
|
last_tag = last_tag.split('-').first if last_tag =~ /-/
|
28
28
|
IPT::Version.parse(last_tag)
|
29
29
|
end
|
30
|
+
|
31
|
+
def get_previous_version(current_version)
|
32
|
+
tags = `#{GIT} tag -l`.split("\n")
|
33
|
+
resolve_previous_version(tags, current_version)
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
private
|
38
|
+
def resolve_previous_version(tags, current_version)
|
39
|
+
versions = tags.inject([]) do |v, tag|
|
40
|
+
begin
|
41
|
+
version = IPT::Version.parse(tag)
|
42
|
+
v << version
|
43
|
+
rescue => e
|
44
|
+
# ignore - there might be other tags we are not interested in
|
45
|
+
end
|
46
|
+
v
|
47
|
+
end
|
48
|
+
versions.compact!
|
49
|
+
versions.sort!
|
50
|
+
|
51
|
+
idx = versions.index(current_version)
|
52
|
+
return nil unless idx && idx > 0
|
53
|
+
versions[idx-1]
|
54
|
+
end
|
30
55
|
end
|
data/lib/ipt/version.rb
CHANGED
@@ -15,9 +15,12 @@ module IPT
|
|
15
15
|
#
|
16
16
|
# puts version # => "2.3.9"
|
17
17
|
class Version
|
18
|
+
|
19
|
+
include Comparable
|
20
|
+
|
18
21
|
class << self
|
19
22
|
def parse(str)
|
20
|
-
raise ArgumentError.new("Invalid version string: #{str}") unless str && str =~
|
23
|
+
raise ArgumentError.new("Invalid version string: #{str}") unless str && str =~ /^[0-9]+(\.[0-9]+)?/
|
21
24
|
Version.new(*str.split("."))
|
22
25
|
end
|
23
26
|
end
|
@@ -39,7 +42,35 @@ module IPT
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def to_s
|
42
|
-
PARTS.map{|part| self.send(part)}.join('.')
|
45
|
+
PARTS.map{|part| self.send(part)}.compact.join('.')
|
46
|
+
end
|
47
|
+
|
48
|
+
def ==(other)
|
49
|
+
return false unless other.is_a?(IPT::Version)
|
50
|
+
PARTS.each do |part|
|
51
|
+
return false unless self.send(part).eql?(other.send(part))
|
52
|
+
end
|
53
|
+
true
|
54
|
+
end
|
55
|
+
|
56
|
+
def eql?(other)
|
57
|
+
self == other
|
58
|
+
end
|
59
|
+
|
60
|
+
# Comparable
|
61
|
+
def <=>(other)
|
62
|
+
return nil unless other
|
63
|
+
PARTS.each do |part|
|
64
|
+
return nil unless other.respond_to?(part)
|
65
|
+
vo = other.send(part)
|
66
|
+
so = self.send(part)
|
67
|
+
return -1 if so.nil? && vo
|
68
|
+
return 1 if vo.nil? && so
|
69
|
+
return 0 if vo.nil? && so.nil?
|
70
|
+
c = (so <=> vo)
|
71
|
+
return c unless c == 0
|
72
|
+
end
|
73
|
+
0
|
43
74
|
end
|
44
75
|
|
45
76
|
private
|
data/tasks/iphone_tools.rake
CHANGED
@@ -40,7 +40,7 @@ namespace :ipt do
|
|
40
40
|
|
41
41
|
namespace :adhoc do
|
42
42
|
#desc "Create an AdHoc distriution build"
|
43
|
-
task :build
|
43
|
+
task :build do
|
44
44
|
rm_r BUILD_DIR if File.directory?(BUILD_DIR)
|
45
45
|
target = find_current_project_name
|
46
46
|
sh "xcodebuild -target '#{target}' -configuration '#{ADHOC_CONFIGURATION_NAME}'"
|
@@ -53,10 +53,11 @@ namespace :ipt do
|
|
53
53
|
|
54
54
|
# The Adhoc build depends on git
|
55
55
|
with('git') do
|
56
|
-
|
57
|
-
|
56
|
+
|
57
|
+
desc "Prepare next version by incrementing the current tag"
|
58
|
+
task :tag_next_version => :inject do
|
58
59
|
last_tag = resolve_tag
|
59
|
-
puts "
|
60
|
+
puts "Current tag: #{last_tag}"
|
60
61
|
NEW_TAG = last_tag.increase!.to_s
|
61
62
|
puts "New tag/version: #{NEW_TAG}"
|
62
63
|
|
@@ -78,8 +79,8 @@ namespace :ipt do
|
|
78
79
|
`#{GIT} tag -a -m "Preparing release for version '#{NEW_TAG}'." #{NEW_TAG}`
|
79
80
|
end
|
80
81
|
|
81
|
-
desc "Create an
|
82
|
-
task :
|
82
|
+
desc "Create an AdHoc bundle in in #{RELEASES_DIR} based on the current tag"
|
83
|
+
task :snapshot => :build do
|
83
84
|
target = find_current_project_name
|
84
85
|
src = File.join(BUILD_DIR, "#{ADHOC_CONFIGURATION_NAME}-iphoneos", "#{target}.app")
|
85
86
|
raise "Release build does not exist" unless File.directory?(src)
|
@@ -90,7 +91,7 @@ namespace :ipt do
|
|
90
91
|
mkdir_p path
|
91
92
|
|
92
93
|
current_tag = resolve_tag
|
93
|
-
previous_tag = current_tag
|
94
|
+
previous_tag = get_previous_version(current_tag)
|
94
95
|
|
95
96
|
puts "Creating changelog.txt (#{previous_tag} -> #{current_tag})"
|
96
97
|
|
@@ -105,6 +106,11 @@ namespace :ipt do
|
|
105
106
|
puts 'Creating tar.gz'
|
106
107
|
`tar czf #{RELEASES_DIR}/#{dir_name}.tgz -C #{path} .`
|
107
108
|
end
|
109
|
+
|
110
|
+
desc "Create a new version tag and build/archive an Ad-Hoc bundle in #{RELEASES_DIR}"
|
111
|
+
task :release => [:tag_next_version, :build, :snapshot] do
|
112
|
+
#
|
113
|
+
end
|
108
114
|
end
|
109
115
|
|
110
116
|
end
|
@@ -179,7 +185,28 @@ namespace :ipt do
|
|
179
185
|
namespace :git do
|
180
186
|
desc "Create a .gitignore file or add XCode related ignore pattern to your existing .gitignore file."
|
181
187
|
task :ignore do
|
182
|
-
|
188
|
+
IGNORE_FILE = File.join(Dir.pwd, ".gitignore").freeze
|
189
|
+
ignore_lines_to_add = IO.readlines(File.join(File.dirname(__FILE__), 'gitignore.tmpl')).map{|line| line.strip}
|
190
|
+
if File.file?(IGNORE_FILE)
|
191
|
+
puts "\tAbout to add ignore lines to existing .gitignore file"
|
192
|
+
existing_lines = IO.readlines(IGNORE_FILE).map{|line| line.strip}
|
193
|
+
diff = ignore_lines_to_add - existing_lines
|
194
|
+
p diff if $DEBUG
|
195
|
+
if diff.empty?
|
196
|
+
puts "\tThe existing .gitgnore file already contains all the necessary lines. Not changing .gitignore."
|
197
|
+
else
|
198
|
+
puts "\tAdding #{diff.size} entry/entries:\n"
|
199
|
+
print diff.map{|line| "\t\t* #{line}\n"}
|
200
|
+
File.open(IGNORE_FILE, "a") do |f|
|
201
|
+
f << diff.join("\n")
|
202
|
+
end
|
203
|
+
end
|
204
|
+
else
|
205
|
+
puts "\tCreating a new .gitignore file"
|
206
|
+
File.open(IGNORE_FILE, "w") do |f|
|
207
|
+
f << ignore_lines_to_add.join("\n")
|
208
|
+
end
|
209
|
+
end
|
183
210
|
end
|
184
211
|
|
185
212
|
desc "Create a changelog (doc/changelog.html and doc/changelog.xml) based on your git commits."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juretta-ipt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Saasen
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-03 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -30,6 +30,7 @@ files:
|
|
30
30
|
- lib/ipt/version.rb
|
31
31
|
- lib/ipt.rb
|
32
32
|
- tasks/changelog.tmpl
|
33
|
+
- tasks/gitignore.tmpl
|
33
34
|
- tasks/iphone_tools.rake
|
34
35
|
- tasks/rakefile.tmpl
|
35
36
|
- README.md
|