jarbler 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -8
- data/README.md +14 -3
- data/lib/jarbler/JarMain.java +3 -1
- data/lib/jarbler/builder.rb +9 -7
- data/lib/jarbler/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5166483687f2467695c869afc03f491134d1bd74004d97ba706b1296f6836d1
|
4
|
+
data.tar.gz: 59d98964583486160c572d7c2ee8326f6f005a3cab558bd95b9114c5954a83eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5230dc737fd40641ee5fc2babaf5a982c5768f0d3281ad5fa384c3c9cc1814c575b33e906d69607a401475a1f46932be507dbed2b12fd28ba0c244bd84b10564
|
7
|
+
data.tar.gz: d6226dd8aa0c658eacc18caa868c0084232267f04c99f968d01ea88e0f929fa5c9cd94fab39b7f76cca3a934f46e5797e86afbd165fbba6c1e9f8b2fb381e83b
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,29 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [0.1.
|
3
|
+
## [0.1.5] - 2023-06-15
|
4
4
|
|
5
|
-
-
|
5
|
+
- Bugfix: use minor ruby version without patch level for Gem files location
|
6
|
+
|
7
|
+
## [0.1.4] - 2023-04-28
|
8
|
+
|
9
|
+
- Jarbler also supports Gemfile references to Gems with git dependencies now
|
10
|
+
|
11
|
+
## [0.1.3] - 2023-04-25
|
12
|
+
|
13
|
+
- Removed .jruby-version so that the jruby version is not fixed anymore
|
14
|
+
|
15
|
+
## [0.1.2] - 2023-04-24
|
16
|
+
|
17
|
+
- extract valid Gem paths from Bundler instead of using the environment variable GEM_PATH
|
6
18
|
|
7
19
|
## [0.1.1] - 2023-04-24
|
8
20
|
|
9
21
|
- Fixed the bug 'java.lang.ClassNotFoundException: org.jruby.Main' with Windows
|
10
22
|
|
11
|
-
## [0.1.
|
23
|
+
## [0.1.0] - 2023-04-12
|
12
24
|
|
13
|
-
-
|
25
|
+
- Initial release
|
14
26
|
|
15
|
-
## [0.1.3] - 2023-04-25
|
16
27
|
|
17
|
-
- Removed .jruby-version so that the jruby version is not fixed anymore
|
18
28
|
|
19
|
-
## [0.1.4] - 2023-04-28
|
20
29
|
|
21
|
-
- Jarbler also supports Gemfile references to Gems with git dependencies now
|
data/README.md
CHANGED
@@ -15,6 +15,8 @@ Install the gem and add to the application's Gemfile by executing:
|
|
15
15
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
16
|
|
17
17
|
$ gem install jarbler
|
18
|
+
|
19
|
+
[![Gem Version](https://badge.fury.io/rb/jarbler.svg)](https://badge.fury.io/rb/jarbler)
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
@@ -47,9 +49,18 @@ To create a template config file with information about all the supported config
|
|
47
49
|
|
48
50
|
$ jarble config
|
49
51
|
|
50
|
-
The default configuration
|
51
|
-
|
52
|
-
|
52
|
+
The default configuration if focused on Ruby on Rails applications.<br>
|
53
|
+
|
54
|
+
### Configuration options
|
55
|
+
| Option | Default value | Description |
|
56
|
+
|-------------------|--------------------------------------------------------------------------------|---------------------------------------------------------------------|
|
57
|
+
| executable | "bin/rails" | The ruby file to run at execution of jar file |
|
58
|
+
| executable_params | ["server", "-e", "production", "-p", "8080"] | Command line parameters to be used for the ruby executable |
|
59
|
+
| excludes | ["tmp/cache", "tmp/pids", ...] (see generated template file for whole content) | The files and dirs of the project to exlude from the include option |
|
60
|
+
| includes | ["app", "bin", "config", ...] (see generated template file for whole content) | The files and dirs of the project to include in the jar file |
|
61
|
+
| jar_name | < Name of project dir >.jar | The name of the generated jar file |
|
62
|
+
| jruby_version | The current most recent jRuby version | The version of the jRuby runtime to use |
|
63
|
+
|
53
64
|
|
54
65
|
## Troubleshooting
|
55
66
|
* Set DEBUG=true in environment to get additional runtime information
|
data/lib/jarbler/JarMain.java
CHANGED
@@ -57,7 +57,7 @@ class JarMain {
|
|
57
57
|
jarPath = jarPath.substring(1); // remove the leading slash
|
58
58
|
}
|
59
59
|
|
60
|
-
// extract the jarFile by
|
60
|
+
// extract the jarFile by unzipping it (not using the jar utility which may not be available)
|
61
61
|
System.out.println("Extracting files from "+jarPath+" to "+ newFolder.getAbsolutePath());
|
62
62
|
unzip(jarPath, newFolder.getAbsolutePath());
|
63
63
|
|
@@ -135,8 +135,10 @@ class JarMain {
|
|
135
135
|
debug(" - " + arg);
|
136
136
|
}
|
137
137
|
|
138
|
+
debug("jRuby set property 'user.dir' to '" + app_root + "'");
|
138
139
|
System.setProperty("user.dir", app_root);
|
139
140
|
// call the method org.jruby.Main.main
|
141
|
+
debug("Calling org.jruby.Main.main with: "+ mainArgs);
|
140
142
|
mainMethod.invoke(null, (Object)mainArgs.toArray(new String[mainArgs.size()]));
|
141
143
|
} catch (Exception e) {
|
142
144
|
e.printStackTrace();
|
data/lib/jarbler/builder.rb
CHANGED
@@ -18,7 +18,7 @@ module Jarbler
|
|
18
18
|
app_root = Dir.pwd
|
19
19
|
debug "Project dir: #{app_root}"
|
20
20
|
|
21
|
-
|
21
|
+
ruby_minor_version = copy_jruby_jars_to_staging(staging_dir) # Copy the jruby jars to the staging directory
|
22
22
|
exec_command "javac -nowarn -Xlint:deprecation -source 8 -target 8 -d #{staging_dir} #{__dir__}/JarMain.java" # Compile the Java files
|
23
23
|
|
24
24
|
# Copy the application project to the staging directory
|
@@ -31,7 +31,7 @@ module Jarbler
|
|
31
31
|
raise "Gemfile.lock not found in #{app_root}" unless File.exist?("#{app_root}/Gemfile.lock")
|
32
32
|
|
33
33
|
# Copy the needed Gems to the staging directory
|
34
|
-
copy_needed_gems_to_staging(staging_dir,
|
34
|
+
copy_needed_gems_to_staging(staging_dir, ruby_minor_version)
|
35
35
|
|
36
36
|
Dir.chdir(staging_dir) do
|
37
37
|
# create the manifest file
|
@@ -101,10 +101,10 @@ module Jarbler
|
|
101
101
|
|
102
102
|
# Copy the needed Gems to the staging directory
|
103
103
|
# @param staging_dir [String] the staging directory
|
104
|
-
# @param
|
104
|
+
# @param ruby_minor_version [String] the corresponding ruby minor version of the jruby jars version
|
105
105
|
# @return [void]
|
106
|
-
def copy_needed_gems_to_staging(staging_dir,
|
107
|
-
gem_target_location = "#{staging_dir}/gems/jruby/#{
|
106
|
+
def copy_needed_gems_to_staging(staging_dir, ruby_minor_version)
|
107
|
+
gem_target_location = "#{staging_dir}/gems/jruby/#{ruby_minor_version}"
|
108
108
|
FileUtils.mkdir_p("#{gem_target_location}/gems")
|
109
109
|
FileUtils.mkdir_p("#{gem_target_location}/specifications")
|
110
110
|
FileUtils.mkdir_p("#{gem_target_location}/bundler/gems")
|
@@ -200,7 +200,7 @@ module Jarbler
|
|
200
200
|
|
201
201
|
# Copy the jruby-jars to the staging directory
|
202
202
|
# @param [String] staging_dir Path to the staging directory
|
203
|
-
# @return [String] the ruby version of the jRuby jars
|
203
|
+
# @return [String] the minor ruby version of the jRuby jars with patch level set to 0
|
204
204
|
def copy_jruby_jars_to_staging(staging_dir)
|
205
205
|
|
206
206
|
# Ensure that jruby-jars gem is installed, otherwise install it. Accepts also bundler path in .bundle/config
|
@@ -224,7 +224,9 @@ module Jarbler
|
|
224
224
|
raise "Could not determine Ruby version for jRuby #{config.jruby_version} in following output:\n#{lines}" unless match_result
|
225
225
|
ruby_version = match_result[0].tr('()', '')
|
226
226
|
debug "Corresponding Ruby version for jRuby (#{config.jruby_version}): #{ruby_version}"
|
227
|
-
ruby_version
|
227
|
+
ruby_minor_version = ruby_version.split('.')[0..1].join('.') + '.0'
|
228
|
+
debug "Corresponding Ruby minor version for jRuby (#{config.jruby_version}): #{ruby_minor_version}"
|
229
|
+
ruby_minor_version
|
228
230
|
end
|
229
231
|
|
230
232
|
# Execute the command in OS and return the output
|
data/lib/jarbler/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Ramm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-15 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'
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.3.
|
58
|
+
rubygems_version: 3.0.3.1
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Pack a Ruby app into a Java jar file
|