jbundler 0.2.0 → 0.2.1
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/Build.md +1 -1
- data/Gemfile.lock +6 -3
- data/Readme.md +17 -6
- data/Test.md +0 -0
- data/bin/jbundler +19 -0
- data/lib/jbundler/aether.rb +5 -1
- data/lib/jbundler/cli.rb +49 -0
- data/lib/jbundler/cli.rb~ +5 -0
- data/lib/jbundler.jar +0 -0
- data/lib/jbundler.rb +1 -1
- metadata +89 -80
- data/Gemfile.lock- +0 -33
data/Build.md
CHANGED
@@ -12,7 +12,7 @@ to build the (extension) jar for the lib directory (prepare the jar before packa
|
|
12
12
|
|
13
13
|
this also runs all the test over a couple of jruy version each in 1.8 and 1.9 mode. so these tests take some time. in skip the tests when building the gem use:
|
14
14
|
|
15
|
-
```rmvn prepare-package
|
15
|
+
```rmvn prepare-package -DskipTests```
|
16
16
|
|
17
17
|
to build the gem in **target/jbundler-0.0.1.gem**
|
18
18
|
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
jbundler (0.2.
|
4
|
+
jbundler (0.2.1)
|
5
5
|
ruby-maven (= 3.0.4.0.29.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -18,10 +18,11 @@ GEM
|
|
18
18
|
gherkin (2.9.3-java)
|
19
19
|
json (>= 1.4.6)
|
20
20
|
json (1.7.3-java)
|
21
|
-
maven-tools (0.29.
|
21
|
+
maven-tools (0.29.3)
|
22
22
|
minitest (2.10.1)
|
23
|
+
rake (0.9.2.2)
|
23
24
|
ruby-maven (3.0.4.0.29.0)
|
24
|
-
maven-tools (
|
25
|
+
maven-tools (~> 0.29.1)
|
25
26
|
thor (~> 0.14.6)
|
26
27
|
term-ansicolor (1.0.7)
|
27
28
|
thor (0.14.6)
|
@@ -33,3 +34,5 @@ DEPENDENCIES
|
|
33
34
|
cucumber (~> 1.1.9)
|
34
35
|
jbundler!
|
35
36
|
minitest (~> 2.10.0)
|
37
|
+
rake (= 0.9.2.2)
|
38
|
+
thor (> 0.14.0, < 0.16.0)
|
data/Readme.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# jbundler #
|
1
|
+
# jbundler [](http://travis-ci.org/mkristian/jbundler) #
|
2
2
|
|
3
3
|
* the DSL mimics the one from bundler
|
4
4
|
* you can use maven like version declaration or rubygems/bundler like version ranges
|
5
|
-
* it locks down the versions like bundler inside "
|
5
|
+
* it locks down the versions like bundler inside "Jarfile.lock"
|
6
6
|
* you can declare jar dependency within a rubygems using the requirements directive of the gem specification. jbundler will include those jar dependencies into its classpath
|
7
7
|
* on the first run everything get resolved, any further run just the setup of classpath is done (without any maven involved)
|
8
8
|
* it integrates nicely with bundler when Bundler.require is used
|
@@ -37,13 +37,24 @@ update of single artifacts is not possible.
|
|
37
37
|
|
38
38
|
since the version resolution happens in two steps - first the gems then the jars/poms - it is possible in case of failure of the second one there could be another set of versions for the gems which would then succeed the jars/poms resolution. but there is plenty of possible ways to improve this (maven could resolve the gems as well, etc)
|
39
39
|
|
40
|
-
**
|
40
|
+
**Jarfile** is **not** a DSL, i.e. it is not ruby though it could use a ruby DSL to read the data (any contribution welcome).
|
41
41
|
|
42
|
+
jbundler does not obey the **$HOME/.m2/settings.xml** from maven where you usually declare proxies, mirrors, etc.
|
43
|
+
|
44
|
+
## adding a maven repository ##
|
45
|
+
|
46
|
+
the maven central is default repostory and is always there. adding another repository use following decalration
|
47
|
+
|
48
|
+
repository :first, "http://example.com/repo"
|
49
|
+
source 'second', "http://example.org/repo"
|
50
|
+
source "http://example.org/repo/3"
|
51
|
+
|
52
|
+
|
42
53
|
## jar/pom dependencies ##
|
43
54
|
|
44
55
|
a pom dependency is not associated with a jar file but has dependencies to other poms or jars.
|
45
56
|
|
46
|
-
dependencies can be declared either in **
|
57
|
+
dependencies can be declared either in **Jarfile**
|
47
58
|
|
48
59
|
jar 'org.slf4j:slf4j-simple', '> 1.6.2', '< 1.7.0'
|
49
60
|
jar 'org.sonatype.aether:aether-api', '1.13'
|
@@ -79,9 +90,9 @@ the *not* version **!3.4.5** can not be mapped properly to a maven version range
|
|
79
90
|
|
80
91
|
## update ##
|
81
92
|
|
82
|
-
update of a single artifact is not possible (yet). but to update the whole set of artifacts just delete the lockfile *
|
93
|
+
update of a single artifact is not possible (yet). but to update the whole set of artifacts just delete the lockfile *Jarfile.lock*
|
83
94
|
|
84
|
-
if jbundler sees that **Gemfile.lock** or **
|
95
|
+
if jbundler sees that **Gemfile.lock** or **Jarfile** is newer then the **.jbundler/classpath.rb** file then jbundler tries to gracefully upgrade towards the changes. the is a maven-like behaviour and once there are command line tools for jbundler they can behave like bundler.
|
85
96
|
|
86
97
|
## meta-fu ##
|
87
98
|
|
data/Test.md
ADDED
File without changes
|
data/bin/jbundler
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
if ARGV[0] == 'help'
|
5
|
+
|
6
|
+
require 'jbundler/cli'
|
7
|
+
|
8
|
+
JBundler::Cli.start
|
9
|
+
|
10
|
+
else
|
11
|
+
|
12
|
+
load Gem.bin_path('bundler', 'bundle')
|
13
|
+
|
14
|
+
ARGV << 'install' if ARGV.size == 0
|
15
|
+
require 'jbundler/cli'
|
16
|
+
|
17
|
+
JBundler::Cli.start
|
18
|
+
|
19
|
+
end
|
data/lib/jbundler/aether.rb
CHANGED
@@ -50,6 +50,10 @@ module JBundler
|
|
50
50
|
@gemfile ||= jbundler_env('BUNDLE_GEMFILE') || 'Gemfile'
|
51
51
|
end
|
52
52
|
|
53
|
+
def classpath_file
|
54
|
+
'.jbundler/classpath.rb'
|
55
|
+
end
|
56
|
+
|
53
57
|
def local_repository
|
54
58
|
# use maven default local repo as default
|
55
59
|
@local_maven_repository ||= (jbundler_env('JBUNDLE_LOCAL_REPOSITORY') ||
|
@@ -74,7 +78,7 @@ module JBundler
|
|
74
78
|
java_import 'jbundler.Aether'
|
75
79
|
rescue NameError
|
76
80
|
# assume this happens only when working on the git clone
|
77
|
-
raise "jbundler.jar is missing - maybe you need to build it first ?"
|
81
|
+
raise "jbundler.jar is missing - maybe you need to build it first ? try\n$ rmvn prepare-package -Dmaven.test.skip\n"
|
78
82
|
end
|
79
83
|
end
|
80
84
|
java_import 'jbundler.Aether'
|
data/lib/jbundler/cli.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'thor'
|
2
|
+
module JBundler
|
3
|
+
class Cli < Thor
|
4
|
+
no_tasks do
|
5
|
+
def mvn
|
6
|
+
@mvn ||= Maven::RubyMaven.new
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'install', "first `bundle install` is called and then the jar dependencies will be installed. for more details see `bundle help install`, jbundler will ignore all options. the install command is also the default when no command is given."
|
11
|
+
def install
|
12
|
+
require 'jbundler'
|
13
|
+
puts 'Your jbundle is complete! Use `jbundle show` to see where the bundled jars are installed.'
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'update', "first `bundle update` is called and if there are no options then the jar dependencies will be updated. for more details see `bundle help update`."
|
17
|
+
def update
|
18
|
+
if ARGV.size == 1
|
19
|
+
require 'java'
|
20
|
+
require 'jbundler/aether'
|
21
|
+
config = JBundler::AetherConfig.new
|
22
|
+
FileUtils.rm_f(config.jarfile + '.lock')
|
23
|
+
|
24
|
+
require 'jbundler'
|
25
|
+
puts 'Your jbundle is updated! Use `jbundle show` to see where the bundled jars are installed.'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'show', "first `bundle show` is called and if there are no options then the jar dependencies will be displayed. for more details see `bundle help show`."
|
30
|
+
def show
|
31
|
+
if ARGV.size == 1
|
32
|
+
require 'java'
|
33
|
+
require 'jbundler/aether'
|
34
|
+
require 'jbundler/classpath_file'
|
35
|
+
config = JBundler::AetherConfig.new
|
36
|
+
classpath_file = JBundler::ClasspathFile.new('.jbundler/classpath.rb')#config.classpath_file)
|
37
|
+
if classpath_file.exists?
|
38
|
+
classpath_file.require_classpath
|
39
|
+
puts "JBundler classpath:"
|
40
|
+
JBUNDLER_CLASSPATH.each do |path|
|
41
|
+
puts " * #{path}"
|
42
|
+
end
|
43
|
+
else
|
44
|
+
puts "JBundler classpath is not installed."
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/lib/jbundler.jar
CHANGED
Binary file
|
data/lib/jbundler.rb
CHANGED
@@ -9,7 +9,7 @@ jarfile = Maven::Tools::Jarfile.new(config.jarfile)
|
|
9
9
|
if config.skip
|
10
10
|
warn "skip jbundler setup"
|
11
11
|
else
|
12
|
-
classpath_file = JBundler::ClasspathFile.new(
|
12
|
+
classpath_file = JBundler::ClasspathFile.new(config.classpath_file)
|
13
13
|
gemfile_lock = JBundler::GemfileLock.new(jarfile, config.gemfile + '.lock')
|
14
14
|
|
15
15
|
if classpath_file.needs_update?(jarfile, gemfile_lock)
|
metadata
CHANGED
@@ -1,119 +1,128 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jbundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 0.2.0
|
5
|
+
version: 0.2.1
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
|
-
- Kristian Meier
|
8
|
+
- Kristian Meier
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2012-
|
13
|
+
date: 2012-08-03 00:00:00 Z
|
19
14
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: ruby-maven
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - "="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 3.0.4.0.29.0
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rake
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - "="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.9.2.2
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: thor
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - <
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.16.0
|
46
|
+
- - ">"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 0.14.0
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id003
|
39
51
|
description: |
|
40
52
|
using embedded maven to add jar support to bundler and add bundler like handling of version ranges to maven
|
41
53
|
|
42
54
|
email:
|
43
|
-
- m.kristian@web.de
|
44
|
-
executables:
|
45
|
-
|
55
|
+
- m.kristian@web.de
|
56
|
+
executables:
|
57
|
+
- jbundler
|
46
58
|
extensions: []
|
47
59
|
|
48
60
|
extra_rdoc_files: []
|
49
61
|
|
50
62
|
files:
|
51
|
-
-
|
52
|
-
- lib/jbundler.rb
|
53
|
-
- lib/jbundler
|
54
|
-
- lib/jbundler
|
55
|
-
- lib/jbundler/
|
56
|
-
- lib/jbundler/
|
57
|
-
- lib/jbundler/
|
58
|
-
- lib/jbundler/
|
59
|
-
- lib/jbundler/
|
60
|
-
- lib/jbundler/
|
61
|
-
- lib/jbundler/
|
62
|
-
- lib/jbundler/classpath_file.rb
|
63
|
-
- lib/jbundler/aether.rb
|
64
|
-
- lib/jbundler/
|
65
|
-
- lib/jbundler/
|
66
|
-
- lib/jbundler.
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
- spec/
|
71
|
-
- spec/
|
72
|
-
- spec/
|
73
|
-
- spec/
|
74
|
-
- spec/
|
75
|
-
- spec/
|
76
|
-
- spec/setup.rb
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
|
63
|
+
- bin/jbundler
|
64
|
+
- lib/jbundler.rb
|
65
|
+
- lib/jbundler.rb~
|
66
|
+
- lib/jbundler.jar
|
67
|
+
- lib/jbundler/cli.rb~
|
68
|
+
- lib/jbundler/maven_gemify3.rb~
|
69
|
+
- lib/jbundler/pom.rb
|
70
|
+
- lib/jbundler/pom.rb~
|
71
|
+
- lib/jbundler/mavenfile.rb~
|
72
|
+
- lib/jbundler/cli.rb
|
73
|
+
- lib/jbundler/maven_version.rb~
|
74
|
+
- lib/jbundler/classpath_file.rb
|
75
|
+
- lib/jbundler/aether.rb
|
76
|
+
- lib/jbundler/gemfile_lock.rb~
|
77
|
+
- lib/jbundler/gemfile_lock.rb
|
78
|
+
- lib/jbundler/classpath_file.rb~
|
79
|
+
- lib/jbundler/aether.rb~
|
80
|
+
- lib/jbundler/maven_util.rb~
|
81
|
+
- lib/jbundler/maven.rb~
|
82
|
+
- spec/maven_util_spec.rb~
|
83
|
+
- spec/mavenfile_spec.rb~
|
84
|
+
- spec/pom_spec.rb~
|
85
|
+
- spec/classpath_file_spec.rb~
|
86
|
+
- spec/aether_spec.rb~
|
87
|
+
- spec/classpath_file_spec.rb
|
88
|
+
- spec/setup.rb
|
89
|
+
- spec/pom_spec.rb
|
90
|
+
- spec/aether_spec.rb
|
91
|
+
- spec/setup.rb~
|
92
|
+
- MIT-LICENSE
|
93
|
+
- Build.md
|
94
|
+
- Readme.md
|
95
|
+
- Test.md
|
96
|
+
- Gemfile
|
97
|
+
- Gemfile.lock
|
98
|
+
homepage: https://github.com/mkristian/jbundler
|
84
99
|
licenses: []
|
85
100
|
|
86
101
|
post_install_message:
|
87
102
|
rdoc_options: []
|
88
103
|
|
89
104
|
require_paths:
|
90
|
-
- lib
|
105
|
+
- lib
|
91
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
92
107
|
none: false
|
93
108
|
requirements:
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
version: "0"
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
100
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
113
|
none: false
|
102
114
|
requirements:
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
segments:
|
107
|
-
- 0
|
108
|
-
version: "0"
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: "0"
|
109
118
|
requirements: []
|
110
119
|
|
111
120
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.8.
|
121
|
+
rubygems_version: 1.8.24
|
113
122
|
signing_key:
|
114
123
|
specification_version: 3
|
115
124
|
summary: bundler support for maven or/and maven support for bundler
|
116
125
|
test_files:
|
117
|
-
- spec/classpath_file_spec.rb
|
118
|
-
- spec/pom_spec.rb
|
119
|
-
- spec/aether_spec.rb
|
126
|
+
- spec/classpath_file_spec.rb
|
127
|
+
- spec/pom_spec.rb
|
128
|
+
- spec/aether_spec.rb
|
data/Gemfile.lock-
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
jbundler (0.2.0)
|
5
|
-
ruby-maven (= 3.0.4.0.29.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
builder (3.0.0)
|
11
|
-
cucumber (1.1.9)
|
12
|
-
builder (>= 2.1.2)
|
13
|
-
diff-lcs (>= 1.1.2)
|
14
|
-
gherkin (~> 2.9.0)
|
15
|
-
json (>= 1.4.6)
|
16
|
-
term-ansicolor (>= 1.0.6)
|
17
|
-
diff-lcs (1.1.3)
|
18
|
-
gherkin (2.9.3-java)
|
19
|
-
json (>= 1.4.6)
|
20
|
-
json (1.7.3-java)
|
21
|
-
minitest (2.10.1)
|
22
|
-
ruby-maven (3.0.4.0.29.0)
|
23
|
-
thor (~> 0.14.6)
|
24
|
-
term-ansicolor (1.0.7)
|
25
|
-
thor (0.14.6)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
java
|
29
|
-
|
30
|
-
DEPENDENCIES
|
31
|
-
cucumber (~> 1.1.9)
|
32
|
-
jbundler!
|
33
|
-
minitest (~> 2.10.0)
|