lib/xcodeproject/project.rb in xcodeproject-0.1.1 vs lib/xcodeproject/project.rb in xcodeproject-0.2.3
- old
+ new
@@ -18,16 +18,18 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#++
+require 'xcodeproject/builder'
require 'xcodeproject/data'
require 'pathname'
require 'find'
-module XCodeProject
+module XcodeProject
class Project
+ attr_reader :builder
attr_reader :bundle_path
attr_reader :file_path
attr_reader :name
def self.find_projs (path)
@@ -43,10 +45,16 @@
raise FilePathError.new("No such project file '#{path}'.") unless path.exist?
@bundle_path = path
@file_path = bundle_path.join('project.pbxproj')
@name = bundle_path.basename('.*').to_s
+
+ @builder = Builder.new do |t|
+ t.project_name = path.basename
+ t.invoke_from_within = path.dirname
+ t.formatter = XcodeBuild::Formatters::ProgressFormatter.new
+ end
end
def change
data = read
yield data
@@ -59,9 +67,21 @@
def write (data)
File.open(file_path, "w") do |file|
file.write(data.to_plist)
end
+ end
+
+ def build
+ builder.build
+ end
+
+ def clean
+ builder.clean
+ end
+
+ def archive
+ builder.archive
end
def doctor
change {|data| data.doctor }
end