naether 0.5.12 → 0.6.0

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.
@@ -1,6 +1,6 @@
1
1
  = Naether
2
2
 
3
- A Java Dependency Resolver using Maven's {Aether}[https://github.com/sonatype/sonatype-aether]
3
+ Naether is a Java Dependency Resolver using Maven's {Aether}[https://github.com/sonatype/sonatype-aether]
4
4
 
5
5
  https://github.com/mguymon/naether
6
6
 
@@ -12,11 +12,12 @@ gem install naether
12
12
 
13
13
  === About
14
14
 
15
- Built to power the {Buildr Resolver}[https://github.com/mguymon/buildr-resolver] for {Buildr}[https://github.com/apache/buildr],
16
- enabling dependency resolution to Buildr projects. The Java {Naether.java}[https://github.com/mguymon/naether/blob/master/src/main/java/com/slackworks/naether/Naether.java]
17
- is a basic wrapper for {Aether}[https://github.com/sonatype/sonatype-aether], Maven dependency resolution framework.
18
- The Ruby {naether.rb}[https://github.com/mguymon/naether/blob/master/src/main/ruby/naether.rb] provides access to Java
19
- from Ruby. JRuby is natively supported, other Ruby vms will use {Rjb}[http://rjb.rubyforge.org] to proxy over JNI.
15
+ {Naether}[https://github.com/mguymon/naether/blob/master/src/main/java/com/slackworks/naether/Naether.java]
16
+ is a wrapper for {Aether}[https://github.com/sonatype/sonatype-aether], the Maven dependency resolution framework.
17
+ {Naether.rb}[https://github.com/mguymon/naether/blob/master/src/main/ruby/naether.rb] provides access to Aether
18
+ from Ruby. JRuby is natively supported, other Ruby VMs will use {Rjb}[http://rjb.rubyforge.org] to proxy over JNI.
19
+
20
+ Beyond dependency resolution, provides support to install and deploy artifacts to a Maven repository.
20
21
 
21
22
 
22
23
  == License
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.12
1
+ 0.6.0
@@ -122,7 +122,11 @@ class Naether
122
122
  end
123
123
  end
124
124
 
125
- # Array of mixed dependencies
125
+ # Array of mixed dependencies.
126
+ # * Artifact notation in the format of groupId:artifactId:version or groupId:artifactId:type:version - 'junit:junit:4.7'
127
+ # * Hash of a single artifaction notation => scope - { 'junit:junit:4.7' => 'test' }
128
+ # * Path to a local pom - 'lib/pom.xml'
129
+ # * Hash of a single path to a local pom => scope - { 'lib/pom.xml' => ['compile','test'] }
126
130
  def dependencies=(dependencies)
127
131
  @resolver.clearDependencies()
128
132
 
@@ -180,14 +184,17 @@ class Naether
180
184
  end
181
185
  alias_method :dependenciesNotation, :dependencies_notation # some javaism snuck in
182
186
 
187
+ # Hash of dependency paths
183
188
  def dependencies_path
184
189
  Naether::Java.convert_to_ruby_hash( @resolver.getDependenciesPath(), true )
185
190
  end
186
191
 
192
+ # Convert dependencies to Classpath friendly string
187
193
  def dependencies_classpath()
188
194
  @resolver.getResolvedClassPath()
189
195
  end
190
196
 
197
+ # Load dependencies to Classpath
191
198
  def load_dependencies_to_classpath
192
199
  jars = dependencies_classpath.split(":")
193
200
  Naether::Java.load_jars(jars)
@@ -258,7 +265,12 @@ class Naether
258
265
  end
259
266
 
260
267
  if Naether.platform == 'java'
261
- deps = @project_instance.getDependenciesNotation( scopes, true )
268
+ if scopes.nil?
269
+ deps = @project_instance.getDependenciesNotation()
270
+ else
271
+ deps = @project_instance.getDependenciesNotation( scopes )
272
+ end
273
+
262
274
  else
263
275
  list = nil
264
276
  if scopes
@@ -266,8 +278,12 @@ class Naether
266
278
  scopes.each do |scope|
267
279
  list.add( scope )
268
280
  end
281
+
282
+ deps = @project_instance._invoke('getDependenciesNotation', 'Ljava.util.List;', list)
283
+ else
284
+ deps = @project_instance.getDependenciesNotation()
269
285
  end
270
- deps = @project_instance._invoke('getDependenciesNotation', 'Ljava.util.List;Z', list, true)
286
+
271
287
  end
272
288
 
273
289
  Naether::Java.convert_to_ruby_array( deps, true )
@@ -282,8 +298,23 @@ class Naether
282
298
  return @project_instance.getVersion()
283
299
  end
284
300
 
285
- # filePath to write the pom
301
+ # Create the XML for a Maven Pom for the notation, groupId:artifactId:type:version
302
+ #
303
+ # loads all resolved dependencies into pom
304
+ def build_pom( notation )
305
+ @project_instance = Naether::Java.create("com.slackworks.naether.maven.Project")
306
+ @project_instance.setProjectNotation( notation )
307
+
308
+ dependencies().each do |notation|
309
+ @project_instance.addDependency( notation )
310
+ end
311
+
312
+ @project_instance.toXml()
313
+
314
+ end
315
+
286
316
  # notation of the pom, groupId:artifactId:type:version
317
+ # filePath to write the pom
287
318
  #
288
319
  # loads all resolved dependencies into pom
289
320
  def write_pom( notation, file_path )
Binary file
data/pom.xml CHANGED
@@ -4,11 +4,14 @@
4
4
 
5
5
  <groupId>com.slackworks</groupId>
6
6
  <artifactId>naether</artifactId>
7
- <version>0.5.12</version>
7
+ <version>0.6.0</version>
8
8
  <packaging>jar</packaging>
9
9
  <name>naether</name>
10
10
  <url>https://github.com/mguymon/naether</url>
11
- <licenses>
11
+ <description>
12
+ A Java Dependency Resolver using Maven’s Aether.
13
+ </description>
14
+ <licenses>
12
15
  <license>
13
16
  <name>The Apache Software License, Version 2.0</name>
14
17
  <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
@@ -16,18 +19,31 @@
16
19
  </license>
17
20
  </licenses>
18
21
  <scm>
19
- <url>>scm:git:git@github.com/mguymon/naether.git</url>
22
+ <url>scm:git:git@github.com/mguymon/naether.git</url>
20
23
  <developerConnection>scm:git:git@github.com/mguymon/naether.git</developerConnection>
21
24
  <connection>git@github.com/mguymon/naether.git</connection>
22
25
  </scm>
23
-
26
+ <developers>
27
+ <developer>
28
+ <id>mguymon</id>
29
+ <name>Michael Guymon</name>
30
+ <email>michael.guymon@gmail.com</email>
31
+ </developer>
32
+ </developers>
33
+ <distributionManagement>
34
+ <repository>
35
+ <id>nexus-releases</id>
36
+ <name>Nexus Release Repository</name>
37
+ <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
38
+ </repository>
39
+ </distributionManagement>
24
40
  <properties>
25
41
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26
- <aetherVersion>1.13</aetherVersion>
42
+ <aetherVersion>1.13</aetherVersion>
27
43
  <mavenVersion>3.0.3</mavenVersion>
28
44
  <wagonVersion>1.0</wagonVersion>
29
- <org.slf4j.version>1.6.2</org.slf4j.version>
30
- </properties>
45
+ <org.slf4j.version>1.6.2</org.slf4j.version>
46
+ </properties>
31
47
  <dependencies>
32
48
  <dependency>
33
49
  <groupId>ch.qos.logback</groupId>
@@ -125,7 +141,6 @@
125
141
  </dependencies>
126
142
 
127
143
  <build>
128
-
129
144
  <plugins>
130
145
  <plugin>
131
146
  <groupId>org.apache.maven.plugins</groupId>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 12
10
- version: 0.5.12
8
+ - 6
9
+ - 0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Guymon
@@ -15,9 +15,11 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-13 00:00:00 Z
18
+ date: 2012-04-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :runtime
21
23
  requirement: &id001 !ruby/object:Gem::Requirement
22
24
  none: false
23
25
  requirements:
@@ -31,9 +33,9 @@ dependencies:
31
33
  version: 1.3.3
32
34
  version_requirements: *id001
33
35
  name: rjb
34
- prerelease: false
35
- type: :runtime
36
36
  - !ruby/object:Gem::Dependency
37
+ prerelease: false
38
+ type: :development
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
38
40
  none: false
39
41
  requirements:
@@ -47,9 +49,9 @@ dependencies:
47
49
  version: 2.1.0
48
50
  version_requirements: *id002
49
51
  name: rspec
52
+ - !ruby/object:Gem::Dependency
50
53
  prerelease: false
51
54
  type: :development
52
- - !ruby/object:Gem::Dependency
53
55
  requirement: &id003 !ruby/object:Gem::Requirement
54
56
  none: false
55
57
  requirements:
@@ -63,9 +65,9 @@ dependencies:
63
65
  version: 1.0.0
64
66
  version_requirements: *id003
65
67
  name: bundler
68
+ - !ruby/object:Gem::Dependency
66
69
  prerelease: false
67
70
  type: :development
68
- - !ruby/object:Gem::Dependency
69
71
  requirement: &id004 !ruby/object:Gem::Requirement
70
72
  none: false
71
73
  requirements:
@@ -79,8 +81,6 @@ dependencies:
79
81
  version: 1.5.2
80
82
  version_requirements: *id004
81
83
  name: jeweler
82
- prerelease: false
83
- type: :development
84
84
  description: Java dependency resolver using Maven's Aether
85
85
  email: michael.guymon@gmail.com
86
86
  executables: []
@@ -98,7 +98,7 @@ files:
98
98
  - lib/naether.rb
99
99
  - lib/naether/bootstrap.rb
100
100
  - lib/naether/java.rb
101
- - naether-0.5.12.jar
101
+ - naether-0.6.0.jar
102
102
  - pom.xml
103
103
  homepage: http://github.com/mguymon/naether
104
104
  licenses:
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  requirements: []
130
130
 
131
131
  rubyforge_project: naether
132
- rubygems_version: 1.8.15
132
+ rubygems_version: 1.8.12
133
133
  signing_key:
134
134
  specification_version: 3
135
135
  summary: Java dependency resolver using Maven's Aether
Binary file