Skip to content

Commit

Permalink
Rake upgrade Cedar for a project. Convenient way to upgrade Cedar sta…
Browse files Browse the repository at this point in the history
…tic frameworks.

- rake upgrade[path_to_framework]
- upgradeCedarFramework script similar to the installCedarFramework
  script

[Finishes #48588443]
  • Loading branch information
Daniel Shusta and Kyriacos Souroullas committed Jan 13, 2014
1 parent e6b5d3b commit f8b0165
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,27 @@ namespace :dist do
end

desc "Build frameworks and install templates and code snippets"
task :install => [ :clean, :uninstall, "dist:prepare" ] do
task :install => [:clean, :uninstall, "dist:prepare"] do
puts "\nInstalling templates...\n"
system_or_exit %{rsync -vcrlK "#{DIST_STAGING_DIR}/Library/" ~/Library}
end

desc "Build the frameworks and upgrade the target"
task :upgrade, [:path_to_framework] => [:build_frameworks] do |task, args|
framework_folder = args.path_to_framework.split("/").last

case framework_folder
when "Cedar-iOS.framework"
cedar_name = "Cedar-iOS"
cedar_path = "#{CONFIGURATION}-iphoneuniversal"
when "Cedar.framework"
cedar_name = "Cedar"
cedar_path = "#{CONFIGURATION}"
else
raise "*** No framework found. ***"
end

puts "\nUpgrading #{cedar_name} framework...\n"

system_or_exit %{rsync -vkcr --delete "#{BUILD_DIR}/#{cedar_path}/#{cedar_name}.framework/" "#{args.path_to_framework}/"}
end
11 changes: 11 additions & 0 deletions upgradeCedarFramework
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

echo "\n===== Upgrading framework =====\n"

TARGET_PATH=$1
if rake upgrade[$TARGET_PATH]
then
echo "\n*** Finished upgrading the framework ***\n"
else
echo "\n*** It seems something went wrong with the upgrade. Make sure you supply the full path to the target framework i.e. path_to/Cedar-iOS.framework ***\n"
fi

0 comments on commit f8b0165

Please sign in to comment.