xcodeproject 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -105,26 +105,30 @@ Or remove from target's build phase:
105
105
 
106
106
  Building the project
107
107
  ---
108
- XcodeProject uses XcodeBuilder for building projects
108
+ XcodeProject uses Rake and XcodeBuilder for building projects.
109
109
 
110
- Building the project:
110
+ You need to create a `rakefile`, a simple look like this:
111
111
 
112
- proj.build
113
-
114
- Cleaning the project:
112
+ require 'rubygems'
113
+ require 'xcodeproject'
115
114
 
116
- proj.clean
115
+ proj = XcodeProject::Project.new('path/to/example.xcodeproj')
116
+ XcodeProject::Tasks::BuildTask.new(proj)
117
117
 
118
- Archiving the project:
118
+ You will now have access to a variety of tasks such as clean and build. A full list of tasks can be viewed by running `rake -T`:
119
119
 
120
- proj.builder.scheme = 'example'
121
- proj.archive
120
+ $ rake -T
121
+ rake example:archive # Creates an archive build of the specified target(s).
122
+ rake example:build # Builds the specified target(s).
123
+ rake example:clean # Cleans the build using the same build settings.
124
+ rake example:cleanbuild # Builds the specified target(s) from a clean slate.
122
125
 
123
- You can specify options for builder:
126
+ Configuring your tasks:
124
127
 
125
- proj.builder.configuration = 'Debug'
126
- proj.builder.arch = 'armv7'
127
- proj.build
128
+ XcodeProject::Tasks::BuildTask.new(proj) do
129
+ t.target = "libexample"
130
+ t.configuration = "Release"
131
+ end
128
132
 
129
133
  You can find out more about XcodeBuilder [here][xcodebuilder].
130
134
 
@@ -20,14 +20,13 @@
20
20
  # IN THE SOFTWARE.
21
21
  #++
22
22
 
23
- require 'xcodeproject/builder'
23
+ require 'xcodeproject/tasks/build_task'
24
24
  require 'xcodeproject/data'
25
25
  require 'pathname'
26
26
  require 'find'
27
27
 
28
28
  module XcodeProject
29
29
  class Project
30
- attr_reader :builder
31
30
  attr_reader :bundle_path
32
31
  attr_reader :file_path
33
32
  attr_reader :name
@@ -47,12 +46,6 @@ module XcodeProject
47
46
  @bundle_path = path
48
47
  @file_path = bundle_path.join('project.pbxproj')
49
48
  @name = bundle_path.basename('.*').to_s
50
-
51
- @builder = Builder.new do |t|
52
- t.project_name = path.basename
53
- t.invoke_from_within = path.dirname
54
- t.formatter = XcodeBuild::Formatters::ProgressFormatter.new
55
- end
56
49
  end
57
50
 
58
51
  def change
@@ -71,18 +64,6 @@ module XcodeProject
71
64
  end
72
65
  end
73
66
 
74
- def build
75
- builder.build
76
- end
77
-
78
- def clean
79
- builder.clean
80
- end
81
-
82
- def archive
83
- builder.archive
84
- end
85
-
86
67
  def doctor
87
68
  change {|data| data.doctor }
88
69
  end
@@ -0,0 +1,16 @@
1
+ require 'xcodebuild'
2
+
3
+ module XcodeProject
4
+ module Tasks
5
+ class BuildTask < XcodeBuild::Tasks::BuildTask
6
+ def initialize (project, &block)
7
+ super(project.name, &block)
8
+
9
+ @formatter ||= XcodeBuild::Formatters::ProgressFormatter.new
10
+ @project_name = project.bundle_path.basename.to_s
11
+ @invoke_from_within = project.bundle_path.dirname
12
+ end
13
+ end
14
+ end
15
+ end
16
+
@@ -1,3 +1,3 @@
1
1
  module XcodeProject
2
- VERSION = "0.2.4"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 4
9
- version: 0.2.4
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Andrey Nesterov
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-06-15 00:00:00 +04:00
17
+ date: 2012-06-26 00:00:00 +04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -112,7 +112,6 @@ files:
112
112
  - README.md
113
113
  - lib/xcodeproject.rb
114
114
  - lib/xcodeproject/build_phase_node.rb
115
- - lib/xcodeproject/builder.rb
116
115
  - lib/xcodeproject/data.rb
117
116
  - lib/xcodeproject/exceptions.rb
118
117
  - lib/xcodeproject/extend/array.rb
@@ -128,6 +127,7 @@ files:
128
127
  - lib/xcodeproject/pbx_project.rb
129
128
  - lib/xcodeproject/project.rb
130
129
  - lib/xcodeproject/root_node.rb
130
+ - lib/xcodeproject/tasks/build_task.rb
131
131
  - lib/xcodeproject/uuid_generator.rb
132
132
  - lib/xcodeproject/version.rb
133
133
  - lib/xcodeproject/xc_build_configuration.rb
@@ -1,21 +0,0 @@
1
- require 'xcodebuild'
2
-
3
- module XcodeProject
4
- class Builder < XcodeBuild::Tasks::BuildTask
5
- def initialize (&block)
6
- super(block)
7
- end
8
-
9
- def build
10
- run('build')
11
- end
12
-
13
- def clean
14
- run('clean')
15
- end
16
-
17
- def archive
18
- run('archive')
19
- end
20
- end
21
- end