rubydoop 1.1.0.pre3 → 1.1.0.pre4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rubydoop/package.rb +45 -40
- data/lib/rubydoop/version.rb +1 -1
- data/lib/rubydoop.jar +0 -0
- metadata +1 -1
data/lib/rubydoop/package.rb
CHANGED
@@ -46,6 +46,7 @@ module Rubydoop
|
|
46
46
|
def create!
|
47
47
|
create_directories!
|
48
48
|
fetch_jruby!
|
49
|
+
find_gems!
|
49
50
|
build_jar!
|
50
51
|
end
|
51
52
|
|
@@ -98,54 +99,58 @@ module Rubydoop
|
|
98
99
|
end
|
99
100
|
end
|
100
101
|
|
102
|
+
def find_gems!
|
103
|
+
gem_specs = Bundler.definition.specs_for(@options[:gem_groups])
|
104
|
+
@options[:gem_specs] = gem_specs.select { |spec| spec.full_name !~ /^(?:bundler|rubydoop)/ }
|
105
|
+
end
|
106
|
+
|
101
107
|
def build_jar!
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
108
|
+
Dir.mktmpdir('rubydoop') do |generated_files_path|
|
109
|
+
create_load_path_setup_script(generated_files_path)
|
110
|
+
|
111
|
+
# NOTE: the ant block is instance_exec'ed so instance variables and methods will not be scope
|
112
|
+
|
113
|
+
output_path = @options[:jar_path]
|
114
|
+
main_class = @options[:main_class]
|
115
|
+
project_lib = File.join(@options[:project_base_dir], 'lib')
|
116
|
+
rubydoop_jar = File.join(@options[:rubydoop_base_dir], 'lib', 'rubydoop.jar')
|
117
|
+
rubydoop_lib = File.join(@options[:rubydoop_base_dir], 'lib')
|
118
|
+
gem_specs = @options[:gem_specs]
|
119
|
+
extra_jars = [@options[:jruby_jar_path], *@options[:lib_jars]]
|
120
|
+
|
121
|
+
ant output_level: 1 do
|
122
|
+
jar destfile: output_path do
|
123
|
+
manifest { attribute name: 'Main-Class', value: main_class }
|
124
|
+
|
125
|
+
zipfileset dir: project_lib
|
126
|
+
zipfileset src: rubydoop_jar
|
127
|
+
zipfileset dir: generated_files_path
|
128
|
+
zipfileset dir: rubydoop_lib, excludes: '*.jar', prefix: "gems/rubydoop-#{Rubydoop::VERSION}/lib"
|
129
|
+
|
130
|
+
gem_specs.each do |gem_spec|
|
131
|
+
zipfileset dir: gem_spec.full_gem_path, prefix: "gems/#{File.basename(gem_spec.full_gem_path)}"
|
132
|
+
end
|
133
|
+
|
134
|
+
extra_jars.each do |extra_jar|
|
135
|
+
zipfileset dir: File.dirname(extra_jar), includes: File.basename(extra_jar), prefix: 'lib'
|
136
|
+
end
|
137
|
+
end
|
115
138
|
end
|
116
139
|
end
|
117
|
-
ensure
|
118
|
-
FileUtils.rm_rf(@tmpdir)
|
119
140
|
end
|
120
141
|
|
121
|
-
def
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
142
|
+
def create_load_path_setup_script(base_path)
|
143
|
+
path = File.join(base_path, 'setup_load_path.rb')
|
144
|
+
FileUtils.mkdir_p(File.dirname(path))
|
145
|
+
File.open(path, 'w') do |io|
|
146
|
+
io.puts("$LOAD_PATH << 'gems/rubydoop-#{Rubydoop::VERSION}/lib'")
|
147
|
+
@options[:gem_specs].each do |gem_spec|
|
148
|
+
gem_spec.require_paths.each do |path|
|
149
|
+
relative_path = File.join(File.basename(gem_spec.full_gem_path), path)
|
150
|
+
io.puts("$LOAD_PATH << 'gems/#{relative_path}'")
|
126
151
|
end
|
127
|
-
elsif spec.full_name !~ /^(?:bundler|rubydoop)-\d+/
|
128
|
-
spec.require_paths.map do |rp|
|
129
|
-
"#{spec.full_gem_path}/#{rp}"
|
130
|
-
end
|
131
|
-
else
|
132
|
-
[]
|
133
152
|
end
|
134
153
|
end
|
135
154
|
end
|
136
|
-
|
137
|
-
def repackage_openssl(spec)
|
138
|
-
FileUtils.cp_r(spec.full_gem_path, 'jruby-openssl')
|
139
|
-
FileUtils.mv('jruby-openssl/lib/shared', 'jruby-openssl/new_lib')
|
140
|
-
FileUtils.mv('jruby-openssl/lib/1.8', 'jruby-openssl/new_lib/openssl/1.8')
|
141
|
-
FileUtils.mv('jruby-openssl/lib/1.9', 'jruby-openssl/new_lib/openssl/1.9')
|
142
|
-
main_file = File.read('jruby-openssl/new_lib/openssl.rb')
|
143
|
-
main_file.gsub!('../1.8', 'openssl/1.8')
|
144
|
-
main_file.gsub!('../1.9', 'openssl/1.9')
|
145
|
-
File.open('jruby-openssl/new_lib/openssl.rb', 'w') { |io| io.write(main_file) }
|
146
|
-
FileUtils.rm_r('jruby-openssl/lib')
|
147
|
-
FileUtils.mv('jruby-openssl/new_lib', 'jruby-openssl/lib')
|
148
|
-
["#{@tmpdir}/jruby-openssl/lib"]
|
149
|
-
end
|
150
155
|
end
|
151
156
|
end
|
data/lib/rubydoop/version.rb
CHANGED
data/lib/rubydoop.jar
CHANGED
Binary file
|