eki / optimalbot

Vying Games bot (OptimalBot)

This URL has Read+Write access

optimalbot / Rakefile
100644 96 lines (78 sloc) 1.979 kb
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/clean'
require 'fileutils'
include FileUtils
 
###
### cleanup tasks
###
 
CLOBBER.include( 'pkg', 'doc/api', 'lib/version.rb' )
 
###
### test task
###
 
Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = FileList['test/**/*_test.rb']
end
 
###
### rdoc task
###
 
task :rdoc do
  cp "lib/bots/optimalbot/footsteps.sql", "doc/api/footsteps.sql"
end
 
Rake::RDocTask.new do |rd|
  rd.main = "README"
  rd.rdoc_dir = "doc/api"
  rd.rdoc_files.include( "README", "LICENSE", "COPYING",
                         "doc/*.txt", "lib/**/*.rb" )
end
 
###
### RubyGems related tasks follow:
###
 
# Try to load the version number -- it's okay if it's not available
 
begin
  require 'optimalbot'
  require 'lib/version.rb'
rescue Exception
  class OptimalBot; end
end
 
desc "Appends the value in VERSION to lib/version.rb"
task :version do
  v = ENV['VERSION']
  raise "provide a VERSION via the environment variable" unless v
  sh %{echo 'class OptimalBot < Bot; VERSION = "#{v}"; end' >> lib/version.rb}
end
 
begin
  require 'rubygems'
  require 'rake/gempackagetask'
rescue Exception
  nil
end
 
if defined?( Gem ) && OptimalBot.const_defined?( 'VERSION' )
  task :gem => [:clean, :test]
 
  PKG_FILES = FileList[
    'lib/**/*',
    'test/**/*',
    'Rakefile',
    'README',
    'LICENSE',
    'COPYING']
 
  spec = Gem::Specification.new do |s|
    s.name = 'optimalbot'
    s.version = OptimalBot::VERSION
    s.summary = 'OptimalBot (plays Footsteps) for Vying Games'
    s.description = 'Vying is a game library.'
    s.homepage = 'http://vying.org/dev/public'
    s.rubyforge_project = 'Silence stupid WARNINGS'
    s.has_rdoc = true
    s.files = PKG_FILES.to_a
    #s.add_dependency "vying"
    s.author = 'Eric K Idema and Magnus Javerberg'
    s.email = 'eki@vying.org'
  end
 
  package_task = Rake::GemPackageTask.new( spec ) do |pkg|
    pkg.need_tar_gz = true
    pkg.need_zip = true
  end
end