Skip to content

Commit

Permalink
Merge pull request #171 from orta/new_master
Browse files Browse the repository at this point in the history
Simplify example-less projects
  • Loading branch information
orta committed May 10, 2016
2 parents fc1bf45 + 3bd6b0e commit 677f535
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions setup/ProjectManipulator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,19 @@ def remove_demo_project
`rm -rf templates/ios/Example/PROJECT`
`rm -rf templates/swift/Example/PROJECT`

# Remove the section in the Podfile for the lib by removing top 3 lines after the source + using_frameworks!
# Replace the Podfile with a simpler one with only one target
podfile_path = project_folder + "/Podfile"
podfile_lines = File.read(podfile_path).lines
3.times do podfile_lines.delete_at 2 end
podfile_lines.delete_at 3 # inherit-statement
podfile_lines.pop # `end` matching the target
podfile_text = podfile_lines.join
podfile_text = <<-RUBY
use_frameworks!
target '#{test_target.name}' do
pod '#{@configurator.pod_name}', :path => '../'
${INCLUDED_PODS}
end
RUBY
File.open(podfile_path, "w") { |file| file.puts podfile_text }
end
end

def project_folder
File.dirname @xcodeproj_path
Expand Down

0 comments on commit 677f535

Please sign in to comment.