changeset 34:a8a838017920

All JFace snippets build on windows
author Frank Benoit <benoit@tionex.de>
date Mon, 23 Mar 2009 15:06:06 +0100
parents 712f3c7f7660
children 634e4380db78
files .hgignore README.txt org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.d org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d org.eclipse.jface.snippets/res/jface.snippets.linkto_help.gif org.eclipse.jface.snippets/res/jface.snippets.showerr_tsk.gif rakefile
diffstat 7 files changed, 53 insertions(+), 58 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Mon Mar 23 12:16:13 2009 +0100
+++ b/.hgignore	Mon Mar 23 15:06:06 2009 +0100
@@ -1,4 +1,9 @@
+syntax: glob
+*.map
+
 syntax: regexp
+^bin$
+^lib$
 ^imp$
 ^obj$
 ^tmp$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.txt	Mon Mar 23 15:06:06 2009 +0100
@@ -0,0 +1,11 @@
+=== DWT2 ===
+
+* Requirements for D1+Tango:
+To work with D1+Tango DMD 1.041 and Tango 0.99.8 is needed.
+* Requirements for D2+Phobos:
+To work with D1+Tango DMD 1.041 and Tango 0.99.8 is needed.
+* Required build tool:
+Rake (the Ruby Make) version 0.8.X is needed.
+
+
+
--- a/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.d	Mon Mar 23 12:16:13 2009 +0100
+++ b/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.d	Mon Mar 23 15:06:06 2009 +0100
@@ -16,6 +16,7 @@
 // http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java?view=markup
 
 import tango.util.Convert;
+import java.lang.all;
 import java.util.ArrayList;
 
 import org.eclipse.jface.viewers.ArrayContentProvider;
--- a/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d	Mon Mar 23 12:16:13 2009 +0100
+++ b/org.eclipse.jface.snippets/EclipseJfaceSnippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.d	Mon Mar 23 15:06:06 2009 +0100
@@ -32,9 +32,9 @@
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.ProgressBar;
 import org.eclipse.swt.widgets.Shell;
-
+import org.eclipse.jface.operation.IRunnableWithProgress;
 import java.lang.all;
-import java.utils.ArrayList;
+import java.util.ArrayList;
 
 import java.lang.Thread;
 import tango.text.convert.Format;
@@ -147,12 +147,7 @@
             }
 
             setControl(mt.comp);
-
-            ModalContext.run( dgRunnable(&mt.threadWork), true, getProgressMonitor(), getShell().getDisplay() );
-
-            //Thread t = new Thread(&mt.threadWork);
-
-            // t.start();
+            dialog.run( true, true, dgIRunnableWithProgress(&mt.threadWork));
         }
         class MyThread {
             private Composite parent;
@@ -240,6 +235,7 @@
     }
 
     static Shell shell;
+    static WizardDialog dialog;
     public static void main(String[] args) {
         Display display = new Display();
 
@@ -251,7 +247,7 @@
         b.addSelectionListener(new class SelectionAdapter {
 
             public void widgetSelected(SelectionEvent e) {
-                WizardDialog dialog = new WizardDialog(shell, new MyWizard(1));
+                dialog = new WizardDialog(shell, new MyWizard(1));
                 dialog.open();
             }
 
@@ -262,7 +258,7 @@
         b.addSelectionListener(new class SelectionAdapter {
 
             public void widgetSelected(SelectionEvent e) {
-                WizardDialog dialog = new WizardDialog(shell, new MyWizard(2));
+                dialog = new WizardDialog(shell, new MyWizard(2));
                 dialog.open();
             }
 
Binary file org.eclipse.jface.snippets/res/jface.snippets.linkto_help.gif has changed
Binary file org.eclipse.jface.snippets/res/jface.snippets.showerr_tsk.gif has changed
--- a/rakefile	Mon Mar 23 12:16:13 2009 +0100
+++ b/rakefile	Mon Mar 23 15:06:06 2009 +0100
@@ -44,7 +44,7 @@
     end
 end
 
-def buildTree( basedir, srcdir, resdir, dcargs="", libname="" )
+def buildTree( basedir, srcdir, resdir, dcargs=nil, libname=nil )
     puts "Building #{basedir}/#{srcdir}"
 
     resdir_abs = File.expand_path( File.join( basedir, resdir ))
@@ -58,7 +58,7 @@
     rsp.puts "-I#{srcdir_abs.to_path}"
     rsp.puts "-I#{DIMPDIR.to_path}"
     rsp.puts "-J#{resdir_abs.to_path}"
-    if dcargs.size > 0 then
+    if dcargs != nil
         rsp.puts dcargs
     end
     ALL_RESDIRS.each do | dir |
@@ -110,7 +110,7 @@
         end
     end
 
-    if libname.size == 0
+    if libname == nil
         libname = basedir
     end
     createLib( libobjs, libname )
@@ -157,13 +157,19 @@
         buildTree( "org.eclipse.swt.gtk.linux.x86", "src", "res" )
     end
 end
+if isWindows
+    LIBNAMES_SWT = [ "org.eclipse.swt.win32.win32.x86" ]
+else
+    LIBNAMES_SWT = [ "org.eclipse.swt.gtk.linux.x86" ]
+end
 
 desc "Build Equinox"
 task :equinox do
     buildTree( "org.eclipse.osgi", "src", "res" )
-    buildTree( "org.eclipse.osgi", "supplement/src", "res" )
+    buildTree( "org.eclipse.osgi", "supplement/src", "res", nil, "org.eclipse.osgi.supplement")
     buildTree( "org.eclipse.equinox.common", "src", "res" )
 end
+LIBNAMES_EQUINOX = [ "org.eclipse.osgi", "org.eclipse.osgi.supplement", "org.eclipse.equinox.common" ]
 
 desc "Build Eclipse Core"
 task :core do
@@ -171,11 +177,13 @@
     buildTree( "org.eclipse.core.commands", "src", "res" )
     buildTree( "org.eclipse.core.jobs", "src", "res" )
 end
+LIBNAMES_CORE = [ "org.eclipse.core.runtime", "org.eclipse.core.commands", "org.eclipse.core.jobs" ]
 
 desc "Build JFace"
 task :jface do
     buildTree( "org.eclipse.jface", "src", "res" )
 end
+LIBNAMES_JFACE = [ "org.eclipse.jface" ]
 
 desc "Build JFace.Text"
 task :jfacetext do
@@ -183,16 +191,19 @@
     buildTree( "org.eclipse.jface.text", "projection", "res", "-Isrc", "org.eclipse.jface.text.projection" )
     buildTree( "org.eclipse.jface.text", "src", "res" )
 end
+LIBNAMES_JFACETEXT = [ "org.eclipse.text", "org.eclipse.jface.text.projection", "org.eclipse.jface.text", ]
 
 desc "Build UI Forms"
 task :uiforms do
     buildTree( "org.eclipse.ui.forms", "src", "res" )
 end
+LIBNAMES_UIFORMS = [ "org.eclipse.ui.forms" ]
 
 desc "Build Draw2D"
 task :draw2d do
     buildTree( "org.eclipse.draw2d", "src", "res" )
 end
+LIBNAMES_DRAW2D = [ "org.eclipse.draw2d" ]
 
 desc "Build ALL"
 task :all => [ :base, :swt, :equinox, :core, :jface, :jfacetext, :uiforms,
@@ -205,6 +216,7 @@
 desc "Build SWT Snippet Collection"
 task :swtsnippets, :explicit_snp do | t, args |
 
+    libnames = LIBNAMES_BASIC + LIBNAMES_SWT
     snps_browser = [ "Snippet128", "Snippet136" ]
     snps_opengl = [ "Snippet174", "Snippet195" ]
 
@@ -212,14 +224,14 @@
     allsnippets = FileList[ File.join("org.eclipse.swt.snippets", "src", "**/Snippet*.d" )]
     if args.explicit_snp != nil
         puts "Building #{args.explicit_snp}"
-        buildApp( "org.eclipse.swt.snippets", "src", "res", "", args.explicit_snp )
+        buildApp( "org.eclipse.swt.snippets", "src", "res", "", args.explicit_snp, nil, libnames )
     else
         allsnippets.each do | snp |
             puts "Building #{snp}"
             if snp =~ /.*(Snippet\w+)\.d$/
                 snpname = $1
                 if !snps_exclude.include? snpname
-                    buildApp( "org.eclipse.swt.snippets", "src", "res", "", snpname )
+                    buildApp( "org.eclipse.swt.snippets", "src", "res", "", snpname, nil, libnames )
                 end
             else
                 puts snp
@@ -232,18 +244,19 @@
 desc "Build JFace Snippet Collection"
 task :jfacesnippets, :explicit_snp do | t, args |
 
+    libnames = LIBNAMES_BASIC + LIBNAMES_SWT + LIBNAMES_EQUINOX + LIBNAMES_CORE + LIBNAMES_JFACE
     snps_exclude = []
     allsnippets = FileList[ File.join("org.eclipse.jface.snippets", "EclipseJfaceSnippets", "**/*.d" )]
     if args.explicit_snp != nil
         puts "Building #{args.explicit_snp}"
-        buildApp( "org.eclipse.jface.snippets", "src", "res", "", args.explicit_snp )
+        buildApp( "org.eclipse.jface.snippets", "src", "res", "", args.explicit_snp, nil, libnames )
     else
         allsnippets.each do | snp |
-            puts "Building #{snp}"
             if snp =~ /.*[\\\/](\w+)\.d$/
                 snpname = $1
+                puts "Building #{snpname}"
                 if !snps_exclude.include? snpname
-                    buildApp( "org.eclipse.jface.snippets", "src", "res", "", snpname )
+                    buildApp( "org.eclipse.jface.snippets", "src", "res", "", snpname, nil, libnames )
                 end
             else
                 puts snp
@@ -253,7 +266,11 @@
     end
 end
 
-def buildApp( basedir, srcdir, resdir, dflags, appname, filelist=nil )
+LIBNAMES_BASIC = [ "advapi32", "comctl32", "comdlg32", "gdi32", "kernel32",
+    "shell32", "ole32", "oleaut32", "olepro32", "oleacc", "user32", "usp10",
+    "msimg32", "opengl32", "shlwapi", "dwt-base" ]
+
+def buildApp( basedir, srcdir, resdir, dflags, appname, filelist, libnames )
     if filelist == nil
         filelist = FileList[ "**/#{appname}.d" ]
     end
@@ -271,46 +288,11 @@
     ALL_RESDIRS.each do | dir |
         rsp.puts "-J#{File.expand_path(dir).to_path}"
     end
-    #rsp.puts "-L/NOMAP"
-    #rsp.print "-L"
-    #rsp.print "+advapi32"
-    #rsp.print "+comctl32"
-    #rsp.print "+comdlg32"
-    #rsp.print "+gdi32"
-    #rsp.print "+kernel32"
-    #rsp.print "+shell32"
-    #rsp.print "+ole32"
-    #rsp.print "+oleaut32"
-    #rsp.print "+olepro32"
-    #rsp.print "+oleacc"
-    #rsp.print "+user32"
-    #rsp.print "+usp10"
-    #rsp.print "+msimg32"
-    #rsp.print "+opengl32"
-    #rsp.print "+shlwapi"
-    #rsp.print "+tango-user-dmd.lib"
-    #rsp.print "+zlib.lib"
-    #rsp.print "+dwt-base.lib"
-    #rsp.print "+org.eclipse.swt.win32.win32.x86.lib"
-    #rsp.print "+#{LIBDIR.to_path}\\"
-    #rsp.puts
 
     rsp.puts "-L/NOM"
-    rsp.puts "-L+advapi32"
-    rsp.puts "-L+comctl32"
-    rsp.puts "-L+comdlg32"
-    rsp.puts "-L+gdi32"
-    rsp.puts "-L+kernel32"
-    rsp.puts "-L+shell32"
-    rsp.puts "-L+ole32"
-    rsp.puts "-L+oleaut32"
-    rsp.puts "-L+olepro32"
-    rsp.puts "-L+oleacc"
-    rsp.puts "-L+user32"
-    rsp.puts "-L+usp10"
-    rsp.puts "-L+msimg32"
-    rsp.puts "-L+opengl32"
-    rsp.puts "-L+shlwapi"
+    libnames.each do | libname |
+        rsp.puts "-L+#{libname}#{LIBEXT}"
+    end
     rsp.puts "-L+tango-user-dmd.lib"
     rsp.puts "-L+zlib.lib"
     rsp.puts "-L+dwt-base.lib"