Mercurial > projects > dwt2
comparison rakefile @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | 2847134a5fc0 |
children | dbfb303e8fb0 |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
10 DMD="dmd" | 10 DMD="dmd" |
11 LOCALOBJDIR="obj" | 11 LOCALOBJDIR="obj" |
12 OBJDIR="obj" | 12 OBJDIR="obj" |
13 DIMPDIR="imp" | 13 DIMPDIR="imp" |
14 RSPNAME="rsp" | 14 RSPNAME="rsp" |
15 ALL_RESDIRS= [ "java/res", "org.eclipse.swt.win32.win32.x86/res" ] | 15 ALL_RESDIRS= [ "java/res", "org.eclipse.swt.win32.win32.x86/res", "res" ] |
16 | 16 |
17 class String | 17 class String |
18 def to_path | 18 def to_path |
19 self.gsub( '/', '\\' ); | 19 self.gsub( '/', '\\' ); |
20 end | 20 end |
21 end | 21 end |
22 | 22 |
23 def buildTree( basedir, srcdir, resdir ) | 23 def buildTree( basedir, srcdir, resdir ) |
24 puts "Building #{basedir} #{srcdir}" | |
24 | 25 |
25 objdir_abs = File.expand_path( OBJDIR ) | 26 objdir_abs = File.expand_path( OBJDIR ) |
26 dimpdir_abs = File.expand_path( DIMPDIR ) | 27 dimpdir_abs = File.expand_path( DIMPDIR ) |
27 resdir_abs = File.expand_path( File.join( basedir, resdir )) | 28 resdir_abs = File.expand_path( File.join( basedir, resdir )) |
28 srcdir_abs = File.expand_path( File.join( basedir, srcdir )) | 29 srcdir_abs = File.expand_path( File.join( basedir, srcdir )) |
29 rspfile_abs = File.expand_path( RSPNAME ) | 30 rspfile_abs = File.expand_path( RSPNAME ) |
30 | 31 |
31 FileUtils.mkdir_p dimpdir_abs | 32 FileUtils.mkdir_p dimpdir_abs |
32 FileUtils.mkdir_p objdir_abs | 33 FileUtils.mkdir_p objdir_abs |
33 | 34 |
34 puts "Create response file" | |
35 rsp = File.new( rspfile_abs, "w+" ) | 35 rsp = File.new( rspfile_abs, "w+" ) |
36 rsp.puts "-H" | 36 rsp.puts "-H" |
37 rsp.puts "-I#{srcdir_abs.to_path}" | 37 rsp.puts "-I#{srcdir_abs.to_path}" |
38 rsp.puts "-I#{dimpdir_abs.to_path}" | 38 rsp.puts "-I#{dimpdir_abs.to_path}" |
39 rsp.puts "-J#{resdir_abs.to_path}" | 39 rsp.puts "-J#{resdir_abs.to_path}" |
48 end | 48 end |
49 end | 49 end |
50 rsp.close | 50 rsp.close |
51 | 51 |
52 Dir.chdir(basedir) do | 52 Dir.chdir(basedir) do |
53 puts "Compile" | |
54 sh "#{DMD} @#{rspfile_abs.to_path}" do |ok, res| | 53 sh "#{DMD} @#{rspfile_abs.to_path}" do |ok, res| |
55 | 54 |
56 if !ok then | 55 if !ok then |
57 Find.find( srcdir_abs ) do |path| | 56 Find.find( srcdir_abs ) do |path| |
58 if FileTest.file?(path) && path =~ /\.di$/ then | 57 if FileTest.file?(path) && path =~ /\.di$/ then |
63 raise "compile error" | 62 raise "compile error" |
64 end | 63 end |
65 end | 64 end |
66 end | 65 end |
67 | 66 |
68 puts "Move D Headers" | |
69 Find.find( srcdir_abs ) do |path| | 67 Find.find( srcdir_abs ) do |path| |
70 if FileTest.file?(path) && path =~ /\.di$/ then | 68 if FileTest.file?(path) && path =~ /\.di$/ then |
71 trgfile = File.join( dimpdir_abs, path[ srcdir_abs.length+1 .. -1 ]) | 69 trgfile = File.join( dimpdir_abs, path[ srcdir_abs.length+1 .. -1 ]) |
72 FileUtils.mkdir_p File.dirname(trgfile) | 70 FileUtils.mkdir_p File.dirname(trgfile) |
73 FileUtils.mv path, trgfile | 71 FileUtils.mv path, trgfile |
74 end | 72 end |
75 end | 73 end |
76 | 74 |
77 puts "Move Objects" | |
78 srcdirparts = split_all( srcdir_abs ).length | 75 srcdirparts = split_all( srcdir_abs ).length |
79 Find.find( srcdir_abs ) do |path| | 76 Find.find( srcdir_abs ) do |path| |
80 if FileTest.file?(path) && path =~ /\.o(bj)?$/ then | 77 if FileTest.file?(path) && path =~ /\.o(bj)?$/ then |
81 trgfile = split_all( path )[ srcdirparts .. -1 ].join( "-" ) | 78 trgfile = split_all( path )[ srcdirparts .. -1 ].join( "-" ) |
82 FileUtils.mv path, File.join( objdir_abs, trgfile ) | 79 FileUtils.mv path, File.join( objdir_abs, trgfile ) |
102 buildTree( "org.eclipse.swt.win32.win32.x86", "src", "res" ) | 99 buildTree( "org.eclipse.swt.win32.win32.x86", "src", "res" ) |
103 end | 100 end |
104 | 101 |
105 desc "Build jface" | 102 desc "Build jface" |
106 task :jface do | 103 task :jface do |
107 buildTree( "org.eclipse.jface", "src", "res" ) | 104 # buildTree( "org.eclipse.osgi", "src", "res" ) |
105 # buildTree( "org.eclipse.osgi", "supplement/src", "res" ) | |
106 # buildTree( "org.eclipse.equinox.common", "src", "res" ) | |
107 # buildTree( "org.eclipse.core.runtime", "src", "res" ) | |
108 # buildTree( "org.eclipse.core.commands", "src", "res" ) | |
109 # buildTree( "org.eclipse.core.jobs", "src", "res" ) | |
110 # buildTree( "org.eclipse.jface", "src", "res" ) | |
111 buildTree( "org.eclipse.text", "src", "res" ) | |
112 buildTree( "org.eclipse.jface.text", "src", "res" ) | |
113 buildTree( "org.eclipse.jface.text", "projection", "res" ) | |
114 buildTree( "org.eclipse.ui.forms", "src", "res" ) | |
115 buildTree( "org.eclipse.draw2d", "src", "res" ) | |
108 end | 116 end |
109 | 117 |