-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.rb
104 lines (81 loc) · 2.36 KB
/
config.rb
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
require 'rbconfig'
require 'java'
#
# In principle should not be in this file. The right way of doing this is by executing
# bundler exec, but I don't know how to do this from inside emacs. So, should comment
# the next line before publishing the GEM. If not commented, this should be harmless
# anyway.
#
begin
require 'bundler/setup'
rescue LoadError
end
# the platform
@platform =
case RUBY_PLATFORM
when /mswin/ then 'windows'
when /mingw/ then 'windows'
when /bccwin/ then 'windows'
when /cygwin/ then 'windows-cygwin'
when /java/
require 'java' #:nodoc:
if java.lang.System.getProperty("os.name") =~ /[Ww]indows/
'windows-java'
else
'default-java'
end
else
'default'
end
#---------------------------------------------------------------------------------------
# Set the project directories
#---------------------------------------------------------------------------------------
class Jcsv
@home_dir = File.expand_path File.dirname(__FILE__)
class << self
attr_reader :home_dir
end
@project_dir = Jcsv.home_dir + "/.."
@doc_dir = Jcsv.home_dir + "/doc"
@lib_dir = Jcsv.home_dir + "/lib"
@src_dir = Jcsv.home_dir + "/src"
@target_dir = Jcsv.home_dir + "/target"
@test_dir = Jcsv.home_dir + "/test"
@vendor_dir = Jcsv.home_dir + "/vendor"
class << self
attr_reader :project_dir
attr_reader :doc_dir
attr_reader :lib_dir
attr_reader :src_dir
attr_reader :target_dir
attr_reader :test_dir
attr_reader :vendor_dir
end
@build_dir = Jcsv.src_dir + "/build"
class << self
attr_reader :build_dir
end
@classes_dir = Jcsv.build_dir + "/classes"
class << self
attr_reader :classes_dir
end
end
#----------------------------------------------------------------------------------------
# If we need to test for coverage
#----------------------------------------------------------------------------------------
if $COVERAGE == 'true'
require 'simplecov'
SimpleCov.start do
@filters = []
add_group "Jcsv"
end
end
##########################################################################################
# Load necessary jar files
##########################################################################################
Dir["#{Jcsv.vendor_dir}/*.jar"].each do |jar|
require jar
end
Dir["#{Jcsv.target_dir}/*.jar"].each do |jar|
require jar
end