-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
75 lines (62 loc) · 2.2 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
require 'rubygems'
require 'fileutils'
require 'date'
require 'rubygems/package_task'
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/**/*', # include headers to make inline-C extensions possible
'lib/**/*.rb',
'examples/*.rb',
'examples/media/*',
'reference/**/*.rb',
'reference/**/*.mdown',
]
GOSU_VERSION = ENV['GOSU_RELEASE_VERSION'] || '0.0.0'
# Sets everything except 'platform' and 'files'.
def apply_gemspec_defaults s
s.name = 'gosu'
s.version = GOSU_VERSION.dup
s.summary = '2D game development library.'
s.description = <<EOS
2D game development library.
Gosu features easy to use and game-friendly interfaces to 2D graphics
and text (accelerated by 3D hardware), sound samples and music as well as
keyboard, mouse and gamepad/joystick input.
Also includes demos for integration with RMagick, Chipmunk and OpenGL.
EOS
s.author = 'Julian Raschke'
s.date = Time.now.strftime '%Y-%m-%d'
s.email = '[email protected]'
s.homepage = 'http://www.libgosu.org/'
s.required_ruby_version = Gem::Requirement.new('>= 1.8.2')
s.summary = '2D game development library.'
end
def upload filename
sh "scp -P 22000 '#{filename}' libgosu.org:/Library/WebServer/Documents/libgosu.org/downloads/"
end
def zip filename, files
sh "zip #{filename} #{files.map { |fn| "'#{fn}'" }.join(' ')}"
end
def tar filename, files
sh "COPYFILE_DISABLE=true tar -czf #{filename} #{files.to_a.uniq.map { |fn| "'#{fn}'" }.join(' ')}"
end
# Usually this is handled by my Xcode 3 project. Until the Xcode 4 project is
# complete, this Rake task should do the trick.
task :swig do
sh "swig -c++ -ruby -autorename GosuImpl/RubyGosu.swg"
sh "patch --no-backup-if-mismatch -p0 <GosuImpl/RubyGosu_SWIG_GC_PATCH.patch"
sh "patch --no-backup-if-mismatch -p0 <GosuImpl/RubyGosu_SWIG_RENAME_PATCH.patch"
end
Dir['./rake/*.rb'].each { |task| require task }
# The mac:app_wrapper task needs to be built on a 10.4-10.6 machine.
task :release => [:'win:release', :'win:release_gem',
:'linux:release', :'linux:release_gem']