[macruby-changes] [293] MacRuby/trunk/sample-macruby/buildall.rb

source_changes at macosforge.org source_changes at macosforge.org
Sun Jun 15 19:24:16 PDT 2008


Revision: 293
          http://trac.macosforge.org/projects/ruby/changeset/293
Author:   lsansonetti at apple.com
Date:     2008-06-15 19:24:16 -0700 (Sun, 15 Jun 2008)

Log Message:
-----------
adding buildall.rb script, ported from rubycocoa

Added Paths:
-----------
    MacRuby/trunk/sample-macruby/buildall.rb

Added: MacRuby/trunk/sample-macruby/buildall.rb
===================================================================
--- MacRuby/trunk/sample-macruby/buildall.rb	                        (rev 0)
+++ MacRuby/trunk/sample-macruby/buildall.rb	2008-06-16 02:24:16 UTC (rev 293)
@@ -0,0 +1,39 @@
+require 'fileutils'
+include FileUtils
+
+def die(*x)
+  STDERR.puts x
+  exit 1
+end
+
+if ARGV.size != 1
+  die "Usage: #{__FILE__} <output-directory>"
+end
+
+out_dir = ARGV.first
+if !File.exist?(out_dir) or !File.directory?(out_dir)
+  die "Given #{out_dir} doesn't exist or is not a directory"
+end
+
+tmp_dir = '/tmp/macruby_samples'
+rm_rf tmp_dir
+mkdir_p tmp_dir
+
+succeeded, failed = [], []
+
+Dir.glob('*/**/*.xcodeproj').each do |sampleDir|
+  name = File.dirname(sampleDir)
+  Dir.chdir name do
+    ary = system("xcodebuild SYMROOT=#{tmp_dir} >& /dev/null") ? succeeded : failed
+    ary << name
+  end
+end
+
+Dir.glob(File.join(tmp_dir, '**/*.app')).each do |app|
+  cp_r app, out_dir
+end
+
+[succeeded, failed].each { |a| a << 'None' if a.empty? }
+
+puts "Successful to build: #{succeeded.join(', ')}"
+puts "Failed to build: #{failed.join(', ')}"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080615/5445a773/attachment-0001.htm 


More information about the macruby-changes mailing list