Rakefile in ruby-vpi-7.2.0 vs Rakefile in ruby-vpi-7.3.0
- old
+ new
@@ -34,10 +34,11 @@
PROJECT_SUMMARY = "Ruby interface to Verilog VPI."
PROJECT_DETAIL = "#{PROJECT_NAME} is a #{PROJECT_SUMMARY}. It lets you create complex Verilog test benches easily and wholly in Ruby."
PROJECT_SSH_URL = "snk@rubyforge.org:/var/www/gforge-projects/#{PROJECT_ID}"
+
# Returns a temporary, unique path ready for use. No file exists at the returned path.
def generate_temp_path
rm_f path = Tempfile.new($$).path
path
end
@@ -60,10 +61,11 @@
rm_rf tmpDir
end
+
task :default => :build
task :clobber do |t|
files = FileList['**/Rakefile'].reject {|f| File.expand_path(f) == __FILE__}
@@ -74,13 +76,11 @@
end
end
-##
-# extension
-#
+## extension
desc "Builds object files for all simulators."
task :build
DEFAULT_SHARED_OBJ = "#{PROJECT_ID}.so"
@@ -125,13 +125,11 @@
task :build => targetTask
end
-##
-# documentation
-#
+## documentation
desc 'Generate documentation.'
task 'doc' => 'ref' do |t|
cd t.name do
sh 'rake'
@@ -175,13 +173,11 @@
rmdir tempDest
end
-##
-# distribution
-#
+## distribution
DIST_INFO_HEADER = 'HEADER'
distDocs = [DIST_INFO_HEADER, 'README', 'HISTORY', 'MEMO'].map do |src|
dst = src.downcase << '.html'
@@ -268,11 +264,11 @@
s.requirements << "POSIX threads library"
s.requirements << "C language compiler"
s.files = FileList['**/*']
s.autorequire = PROJECT_ID
- s.executables = FileList['bin/*'].select {|f| File.executable?(f) && File.file?(f)}.map {|f| File.basename f}
+ s.executables = FileList['bin/*'].select {|f| File.executable?( f ) && File.file?( f )}.map {|f| File.basename f}
s.extensions << t.prerequisites[1]
end
Gem::manage_gems
Gem::Builder.new(spec).build
@@ -284,11 +280,11 @@
end
desc "Configures the gem during installation."
task :config_gem_install => 'readme.html' do |t|
- # makes documentation available to gem_server
+ # make documentation available to gem_server
gemDir = File.dirname(__FILE__)
gemName = File.basename(gemDir)
docDir = File.join('..', '..', 'doc', gemName)
mkdir_p docDir
@@ -298,15 +294,16 @@
cp t.prerequisites[0], 'index.html'
end
-##
-# testing
-#
+## testing
desc "Ensure that examples work with $SIMULATOR"
task :test => :build do
+ # ensures that current sources are tested instead of the installed gem
+ ENV['RUBYLIB'] = File.join(File.dirname(__FILE__), 'lib')
+
FileList['samp/*/'].each do |s|
cd s do
sh 'rake', ENV['SIMULATOR'] || 'cver'
end
end