-
Notifications
You must be signed in to change notification settings - Fork 174
/
Rakefile
59 lines (49 loc) · 1.46 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
require 'rubygems'
require 'fileutils'
require 'date'
require 'rake/extensiontask'
require 'rake/testtask'
COMMON_FILES = FileList[
'.yardopts',
'COPYING',
'README.md',
]
COMMON_CPP_FILES = COMMON_FILES + FileList[
'examples/**/*.{cpp}',
'examples/media/*',
'reference/cpp/**/*',
]
COMMON_RUBY_FILES = COMMON_FILES + FileList[
'Gosu/**/*',
'lib/**/*.rb',
'examples/*.rb',
'examples/media/*',
'reference/**/*.rb',
]
GOSU_VERSION = ENV['GOSU_RELEASE_VERSION'] || '0.0.0'
def zip filename, files
if RUBY_PLATFORM =~ /mswin$|mingw32|mingw64|win32\-|\-win32/
sh "7z a #{filename} #{files.map { |fn| "\"#{fn}\"" }.join(' ')}"
else
sh "zip #{filename} #{files.map { |fn| "'#{fn}'" }.join(' ')}"
end
end
Dir.glob('./rake/*.rb').sort.each { |task| require task }
task :swig do
sh "swig -c++ -ruby -autorename -o src/RubyGosu.cxx ext/gosu/gosu.i"
sh "patch --no-backup-if-mismatch -p0 <ext/gosu/gosu_SWIG_RENAME_PATCH.patch"
sh "patch --no-backup-if-mismatch -p0 <ext/gosu/gosu_SWIG_UTF8_PATCH.patch"
end
task :update_rdoc do
sh "yardoc"
sh "scp -r doc/* #{ENV['PROJECTS_HOST']}:#{ENV['PROJECTS_ROOT']}/libgosu.org/rdoc"
sh "rm -rf doc/*"
end
task :update_doxygen do
sh "ssh #{ENV['PROJECTS_HOST']} 'cd #{ENV['PROJECTS_ROOT']}/libgosu.org/ && " +
"svn checkout https://github.com/gosu/gosu/trunk/Gosu && PATH=../doxygen/bin:$PATH doxygen'"
end
Rake::TestTask.new do |t|
t.test_files = FileList["test/test_*.rb"]
t.verbose = true
end