Skip to content

Commit

Permalink
add ability to pass along custom frameworks
Browse files Browse the repository at this point in the history
Example in your project Rakefile:
  app.vendor_project('frameworks/DesignableKit', :static, { ib: true })

passing `ib: true` in the opts for vendor_project will include the dirs h/m
files in a custom framework for you.
  • Loading branch information
malkomalko committed Sep 5, 2014
1 parent 2fe7733 commit fafe374
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/ib/project.rb
Expand Up @@ -109,6 +109,27 @@ def add_frameworks
DEFAULT_FRAMEWORKS.each do |framework|
target.add_system_framework framework
end

extra_frameworks.each do |framework|
add_extra_framework framework
end
end

def extra_frameworks
extra_frameworks = Motion::Project::App.config.vendor_projects
extra_frameworks = extra_frameworks.select { |vp| vp.opts[:ib] }
end

def add_extra_framework(framework)
framework_name = framework.path.split('/').last
framework_group = project.new_group(framework_name)
framework_group.path = File.join(project_path, framework.path)
framework_target = project.new_target(:framework, framework_name, platform)
Dir.glob("#{framework.path}/**/*.{h,m}") do |file|
file_ref = framework_group.new_file File.join(project_path, file)
framework_target.add_file_references([file_ref])
puts "path: #{framework.path}, file: #{file}"
end
end

def ib_project_path
Expand Down

0 comments on commit fafe374

Please sign in to comment.