Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan McGovern <alan@xamarin.com>2015-03-04 15:58:50 +0300
committerAlan McGovern <alan@xamarin.com>2015-03-04 15:58:50 +0300
commit96bb9c7b1910b3a1feb248e56ed5227268f0df2c (patch)
tree6b886043e462c67414ea60ff4ab7c8eb74c90ba7 /dependency_checker.rb
parent7b62636321d4c9ef9020f26e1098207223dbe796 (diff)
[build] Add a dependency checker to configure
Enforce the correct xammac
Diffstat (limited to 'dependency_checker.rb')
-rw-r--r--dependency_checker.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/dependency_checker.rb b/dependency_checker.rb
new file mode 100644
index 0000000000..99c64269be
--- /dev/null
+++ b/dependency_checker.rb
@@ -0,0 +1,30 @@
+require 'pp'
+
+REQUIRED_XAMARIN_MAC_VERSION="1.12.0.4"
+XAMARIN_MAC_VERSION_FILE="/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version"
+
+def compare_version(first, second)
+ val1 = first.split('.').map { |x| x.to_i }
+ val2 = second.split('.').map { |x| x.to_i }
+
+ return val1 <=> val2
+end
+
+def check_product(required_version, version_file, product_name)
+ actual_version = File.read(version_file).strip
+ retval = compare_version(actual_version, required_version)
+ if (retval < 0)
+ puts "Your installed #{product_name} (#{actual_version}) is too old, please use #{required_version} or newer"
+ end
+ return retval
+end
+
+def run()
+ xammac_ret = check_product(REQUIRED_XAMARIN_MAC_VERSION, XAMARIN_MAC_VERSION_FILE, "Xamarin.Mac")
+ if (xammac_ret < 0)
+ raise RuntimeError
+ end
+end
+
+$stdout.sync = true
+run()