puck 1.1.2-java → 1.2.1-java
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.
- checksums.yaml +4 -4
- data/lib/puck/bootstrap.rb +6 -2
- data/lib/puck/configuration.rb +1 -1
- data/lib/puck/jar.rb +26 -10
- data/lib/puck/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47bef3c027c28957af4b9cee38362eb563da11fc
|
4
|
+
data.tar.gz: feac13fef9a26c7abde2e17dfba0eb8d32d2f1fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 184478dc20a2ad1439fec9b1f0a1edd3c967c62c139490c6d76dc05484eb2adc23ea29f1946b64372afbf65cb58b3ab7b683a7c1ea6d180599a16ba87a0b64fb
|
7
|
+
data.tar.gz: 0eccc25eb4cbb0234abddf4b1e4c476500654ad751a1e13a3f29e887a11043fc611e4c6b1cf162d1fda5762a180d35d9f06f35de8bc53d5b5c28c3448849a0a2
|
data/lib/puck/bootstrap.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
if ARGV.any?
|
2
2
|
file_name = ARGV.shift
|
3
|
+
bin_file_found = false
|
3
4
|
PUCK_BIN_PATH.each do |dir|
|
4
5
|
relative_path = File.join(dir, file_name)
|
5
6
|
if File.exists?("classpath:/#{relative_path}")
|
7
|
+
bin_file_found = true
|
6
8
|
$0 = relative_path
|
7
9
|
load(relative_path)
|
8
|
-
|
10
|
+
break
|
9
11
|
end
|
10
12
|
end
|
11
|
-
|
13
|
+
unless bin_file_found
|
14
|
+
abort(%(No "#{file_name}" in #{PUCK_BIN_PATH.join(File::PATH_SEPARATOR)}))
|
15
|
+
end
|
12
16
|
end
|
data/lib/puck/configuration.rb
CHANGED
data/lib/puck/jar.rb
CHANGED
@@ -33,7 +33,8 @@ module Puck
|
|
33
33
|
# task :jar do
|
34
34
|
# jar = Puck::Jar.new(
|
35
35
|
# extra_files: Dir['config/*.yml'],
|
36
|
-
# jruby_complete: 'build/custom-jruby-complete.jar'
|
36
|
+
# jruby_complete: 'build/custom-jruby-complete.jar',
|
37
|
+
# merge_archives: Dir['external.jar']
|
37
38
|
# )
|
38
39
|
# jar.create
|
39
40
|
# end
|
@@ -53,6 +54,13 @@ module Puck
|
|
53
54
|
# in which case paths must be below the `:app_dir`, or a Hash, in which
|
54
55
|
# case the file specified by the key is included at the path specified by
|
55
56
|
# the corresponding value.
|
57
|
+
# @option configuration [Array<String>, Hash<String,String>] :merge_archives
|
58
|
+
# a list of Jars to be merged into the Jar. The option can be either an Array,
|
59
|
+
# in which case the source Jar or zip file will be merged at the root,
|
60
|
+
# or a Hash, in which case the Jar specified by the key is merged at the path
|
61
|
+
# specified by its value. Signature files ('META-INF/*.SF', 'META-INF/*.RSA',
|
62
|
+
# 'META-INF/*.DSA' and 'META-INF/SIG-*') are discarded in the merge,
|
63
|
+
# since they describe the source Jar and will not match the Jar produced by Puck.
|
56
64
|
# @option configuration [String] :gem_groups ([:default]) a list of gem
|
57
65
|
# groups to include in the Jar. Remember to include the default group if
|
58
66
|
# you override this option.
|
@@ -91,12 +99,18 @@ module Puck
|
|
91
99
|
temporary_output_path = File.join(Dir.mktmpdir, @configuration[:jar_name])
|
92
100
|
project_dir = Pathname.new(@configuration[:app_dir]).expand_path.cleanpath
|
93
101
|
extra_files = @configuration[:extra_files] || []
|
94
|
-
jruby_complete_path = @configuration[:jruby_complete]
|
95
102
|
|
96
103
|
if !(defined? JRubyJars) && !(jruby_complete_path && File.exists?(jruby_complete_path))
|
97
104
|
raise PuckError, 'Cannot build Jar: jruby-jars must be installed, or :jruby_complete must be specified'
|
98
105
|
end
|
99
106
|
|
107
|
+
merge_archives = (@configuration[:merge_archives] || []).to_a
|
108
|
+
if (jruby_complete = @configuration[:jruby_complete])
|
109
|
+
merge_archives << jruby_complete
|
110
|
+
else
|
111
|
+
merge_archives.push(JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path)
|
112
|
+
end
|
113
|
+
|
100
114
|
gem_dependencies = @dependency_resolver.resolve_gem_dependencies(@configuration)
|
101
115
|
create_jar_bootstrap!(tmp_dir, gem_dependencies)
|
102
116
|
|
@@ -110,13 +124,6 @@ module Puck
|
|
110
124
|
|
111
125
|
zipfileset dir: tmp_dir, includes: 'jar-bootstrap.rb'
|
112
126
|
|
113
|
-
if jruby_complete_path
|
114
|
-
zipfileset src: jruby_complete_path
|
115
|
-
else
|
116
|
-
zipfileset src: JRubyJars.core_jar_path
|
117
|
-
zipfileset src: JRubyJars.stdlib_jar_path
|
118
|
-
end
|
119
|
-
|
120
127
|
%w[bin lib].each do |sub_dir|
|
121
128
|
path = project_dir + sub_dir
|
122
129
|
if File.exists?(path)
|
@@ -140,6 +147,14 @@ module Puck
|
|
140
147
|
zipfileset dir: spec[:base_path], prefix: File.join(JAR_GEM_HOME, spec[:versioned_name])
|
141
148
|
end
|
142
149
|
end
|
150
|
+
|
151
|
+
merge_archives.each do |archive, target_path|
|
152
|
+
if target_path
|
153
|
+
zipfileset src: archive, prefix: target_path, excludes: SIGNATURE_FILES
|
154
|
+
else
|
155
|
+
zipfileset src: archive, excludes: SIGNATURE_FILES
|
156
|
+
end
|
157
|
+
end
|
143
158
|
end
|
144
159
|
|
145
160
|
FileUtils.mv(temporary_output_path, output_path)
|
@@ -162,6 +177,7 @@ module Puck
|
|
162
177
|
JAR_APP_HOME = 'META-INF/app.home'.freeze
|
163
178
|
JAR_GEM_HOME = 'META-INF/gem.home'.freeze
|
164
179
|
JAR_JRUBY_HOME = 'META-INF/jruby.home'.freeze
|
180
|
+
SIGNATURE_FILES = ['META-INF/*.SF', 'META-INF/*.RSA', 'META-INF/*.DSA', 'META-INF/SIG-*'].join(',').freeze
|
165
181
|
|
166
182
|
def create_jar_bootstrap!(tmp_dir, gem_dependencies)
|
167
183
|
File.open(File.join(tmp_dir, 'jar-bootstrap.rb'), 'w') do |io|
|
@@ -172,7 +188,7 @@ module Puck
|
|
172
188
|
io.puts
|
173
189
|
gem_dependencies.each do |spec|
|
174
190
|
spec[:load_paths].each do |load_path|
|
175
|
-
io.puts(%($LOAD_PATH << 'classpath
|
191
|
+
io.puts(%($LOAD_PATH << 'classpath:/#{JAR_GEM_HOME}/#{spec[:versioned_name]}/#{load_path}'))
|
176
192
|
end
|
177
193
|
end
|
178
194
|
io.puts
|
data/lib/puck/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Theo Hultberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Puck takes your app and packs it along with all your gems and a complete JRuby runtime in a standalone Jar file that can be run with just `java -jar …`
|
14
14
|
email:
|