rubygems_generators/extconf/templates/tasks/extconf_name.rake in newgem-0.20.0 vs rubygems_generators/extconf/templates/tasks/extconf_name.rake in newgem-0.20.1
- old
+ new
@@ -12,11 +12,11 @@
# "lib"
]
task :compile => extension do
- if Dir.glob("**/#{extension}.*").length == 0
+ if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
STDERR.puts "Gem actually failed to build. Your system is"
STDERR.puts "NOT configured properly to build #{GEM_NAME}."
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit(1)
@@ -30,9 +30,14 @@
Dir.chdir(ext) do ruby "extconf.rb" end
end
file ext_so => ext_files do
Dir.chdir(ext) do
- sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
+ sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
+ if !ok
+ require "fileutils"
+ FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
+ end
+ end
end
end
end
\ No newline at end of file