Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ff77189efe
Fetching contributors…

Cannot retrieve contributors at this time

file 60 lines (51 sloc) 1.899 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
task :default => "prefpane:run"

namespace :prefpane do
  BUILD = "build/Release/Passenger.prefPane"
  BIN = File.join(BUILD, 'Contents/MacOS/Passenger')
  
  desc 'Build the prefpane'
  task :build do
    sh "xcodebuild -configuration Release"
  end
  
  # Make sure that the prefpane searches inside the bundle for the RubyCocoa framework.
  #
  # This task is invoked from the xcode project post build script.
  desc 'Adjusts the install name of the bundled RubyCocoa to point to the right place'
  task :change_ruycocoa_framework_location do
    current = `/usr/bin/otool -L #{BIN}`.match(/^\t(.+RubyCocoa).+$/)[1]
    sh "/usr/bin/install_name_tool -change '#{current}' '@loader_path/../Frameworks/RubyCocoa.framework/Versions/A/RubyCocoa' '#{BIN}'"
  end
  
  desc 'Builds and opens the prefpane'
  task :run => :build do
    sh "open #{BUILD}"
  end
end

desc 'Cleans the build and release pkg'
task :clean do
  sh 'rm -rf build/'
  sh 'rm -rf pkg'
end

desc 'Creates a release build and pkg'
task :release => [:clean, 'prefpane:build'] do
  require 'osx/cocoa'
  version = OSX::NSDictionary.dictionaryWithContentsOfFile('Info.plist')['CFBundleVersion'].to_s
  name = "PassengerPane-#{version}"
  pkg_dir = "pkg/#{name}"
  
  sh "mkdir -p #{pkg_dir}"
  sh "cp -R build/Release/Passenger.prefPane #{pkg_dir}"
  %w{ LICENSE README.rdoc app/config/passenger_pane_config.rb.ports }.each do |file|
    sh "cp #{file} #{pkg_dir}"
  end
  sh "cd pkg/ && tar -czvf #{name}.tgz #{name}/"
end

require 'rake/testtask'
Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = FileList['test/*_test.rb']
  t.verbose = nil
  t.options = '-rs'
end

desc "Generate Security.framework BridgeSupport file"
task :bridgesupport do
  #sh "gen_bridge_metadata -f Security -e Security.BridgeSupport-exceptions.xml -o Security.bridgesupport"
  sh "gen_bridge_metadata -f Security -o Security.bridgesupport"
end
Something went wrong with that request. Please try again.