jarbler 0.4.6 → 0.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48b6fba9a7ec8ccee040f91610cff305443ded429167fe6cf56b8b57491d11fe
4
- data.tar.gz: 1e9535dac8014e69db495dacea161216d674106bbd82c50d73ec6fc2912d1178
3
+ metadata.gz: d88d349fabf49c5b9ea16086626224f646c48fb2728c902639111a77a3dc56b2
4
+ data.tar.gz: 1a4f5b5391d5345cd6f93125ad62e3f166ee284620dc1c6055d65d383b7323ef
5
5
  SHA512:
6
- metadata.gz: babcb3d934484da62fb54bc1c3582305e1980ebddb376e1dee68abac65d117b7ec562b279c74947c451e176d87a85485dd245738b9a7da17e70799c08921d567
7
- data.tar.gz: 37100108a44b8001cacc7c8a827117bc350c0b59d94bd177e7893b4a4c67873ef6ee6c887e36f0c9ec53d8d15907fc410075f1ac16fb33f15552290c13be9245
6
+ metadata.gz: f52227bb7e0a056b378e55418f43089bc559ce4254d96487d8f74413990e49ac8af1ffa9f178f188b9c6eacd9218d222e33714803154a3e7a28b8bb927e7a5fe
7
+ data.tar.gz: ce2d2990496544e91cad453db873ef4c9dec9ff3ea50e5b4d0c928e9feed75dd24b6de2d397dac74bc803c167ee6ffa044be2267e069c78dc7113f9dc5ba8c9a
data/CHANGELOG.md CHANGED
@@ -1,8 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.7] - 2026-04-08
4
+ - Enhance 'excluded_gems' so that an empty extension dir with 'gem.build_complete' is included in jar file
5
+
3
6
  ## [0.4.6] - 2026-04-07
4
- - New config attribute 'exclude_gems' to exclude certain gems from being included in the jar file. <br/>
5
- Gems specified in 'exclude_gems' are not included in the jar file and not available at runtime. <br/>
7
+ - New config attribute 'excluded_gems' to exclude certain gems from being included in the jar file. <br/>
8
+ Gems specified in 'excluded_gems' are not included in the jar file and not available at runtime. <br/>
6
9
  This allows to exclude gems which are dependencies of other gems that are not needed for the application and are excluded from initialization by 'gem name, require: false'.
7
10
 
8
11
  ## [0.4.5] - 2026-03-10
@@ -143,15 +143,23 @@ module Jarbler
143
143
  # spec.loaded_from contains the path to the gemspec file including the path prefix "default/" for default gems
144
144
  file_utils_copy(spec.loaded_from, "#{gem_target_location}/specifications")
145
145
 
146
- unless config.excluded_gems.include?(needed_gem[:name]) # only the spec file needs to be included for excluded_gems
147
- debug "Adding local Gem from dir '#{spec.gem_dir}' into jar file at temporary location '#{gem_target_location}/gems'"
148
- file_utils_copy(spec.gem_dir, "#{gem_target_location}/gems") unless config.excluded_gems.include?(needed_gem[:name])
149
-
150
- if spec.extension_dir && Dir.exist?(spec.extension_dir)
146
+ # Extensions are needed even if config.excluded_gems includes the Gem
147
+ if spec.extension_dir && Dir.exist?(spec.extension_dir)
148
+ unless config.excluded_gems.include?(needed_gem[:name])
151
149
  debug "Adding extension from dir '#{spec.extension_dir}' into jar file at temporary location '#{extension_target_location}'"
152
150
  puts "Adding extension from dir '#{spec.extension_dir}' into jar file but extension is not for platform 'universal-java-xx'!!!" unless spec.extension_dir['universal-java']
153
151
  file_utils_copy(spec.extension_dir, extension_target_location)
152
+ else
153
+ faked_extension_dir = File.join(extension_target_location, needed_gem[:full_name])
154
+ debug "Faking empty extension dir '#{faked_extension_dir}' with gem.build_complete only for excluded gem"
155
+ Dir.mkdir(faked_extension_dir)
156
+ FileUtils.touch(File.join(faked_extension_dir, 'gem.build_complete'))
154
157
  end
158
+ end
159
+
160
+ unless config.excluded_gems.include?(needed_gem[:name]) # only the spec file needs to be included for excluded_gems
161
+ debug "Adding local Gem from dir '#{spec.gem_dir}' into jar file at temporary location '#{gem_target_location}/gems'"
162
+ file_utils_copy(spec.gem_dir, "#{gem_target_location}/gems") unless config.excluded_gems.include?(needed_gem[:name])
155
163
 
156
164
  spec.executables.each do |executable|
157
165
  debug "Adding executable of local Gem from dir '#{spec.bin_dir}/#{executable}/' into jar file at temporary location '#{gem_target_location}/bin'"
@@ -190,7 +198,7 @@ module Jarbler
190
198
  unless needed_gems.map{|n| n[:full_name]}.include?(lockfile_spec.full_name)
191
199
  needed_gems << { full_name: lockfile_spec.full_name, name: lockfile_spec.name, version: lockfile_spec.version }
192
200
  end
193
- debug "Direct Gem dependency: #{lockfile_spec.full_name}"
201
+ debug "Direct Gem dependency: #{lockfile_spec.full_name}#{" : Gem should by excluded in jar according to 'excluded_gems'" if config.excluded_gems.include?(lockfile_spec.name)}"
194
202
  add_indirect_dependencies(lockfile_specs, lockfile_spec, needed_gems)
195
203
  else
196
204
  if gemfile_spec.name == 'bundler'
@@ -216,7 +224,7 @@ module Jarbler
216
224
  lockfile_spec.dependencies.each do |lockfile_spec_dep|
217
225
  lockfile_spec_found = lockfile_specs.find { |lockfile_spec| lockfile_spec.name == lockfile_spec_dep.name }
218
226
  if lockfile_spec_found
219
- debug "Indirect Gem dependency from #{lockfile_spec.full_name}: #{lockfile_spec_found.full_name}"
227
+ debug "Indirect Gem dependency from #{lockfile_spec.full_name}: #{lockfile_spec_found.full_name}#{" : Gem should be excluded in jar according to 'excluded_gems'" if config.excluded_gems.include?(lockfile_spec_found.name)}"
220
228
  unless needed_gems.map{|n| n[:full_name]}.include?(lockfile_spec_found.full_name)
221
229
  needed_gems << { full_name: lockfile_spec_found.full_name, name: lockfile_spec_found.name, version: lockfile_spec_found.version }
222
230
  add_indirect_dependencies(lockfile_specs, lockfile_spec_found, needed_gems)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jarbler
4
- VERSION = "0.4.6"
5
- VERSION_DATE = "2026-04-07"
4
+ VERSION = "0.4.7"
5
+ VERSION_DATE = "2026-04-08"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Ramm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-04-07 00:00:00.000000000 Z
11
+ date: 2026-04-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Pack a Ruby app combined with JRuby runtime and all its Gem dependencies
14
14
  into a jar file to simply run the app on any Java platform by '> java -jar file.jar'