lib/xcake/project/sugar.rb in xcake-0.5.0 vs lib/xcake/project/sugar.rb in xcake-0.5.1
- old
+ new
@@ -1,9 +1,22 @@
require "xcodeproj"
module Xcake
class Project
+
+ # Passes the project instance to a block. This is used to easily modify the
+ # properties of the project in the DSL.
+ #
+ #
+ # @param [Proc] block
+ # an optional block that configures the project through the DSL.
+ #
+ def project(&block)
+ block.call(self) if block_given?
+ self
+ end
+
# Defines a new application target.
#
# @param [Symbol] platform
# platform for the application, can be either `:ios`, `:osx`, `:tvos` or `:watchos`.
#
@@ -83,9 +96,13 @@
t.type = :watch2_extension
t.platform = :watchos
t.deployment_target = deployment_target
t.language = language
end
+
+ #Xcake needs to add dependencies in generation phase.
+ #target.add_dependency(watch_app_target)
+ #watch_app_target.add_dependency(watch_extension_target)
block.call(watch_app_target, watch_extension_target) if block_given?
return nil
end