doubleshot 0.1.0-java → 0.2.0-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.
Files changed (56) hide show
  1. data/Doubleshot +21 -10
  2. data/README.textile +13 -5
  3. data/bin/doubleshot +9 -1
  4. data/ext/java/Aether.java +199 -0
  5. data/ext/java/ManualWagonProvider.java +24 -0
  6. data/ext/java/SimpleRepositoryListener.java +77 -0
  7. data/lib/doubleshot.rb +155 -9
  8. data/lib/doubleshot/cli.rb +2 -1
  9. data/lib/doubleshot/cli/options.rb +3 -1
  10. data/lib/doubleshot/commands/build.rb +47 -9
  11. data/lib/doubleshot/commands/gem.rb +30 -9
  12. data/lib/doubleshot/commands/init.rb +41 -10
  13. data/lib/doubleshot/commands/install.rb +4 -4
  14. data/lib/doubleshot/commands/jar.rb +60 -2
  15. data/lib/doubleshot/commands/pom.rb +29 -0
  16. data/lib/doubleshot/commands/test.rb +85 -32
  17. data/lib/doubleshot/compiler.rb +20 -17
  18. data/lib/doubleshot/compiler/classpath.rb +46 -0
  19. data/lib/doubleshot/configuration.rb +158 -8
  20. data/lib/doubleshot/dependencies/dependency.rb +16 -15
  21. data/lib/doubleshot/dependencies/dependency_list.rb +20 -5
  22. data/lib/doubleshot/dependencies/gem_dependency.rb +35 -0
  23. data/lib/doubleshot/dependencies/gem_dependency_list.rb +1 -1
  24. data/lib/doubleshot/dependencies/jar_dependency.rb +64 -1
  25. data/lib/doubleshot/dependencies/jar_dependency_list.rb +1 -1
  26. data/lib/doubleshot/jar.rb +13 -2
  27. data/lib/doubleshot/lockfile.rb +108 -0
  28. data/lib/doubleshot/pom.rb +42 -0
  29. data/lib/doubleshot/readonly_collection.rb +6 -2
  30. data/lib/doubleshot/resolver.rb +22 -0
  31. data/lib/doubleshot/resolver/jar_resolver.rb +36 -0
  32. data/lib/doubleshot/setup.rb +1 -47
  33. data/lib/ruby/blank.rb +3 -3
  34. data/lib/ruby/pathname.rb +8 -4
  35. data/lib/ruby/time.rb +1 -2
  36. data/target/doubleshot.jar +0 -0
  37. data/test/compiler/classpath_spec.rb +74 -0
  38. data/test/compiler_spec.rb +89 -10
  39. data/test/configuration/source_locations_spec.rb +2 -2
  40. data/test/configuration_spec.rb +115 -17
  41. data/test/dependencies/dependency_list_spec.rb +26 -4
  42. data/test/dependencies/dependency_spec.rb +19 -18
  43. data/test/dependencies/gem_dependency_list_spec.rb +0 -0
  44. data/test/dependencies/gem_dependency_spec.rb +54 -0
  45. data/test/dependencies/jar_dependency_list_spec.rb +0 -0
  46. data/test/dependencies/jar_dependency_spec.rb +62 -1
  47. data/test/dependencies_spec.rb +4 -4
  48. data/test/doubleshot_spec.rb +34 -2
  49. data/test/helper.rb +36 -1
  50. data/test/lockfile_spec.rb +236 -0
  51. data/test/pom_spec.rb +66 -0
  52. data/test/readonly_collection_spec.rb +10 -3
  53. data/test/resolver/jar_resolver_spec.rb +34 -0
  54. data/test/resolver_spec.rb +25 -0
  55. metadata +28 -28
  56. data/ext/java/Empty.java +0 -0
data/test/pom_spec.rb ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ # encoding: utf-8
4
+
5
+ require_relative "helper"
6
+ require "doubleshot/pom"
7
+
8
+ describe Doubleshot::Pom do
9
+ before do
10
+ @config = Doubleshot.new do |config|
11
+ config.project = "doubleshot"
12
+ config.group = "org.sam.doubleshot"
13
+ config.version = "1.0"
14
+
15
+ config.jar "org.jruby:jruby-complete:jar:1.7.0.RC1"
16
+ config.jar "org.sonatype.aether:aether-api:jar:1.13.1"
17
+ config.jar "org.sonatype.aether:aether-util:jar:1.13.1"
18
+
19
+ config.gemspec do |spec|
20
+ spec.summary = "Build, Dependencies and Testing all in one!"
21
+ spec.description = "Description"
22
+ spec.author = "Sam Smoot"
23
+ spec.homepage = "https://github.com/sam/doubleshot"
24
+ spec.email = "ssmoot@gmail.com"
25
+ spec.license = "MIT-LICENSE"
26
+ spec.executables = [ "doubleshot" ]
27
+ end
28
+ end.config
29
+ end
30
+
31
+ it "must generate valid POM markup" do
32
+ Doubleshot::Pom.new(@config).to_s.must_equal <<-EOS.margin
33
+ <?xml version="1.0"?>
34
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
35
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
36
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
37
+ <modelVersion>4.0.0</modelVersion>
38
+ <groupId>org.sam.doubleshot</groupId>
39
+ <artifactId>doubleshot</artifactId>
40
+ <version>1.0</version>
41
+ <packaging>pom</packaging>
42
+ <name>doubleshot</name>
43
+ <dependencies>
44
+ <dependency>
45
+ <groupId>org.jruby</groupId>
46
+ <artifactId>jruby-complete</artifactId>
47
+ <type>jar</type>
48
+ <version>1.7.0.RC1</version>
49
+ </dependency>
50
+ <dependency>
51
+ <groupId>org.sonatype.aether</groupId>
52
+ <artifactId>aether-api</artifactId>
53
+ <type>jar</type>
54
+ <version>1.13.1</version>
55
+ </dependency>
56
+ <dependency>
57
+ <groupId>org.sonatype.aether</groupId>
58
+ <artifactId>aether-util</artifactId>
59
+ <type>jar</type>
60
+ <version>1.13.1</version>
61
+ </dependency>
62
+ </dependencies>
63
+ </project>
64
+ EOS
65
+ end
66
+ end
@@ -10,19 +10,26 @@ describe Doubleshot::ReadonlyCollection do
10
10
  @readonly_collection = Doubleshot::ReadonlyCollection.new(@test_set)
11
11
  end
12
12
 
13
- it "should accept only Enumerables during initialization" do
13
+ it "must accept only Enumerables during initialization" do
14
14
  assert_raises(ArgumentError) do
15
15
  Doubleshot::ReadonlyCollection.new(Object.new)
16
16
  end
17
17
  end
18
18
 
19
+ it "must allow you to concatenate two collections" do
20
+ one = Doubleshot::ReadonlyCollection.new [ 1, 2, 3 ]
21
+ two = Doubleshot::ReadonlyCollection.new [ 4, 5, 6 ]
22
+
23
+ (one + two).entries.must_equal [ 1, 2, 3, 4, 5, 6 ]
24
+ end
25
+
19
26
  describe "empty?" do
20
27
  it "must be empty" do
21
- Doubleshot::ReadonlyCollection.new([]).must_be :empty?
28
+ Doubleshot::ReadonlyCollection.new([]).must_be_empty
22
29
  end
23
30
 
24
31
  it "wont be empty" do
25
- @readonly_collection.wont_be :empty?
32
+ @readonly_collection.wont_be_empty
26
33
  end
27
34
  end
28
35
 
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ # encoding: utf-8
4
+
5
+ require_relative "../helper"
6
+
7
+ describe Doubleshot::Resolver::JarResolver do
8
+ before do
9
+ @resolver = Doubleshot::Resolver::JarResolver.new(Doubleshot::Resolver::JarResolver::DEFAULT_REPOSITORY)
10
+ end
11
+
12
+ describe "fetch" do
13
+ before do
14
+ @dependencies = Doubleshot::Dependencies::JarDependencyList.new
15
+ @dependencies.fetch("com.pyx4j:maven-plugin-log4j:jar:1.0.1")
16
+ @dependencies.fetch("org.springframework:spring-core:jar:3.1.2.RELEASE")
17
+ @dependencies.fetch("org.hibernate:hibernate-core:jar:4.1.7.Final")
18
+ end
19
+
20
+ it "must return the same JarDependencyList" do
21
+ @resolver.resolve!(@dependencies).must_be_same_as @dependencies
22
+ end
23
+
24
+ it "must take a JarDependencyList and populate the path of each JarDependency" do
25
+ @resolver.resolve!(@dependencies).each do |dependency|
26
+ dependency.path.wont_be_nil
27
+ end
28
+ end
29
+
30
+ it "must populate transitive dependencies" do
31
+ @resolver.resolve!(@dependencies).size.must_equal 16
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ # encoding: utf-8
4
+
5
+ require_relative "helper"
6
+
7
+ describe Doubleshot::Resolver do
8
+ describe "repositories" do
9
+ it "must initialize with a list of repository URIs" do
10
+ resolver = Doubleshot::Resolver.new("http://localhost")
11
+ resolver.repositories.each do |repository|
12
+ repository.must_be_kind_of URI
13
+ end
14
+ end
15
+
16
+ it "must return a ReadonlyCollection" do
17
+ Doubleshot::Resolver.new("http://localhost").repositories.must_be_kind_of Doubleshot::ReadonlyCollection
18
+ end
19
+
20
+ it "must require at least one repository" do
21
+ -> { Doubleshot::Resolver.new }.must_raise(ArgumentError)
22
+ end
23
+ end
24
+
25
+ end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: doubleshot
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  platform: java
7
7
  authors:
8
8
  - Sam Smoot
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -29,24 +29,6 @@ dependencies:
29
29
  none: false
30
30
  prerelease: false
31
31
  type: :runtime
32
- - !ruby/object:Gem::Dependency
33
- name: jbundler
34
- version_requirements: !ruby/object:Gem::Requirement
35
- requirements:
36
- - - ! '>='
37
- - !ruby/object:Gem::Version
38
- version: !binary |-
39
- MA==
40
- none: false
41
- requirement: !ruby/object:Gem::Requirement
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: !binary |-
46
- MA==
47
- none: false
48
- prerelease: false
49
- type: :runtime
50
32
  - !ruby/object:Gem::Dependency
51
33
  name: rdoc
52
34
  version_requirements: !ruby/object:Gem::Requirement
@@ -121,15 +103,13 @@ dependencies:
121
103
  requirements:
122
104
  - - ! '>='
123
105
  - !ruby/object:Gem::Version
124
- version: !binary |-
125
- MA==
106
+ version: 0.5.3
126
107
  none: false
127
108
  requirement: !ruby/object:Gem::Requirement
128
109
  requirements:
129
110
  - - ! '>='
130
111
  - !ruby/object:Gem::Version
131
- version: !binary |-
132
- MA==
112
+ version: 0.5.3
133
113
  none: false
134
114
  prerelease: false
135
115
  type: :runtime
@@ -137,13 +117,13 @@ dependencies:
137
117
  name: rb-fsevent
138
118
  version_requirements: !ruby/object:Gem::Requirement
139
119
  requirements:
140
- - - ~>
120
+ - - ! '>='
141
121
  - !ruby/object:Gem::Version
142
122
  version: 0.9.1
143
123
  none: false
144
124
  requirement: !ruby/object:Gem::Requirement
145
125
  requirements:
146
- - - ~>
126
+ - - ! '>='
147
127
  - !ruby/object:Gem::Version
148
128
  version: 0.9.1
149
129
  none: false
@@ -201,6 +181,7 @@ executables:
201
181
  extensions: []
202
182
  extra_rdoc_files: []
203
183
  files:
184
+ - test/compiler/classpath_spec.rb
204
185
  - test/compiler_spec.rb
205
186
  - test/configuration/source_locations_spec.rb
206
187
  - test/configuration_spec.rb
@@ -213,8 +194,11 @@ files:
213
194
  - test/dependencies_spec.rb
214
195
  - test/doubleshot_spec.rb
215
196
  - test/helper.rb
197
+ - test/lockfile_spec.rb
198
+ - test/pom_spec.rb
216
199
  - test/readonly_collection_spec.rb
217
- - bin/doubleshot
200
+ - test/resolver/jar_resolver_spec.rb
201
+ - test/resolver_spec.rb
218
202
  - !binary |-
219
203
  RG91Ymxlc2hvdA==
220
204
  - !binary |-
@@ -228,7 +212,9 @@ files:
228
212
  - lib/doubleshot/commands/init.rb
229
213
  - lib/doubleshot/commands/install.rb
230
214
  - lib/doubleshot/commands/jar.rb
215
+ - lib/doubleshot/commands/pom.rb
231
216
  - lib/doubleshot/commands/test.rb
217
+ - lib/doubleshot/compiler/classpath.rb
232
218
  - lib/doubleshot/compiler.rb
233
219
  - lib/doubleshot/configuration/source_locations.rb
234
220
  - lib/doubleshot/configuration.rb
@@ -240,7 +226,11 @@ files:
240
226
  - lib/doubleshot/dependencies/jar_dependency_list.rb
241
227
  - lib/doubleshot/dependencies.rb
242
228
  - lib/doubleshot/jar.rb
229
+ - lib/doubleshot/lockfile.rb
230
+ - lib/doubleshot/pom.rb
243
231
  - lib/doubleshot/readonly_collection.rb
232
+ - lib/doubleshot/resolver/jar_resolver.rb
233
+ - lib/doubleshot/resolver.rb
244
234
  - lib/doubleshot/setup.rb
245
235
  - lib/doubleshot.rb
246
236
  - lib/ruby/blank.rb
@@ -249,7 +239,11 @@ files:
249
239
  - lib/ruby/pathname.rb
250
240
  - lib/ruby/string.rb
251
241
  - lib/ruby/time.rb
252
- - ext/java/Empty.java
242
+ - ext/java/Aether.java
243
+ - ext/java/ManualWagonProvider.java
244
+ - ext/java/SimpleRepositoryListener.java
245
+ - target/doubleshot.jar
246
+ - bin/doubleshot
253
247
  homepage: https://github.com/sam/doubleshot
254
248
  licenses:
255
249
  - MIT-LICENSE
@@ -264,6 +258,7 @@ rdoc_options:
264
258
  - README.textile
265
259
  require_paths:
266
260
  - lib
261
+ - target
267
262
  required_ruby_version: !ruby/object:Gem::Requirement
268
263
  requirements:
269
264
  - - ! '>='
@@ -285,6 +280,7 @@ signing_key:
285
280
  specification_version: 3
286
281
  summary: Doubleshot is a build and dependency tool for mixed Java and Ruby projects
287
282
  test_files:
283
+ - test/compiler/classpath_spec.rb
288
284
  - test/compiler_spec.rb
289
285
  - test/configuration/source_locations_spec.rb
290
286
  - test/configuration_spec.rb
@@ -297,4 +293,8 @@ test_files:
297
293
  - test/dependencies_spec.rb
298
294
  - test/doubleshot_spec.rb
299
295
  - test/helper.rb
296
+ - test/lockfile_spec.rb
297
+ - test/pom_spec.rb
300
298
  - test/readonly_collection_spec.rb
299
+ - test/resolver/jar_resolver_spec.rb
300
+ - test/resolver_spec.rb
data/ext/java/Empty.java DELETED
File without changes