-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
54 lines (44 loc) · 1.35 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
require 'rubygems'
require 'fileutils'
require 'date'
require 'rake/extensiontask'
COMMON_FILES = FileList[
'.yardopts',
'COPYING',
'README.txt',
]
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',
'reference/**/*.mdown',
]
GOSU_VERSION = ENV['GOSU_RELEASE_VERSION'] || '0.0.0'
def zip filename, files
sh "zip #{filename} #{files.map { |fn| "'#{fn}'" }.join(' ')}"
end
def tar filename, files
sh "gtar -c --transform 's,^,gosu-#{GOSU_VERSION}/,' -zf #{filename} #{files.map { |fn| "'#{fn}'" }.join(' ')}"
end
Dir.glob('./rake/*.rb').sort.each { |task| require task }
task :swig do
sh "swig -c++ -ruby -autorename ext/gosu/gosu.swg"
sh "patch --no-backup-if-mismatch -p0 <ext/gosu/gosu_SWIG_GC_PATCH.patch"
sh "patch --no-backup-if-mismatch -p0 <ext/gosu/gosu_SWIG_RENAME_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