diff rakefile @ 25:f713da8bc051

Added SWT Linux GTK
author Frank Benoit <benoit@tionex.de>
date Fri, 20 Mar 2009 23:03:58 +0100
parents 9b96950f2c3c
children 1bf55a6eb092
line wrap: on
line diff
--- a/rakefile	Fri Mar 20 14:09:41 2009 +0100
+++ b/rakefile	Fri Mar 20 23:03:58 2009 +0100
@@ -14,7 +14,11 @@
 RSPNAME="rsp"
 ALL_RESDIRS= [ "java/res", "res" ]
 
-if Rake::Win32.windows?
+def isWindows
+    Config::CONFIG['host_os'] =~ /mswin/
+end
+
+if isWindows
     ALL_RESDIRS << "org.eclipse.swt.win32.win32.x86/res"
 else
     ALL_RESDIRS << "org.eclipse.swt.gtk.linux.x86/res"
@@ -22,7 +26,11 @@
 
 class String
     def to_path
-        self.gsub( '/', '\\' );
+        if isWindows
+            self.gsub( '/', '\\' );
+        else
+            self
+        end
     end
 end
 
@@ -59,8 +67,12 @@
     rsp.close
 
     Dir.chdir(basedir) do
-        sh "#{DMD} @#{rspfile_abs.to_path}" do |ok, res|
-
+        if isWindows
+            cmd = "#{DMD} @#{rspfile_abs.to_path}"
+        else
+            cmd = "cat #{rspfile_abs.to_path} | xargs #{DMD}"
+        end
+        sh cmd, :verbose => false do |ok, res|
             if !ok then
                 Find.find( srcdir_abs ) do |path|
                     if FileTest.file?(path) && path =~ /\.di$/ then
@@ -106,7 +118,7 @@
 
 desc "Build SWT"
 task :swt do
-    if Rake::Win32.windows?
+    if isWindows
         buildTree( "org.eclipse.swt.win32.win32.x86", "src", "res" )
     else
         buildTree( "org.eclipse.swt.gtk.linux.x86", "src", "res" )