Rakefile in sekka-1.7.0 vs Rakefile in sekka-1.7.1
- old
+ new
@@ -13,10 +13,12 @@
# Enviroment Variables:
# Please select from
# DB=gdbm
# DB=tokyocabinet
# DB=redis
+# DB=pure pure Ruby(for travis-ci)
+# DB=mapdb for Java platform
# DB= (default)
# DB=all gdbm/tokyocabinet/redis
#
require 'rake'
@@ -74,17 +76,21 @@
unless path1 == path2
puts STDERR.printf( "Error: on <sekka-path> requires [%s] but got [%s].", path2, path1 )
exit 1
end
- ["test.record", "test.tch", "test.db" ].each {|name|
+ ["test.record", "test.tch", "test.db", "test1.mapdb", "test2.mapdb"].each {|name|
File.unlink( name ) if File.exist?( name )
}
["test.ldb"].each {|name|
FileUtils.rm_rf( name ) if File.exist?( name )
}
files = []
+ if RUBY_PLATFORM == 'java'
+ files << "./test/jruby_mapdb.nnd"
+ end
+ files << "./test/downloader.nnd"
files << "./test/memcache.nnd"
files << "./test/util.nnd"
files << "./test/alphabet-lib.nnd"
files << "./test/sharp-number.nnd"
files << "./test/roman-lib.nnd"
@@ -100,22 +106,29 @@
when 'leveldb'
files << "./test/henkan-main.nnd leveldb"
when 'redis'
files << "./test/redis.nnd"
files << "./test/henkan-main.nnd redis"
+ when 'mapdb'
+ files << "./test/henkan-main.nnd mapdb"
when 'pure'
files << "./test/henkan-main.nnd pure"
when 'all'
files << "./test/henkan-main.nnd gdbm"
files << "./test/henkan-main.nnd tokyocabinet"
files << "./test/henkan-main.nnd redis"
files << "./test/henkan-main.nnd pure"
files << "./test/henkan-main.nnd leveldb"
else # default
- files << "./test/henkan-main.nnd tokyocabinet"
- files << "./test/henkan-main.nnd pure"
- files << "./test/henkan-main.nnd leveldb"
+ if RUBY_PLATFORM == 'java'
+ files << "./test/henkan-main.nnd mapdb"
+ files << "./test/henkan-main.nnd pure"
+ else
+ files << "./test/henkan-main.nnd tokyocabinet"
+ files << "./test/henkan-main.nnd pure"
+ files << "./test/henkan-main.nnd leveldb"
+ end
end
files.each {|filename|
sh sprintf( "export RUBY_THREAD_VM_STACK_SIZE=100000 ; ruby -I ./lib -S nendo -I ./lib -d %s", filename )
}
sh "cat test.record"
@@ -147,14 +160,14 @@
task :load do
sh "ruby ./bin/sekka-jisyo load ./data/SEKKA-JISYO.N ./data/SEKKA-JISYO.N.tch#xmsiz=1024m"
end
task :dump do
- sh sprintf( "ruby ./bin/sekka-jisyo dump ./data/SEKKA-JISYO.N.tch#xmsiz=1024m > ./data/SEKKA-JISYO-%s.N.tsv", dictVersion )
+ sh sprintf( "ruby ./bin/sekka-jisyo dump ./data/SEKKA-JISYO-%s.N.mapdb > ./data/SEKKA-JISYO-%s.N.tsv", dictVersion, dictVersion )
end
task :restore do
- sh sprintf("export RUBY_THREAD_VM_STACK_SIZE=100000 ; ruby -I ./lib ./bin/sekka-jisyo restore ./data/SEKKA-JISYO-%s.N.tsv jisyo.N.ldb", dictVersion )
+ sh sprintf("export RUBY_THREAD_VM_STACK_SIZE=100000 ; ruby -I ./lib ./bin/sekka-jisyo restore ./data/SEKKA-JISYO-%s.N.tsv ./data/SEKKA-JISYO-%s.N.mapdb", dictVersion, dictVersion )
end
task :load_leveldb do
sh sprintf( "ruby ./bin/sekka-jisyo load ./data/SEKKA-JISYO.N ./data/SEKKA-JISYO-%s.N.ldb", dictVersion )
sh sprintf( "tar zcCf ./data ./data/SEKKA-JISYO-%s.N.ldb.tar.gz ./SEKKA-JISYO-%s.N.ldb" , dictVersion, dictVersion )