sklemm / rcdk-ng

fork of Rich Apodaca's Ruby CDK

This URL has Read+Write access

rcdk-ng / Rakefile
100644 120 lines (103 sloc) 3.048 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# =============================================
# RCDK - The Chemistry Development Kit for Ruby
# =============================================
#
# Project Info: http://rubyforge.org/projects/rcdk
# Blog: http://depth-first.com
#
# Copyright (C) 2006 Richard L. Apodaca
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software
# Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor
# Boston, MA 02111-1301, USA.
 
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
 
PKG_VERSION = "0.6.5"
 
PKG_FILES = FileList[
  "Rakefile", "README", "LICENSE",
  "lib/**/*.rb",
  "test/**/*",
  "java/lib/*.jar"
]
 
desc "Default task"
task :default => [:test]
 
 
task :dist => [:rdoc]
 
desc "Clean up"
task :clean do
  rm_rf "dist"
  rm_rf "doc"
  rm_rf "pkg"
  rm_rf "output"
end
 
desc "Create the source distribution"
task :dist do
  rm_rf "dist"
  
  mkdir "dist"
  mkdir "dist/doc"
  mkdir "dist/lib"
  mkdir "dist/lib/rcdk"
  mkdir "dist/java"
  mkdir "dist/java/lib"
  mkdir "dist/java/src"
  mkdir "dist/test"
  
  mv Dir.glob('doc/*'), 'dist/doc'
  cp_r Dir.glob('*.rb'), 'dist'
  cp_r Dir.glob('lib/*.rb'), 'dist/lib'
  cp_r Dir.glob('lib/rcdk/*.rb'), 'dist/lib/rcdk'
  cp_r Dir.glob('java/lib/*.jar'), 'dist/java/lib'
  cp_r Dir.glob('test/*.rb'), 'dist/test'
  cp 'Rakefile', 'dist'
  cp 'README', 'dist'
  cp 'LICENSE', 'dist'
end
 
Rake::TestTask.new do |t|
 
  rm_rf "output"
  mkdir "output"
  
  t.libs << "test"
  t.test_files = FileList['test/test*.rb']
  t.verbose = true
end
 
Rake::RDocTask.new do |rdoc|
  rdoc.rdoc_dir = 'doc'
  rdoc.title = "Ruby CDK"
  rdoc.rdoc_files.include('README')
  rdoc.options << '--line-numbers'
  rdoc.options << '--inline-source'
  rdoc.options << '--main' << 'README'
  rdoc.rdoc_files.include('lib/**/*.rb')
end
 
spec = Gem::Specification.new do |s|
  s.name = 'rcdk-ng'
  s.version = PKG_VERSION
  s.author = "Sebastian Klemm"
  s.homepage = "http://github.com/sklemm/rcdk-ng"
  s.platform = Gem::Platform::RUBY
  s.require_path = 'lib'
  s.has_rdoc = true
  s.files = PKG_FILES
  s.summary = "A Ruby wrapper for the Chemistry Development Kit"
  s.add_dependency("rjb", ">= 1.0.0")
  s.description = s.summary
  s.extra_rdoc_files = ['README']
  s.rdoc_options << '--title' << 'Ruby Chemistry Development Kit (RCDK)' <<
                       '--main' << 'README' <<
                       '--line-numbers'
end
 
Rake::GemPackageTask.new(spec) do |gem|
  gem.need_tar = true
  gem.need_tar_gz = true
  gem.package_files += PKG_FILES
end