Skip to content

Commit

Permalink
Moved all top level files to the dwt directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-carlborg committed Oct 16, 2011
0 parents commit 287c657
Show file tree
Hide file tree
Showing 10 changed files with 686 additions and 0 deletions.
37 changes: 37 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
=== DWT2 ===

* The original Eclipse sources:
http://dev.eclipse.org/viewcvs/

* Requirements for D1+Tango:
DMD 1.041
Tango 0.99.8 is needed.
* Requirements for D2+Phobos:
DMD 2.026
* Required build tool:
Rake 0.8.X ( included in Ruby 1.9 )

The sc.ini/dmd.conf of the DMD in the PATH needs to have all
necessary parameters to build a application with the std lib.

E.g. for Tango it can look like this:
[Environment]
LINKCMD=%@P%\link.exe
LIB="%@P%\..\..\..\..\tango\lib"
DFLAGS="-I%@P%\..\..\..\..\tango" -version=Tango -defaultlib=tango-base-dmd.lib -debuglib=tango-base-dmd.lib

To show the available Rake targets use:
$ rake -T

To build for example the SWT you need:
$ rake base swt

To enable debug build (symbols for debugging):
$ rake DEBUG=1 base swt
Alternatively you can set the environment variable DEBUG to '1'.

The example targets build a whole collection of examples.
To build an indiviual snippet from swtsnippets, do:
$ rake swtsnippets[Snippet107]


62 changes: 62 additions & 0 deletions packageimport.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
require 'find'
require 'fileutils'
require 'set'

def ProcessModule( path, modName, modList )
puts "ProcessModule #{path}"
identifiers = Set.new
File.open(path).each_line do |s|
if s =~ /^[ \t]*\*/ then
next
end
s.split( /[^0-9A-Za-z_]/ ).each do |tok|
if tok =~ /^[_A-Z][_A-Za-z0-9]*$/ then
identifiers << tok
end
end
end
lines = IO.readlines(path)
w=File.new(path,"wb+")
lines.each do |s|
if s =~/\/\/ packageimport$/ then
else
w.print "#{s}"
end
if s =~ /^module +((([a-zA-Z0-9_]+)\.)*)([a-zA-Z0-9_]+);/ then
packname = $1
(modList-modName).intersection(identifiers).each do|id|
w.print "import #{packname}#{id};\n"
end
end
end
end

def ProcessDirectory( path )
puts path
modList = Set.new
Dir.foreach(path) do |entry|
filename = File.join(path,entry)
if FileTest.file?(filename) && filename =~ /\.d$/ then
modList << entry[ 0 .. -3 ]
end
end
Dir.foreach(path) do |entry|
filename = File.join(path,entry)
if FileTest.file?(filename) && filename =~ /\.d$/ then
ProcessModule( filename, entry[ 0 .. -3 ], modList )
end
end
end

ARGV.each do|startpath|
puts "processing #{startpath}"
if !FileTest.directory?(startpath) then
raise "Argument is not a directory"
end
Find.find( startpath ) do |path|
if FileTest.directory?(path) then
ProcessDirectory(path)
end
end
end

Loading

0 comments on commit 287c657

Please sign in to comment.