naether 0.2.6-java → 0.3.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.3.0
data/jar_dependencies.yml CHANGED
@@ -1,37 +1,35 @@
1
1
  ---
2
2
  :dependencies:
3
- - ch.qos.logback:logback-classic:jar:0.9.24
4
- - ch.qos.logback:logback-core:jar:0.9.24
5
- - org.slf4j:slf4j-api:jar:1.6.1
6
- - org.slf4j:jcl-over-slf4j:jar:1.6.1
7
- - org.slf4j:log4j-over-slf4j:jar:1.6.1
8
- - org.codehaus.plexus:plexus-utils:jar:1.5.8
9
- - org.apache.maven:maven-model-v3:jar:2.0
10
- - org.codehaus.plexus:plexus-container-default:jar:1.5.5
11
- - org.codehaus.plexus:plexus-classworlds:jar:2.2.2
12
- - org.apache.xbean:xbean-reflect:jar:3.4
13
- - com.google.collections:google-collections:jar:1.0
14
- - org.sonatype.aether:aether-api:jar:1.11
15
- - org.sonatype.aether:aether-util:jar:1.11
16
- - org.sonatype.aether:aether-impl:jar:1.11
17
- - org.sonatype.aether:aether-spi:jar:1.11
18
- - org.sonatype.aether:aether-connector-file:jar:1.11
19
- - org.sonatype.aether:aether-connector-asynchttpclient:jar:1.11
20
- - com.ning:async-http-client:jar:1.6.1
21
- - org.jboss.netty:netty:jar:3.2.4.Final
22
- - org.sonatype.aether:aether-connector-wagon:jar:1.11
23
- - org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6
24
- - org.apache.maven:maven-aether-provider:jar:3.0.2
25
- - org.apache.maven:maven-model:jar:3.0.2
26
- - org.apache.maven:maven-model-builder:jar:3.0.2
27
- - org.codehaus.plexus:plexus-interpolation:jar:1.14
28
- - org.apache.maven:maven-repository-metadata:jar:3.0.2
29
- - org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
30
- - org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7
31
- - com.jcraft:jsch:jar:0.1.38
32
- - org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-7
33
- - org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-6
34
- - org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7
35
- - org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7
36
- - nekohtml:xercesMinimal:jar:1.9.6.2
37
- - nekohtml:nekohtml:jar:1.9.6.2
3
+ - com.jcraft:jsch:jar:0.1.38
4
+ - com.ning:async-http-client:jar:1.6.1
5
+ - org.apache.xbean:xbean-reflect:jar:3.4
6
+ - org.jboss.netty:netty:jar:3.2.4.Final
7
+ - com.google.collections:google-collections:jar:1.0
8
+ - ch.qos.logback:logback-classic:jar:0.9.24
9
+ - ch.qos.logback:logback-core:jar:0.9.24
10
+ - org.slf4j:slf4j-api:jar:1.6.1
11
+ - org.slf4j:jcl-over-slf4j:jar:1.6.1
12
+ - org.slf4j:log4j-over-slf4j:jar:1.6.1
13
+ - org.sonatype.aether:aether-api:jar:1.11
14
+ - org.sonatype.aether:aether-util:jar:1.11
15
+ - org.sonatype.aether:aether-impl:jar:1.11
16
+ - org.sonatype.aether:aether-spi:jar:1.11
17
+ - org.sonatype.aether:aether-connector-file:jar:1.11
18
+ - org.sonatype.aether:aether-connector-asynchttpclient:jar:1.11
19
+ - org.sonatype.aether:aether-connector-wagon:jar:1.11
20
+ - org.apache.maven:maven-model-v3:jar:2.0
21
+ - org.apache.maven:maven-aether-provider:jar:3.0.2
22
+ - org.apache.maven:maven-model:jar:3.0.2
23
+ - org.apache.maven:maven-model-builder:jar:3.0.2
24
+ - org.apache.maven:maven-repository-metadata:jar:3.0.2
25
+ - org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6
26
+ - org.apache.maven.wagon:wagon-ssh-common:jar:1.0-beta-7
27
+ - org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-beta-7
28
+ - org.apache.maven.wagon:wagon-http-shared:jar:1.0-beta-7
29
+ - org.apache.maven.wagon:wagon-ssh:jar:1.0-beta-7
30
+ - org.codehaus.plexus:plexus-utils:jar:1.5.8
31
+ - org.codehaus.plexus:plexus-container-default:jar:1.5.5
32
+ - org.codehaus.plexus:plexus-classworlds:jar:2.2.2
33
+ - org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
34
+ - org.codehaus.plexus:plexus-interpolation:jar:1.14
35
+ - org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-6
data/lib/naether.rb CHANGED
@@ -14,6 +14,7 @@ class Naether
14
14
  JAR_LIB = "#{File.dirname(__FILE__)}/.."
15
15
 
16
16
  class << self
17
+
17
18
  # Helper to determine the platform
18
19
  def platform
19
20
  $platform || RUBY_PLATFORM[/java/] || 'ruby'
@@ -24,6 +25,7 @@ class Naether
24
25
  Naether::Bootstrap.dependencies( dep_file )
25
26
  end
26
27
 
28
+ # Loads all jars from paths and creates a new instance of Naether
27
29
  def create_from_paths( deps_jar_dir, naether_jar_dir = nil )
28
30
  naether_jar_dir = naether_jar_dir || JAR_LIB
29
31
  Naether::Java.load_jars_dir( [deps_jar_dir, naether_jar_dir] )
@@ -31,6 +33,7 @@ class Naether
31
33
  Naether.new
32
34
  end
33
35
 
36
+ # Loads all jars creates a new instance of Naether
34
37
  def create_from_jars( jars )
35
38
  Naether::Java.load_jars( jars )
36
39
 
@@ -38,19 +41,19 @@ class Naether
38
41
  end
39
42
  end
40
43
 
41
- #
42
- # Create new instance
43
- #
44
+ # Create new instance. Naether.create_from_paths and Naether.create_from_jars should be
45
+ # used instead of Naether.new
44
46
  def initialize()
45
47
 
46
48
  if Naether.platform == 'java'
47
- @resolver = com.slackworks.Naether.new
49
+ @resolver = com.slackworks.naether.Naether.new
48
50
  else
49
- naetherClass = Rjb::import('com.slackworks.Naether')
51
+ naetherClass = Rjb::import('com.slackworks.naether.Naether')
50
52
  @resolver = naetherClass.new
51
53
  end
52
54
  end
53
55
 
56
+ # Clear all remote repositories
54
57
  def clear_remote_repositories
55
58
  @resolver.clearRemoteRepositories()
56
59
  end
@@ -60,8 +63,21 @@ class Naether
60
63
  @resolver.addRemoteRepository( url )
61
64
  end
62
65
 
66
+ # Array of remote repositories
63
67
  def remote_repositories
64
- @resolver.getRemoteRepositories()
68
+ if Naether.platform == 'java'
69
+ return @resolver.getRemoteRepositories()
70
+ else
71
+ return @resolver.getRemoteRepositories().toArray()
72
+ end
73
+ end
74
+
75
+ def local_repo_path
76
+ @resolver.getLocalRepoPath()
77
+ end
78
+
79
+ def local_repo_path=( path )
80
+ @resolver.setLocalRepoPath( path )
65
81
  end
66
82
 
67
83
  # Add a dependency in the notation: groupId:artifactId:type:version
@@ -77,18 +93,17 @@ class Naether
77
93
  end
78
94
 
79
95
  # Get dependencies
80
- def dependencies
96
+ def dependencies()
81
97
  if Naether.platform == 'java'
82
98
  return @resolver.getDependenciesNotation().to_a
83
99
  else
84
- bootstrap = Rjb::import('com.slackworks.Bootstrap')
85
100
  return @resolver.getDependenciesNotation().toArray().map{ |dep| dep.toString() }
86
101
  end
87
102
  end
88
103
 
89
104
  # Resolve dependencies, finding related additional dependencies
90
- def resolve_dependencies
91
- @resolver.resolveDependencies();
105
+ def resolve_dependencies( download_artifacts = true )
106
+ @resolver.resolveDependencies( download_artifacts );
92
107
  dependencies
93
108
  end
94
109
  end
@@ -25,9 +25,9 @@ class Naether
25
25
  Naether::Java.load_jars_dir( jar_path || Naether::JAR_LIB )
26
26
  deps = {};
27
27
  if Naether.platform == 'java'
28
- deps[:dependencies] = com.slackworks.Bootstrap.dependencies.to_a
28
+ deps[:dependencies] = com.slackworks.naether.Bootstrap.dependencies.to_a
29
29
  else
30
- bootstrap = Rjb::import('com.slackworks.Bootstrap')
30
+ bootstrap = Rjb::import('com.slackworks.naether.Bootstrap')
31
31
  deps[:dependencies] = bootstrap.dependencies.toArray().map{ |dep| dep.toString() }
32
32
  end
33
33
 
data/lib/naether/java.rb CHANGED
@@ -20,9 +20,8 @@ class Naether
20
20
  end
21
21
  end
22
22
 
23
- #
24
- #
25
- #
23
+
24
+ # Loads all jars from the array of paths
26
25
  def self.load_jars_dir(paths)
27
26
  unless paths.is_a? Array
28
27
  paths = [paths]
@@ -30,16 +29,14 @@ class Naether
30
29
 
31
30
  jars = []
32
31
  paths.each do |path|
33
- jars = jars + Dir.glob( "#{File.expand_path(path)}/*.jar")
32
+ jars = jars + Dir.glob( "#{File.expand_path(path)}/*.jar", File::FNM_CASEFOLD)
34
33
  end
35
34
 
36
35
  Naether::Java.load_jars(jars)
37
36
 
38
37
  end
39
38
 
40
- #
41
- # Load jars
42
- #
39
+ # Load jars for the runtime platform
43
40
  def self.load_jars(jars)
44
41
  if Naether.platform == 'java'
45
42
  Naether::Java::JRuby.instance.load_jars(jars)
@@ -49,7 +46,7 @@ class Naether
49
46
  end
50
47
 
51
48
  #
52
- # Handle loading for JRuby
49
+ # Handle loading jars for JRuby
53
50
  #
54
51
  class JRuby
55
52
  include Singleton
data/naether-0.2.1.jar CHANGED
Binary file
data/pom.xml CHANGED
@@ -8,16 +8,8 @@
8
8
  <packaging>jar</packaging>
9
9
 
10
10
  <name>naether</name>
11
- <url>http://maven.apache.org</url>
12
-
13
- <repositories>
14
- <repository>
15
- <id>people.apache.org</id>
16
- <name>Apache Snapshots</name>
17
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
18
- </repository>
19
- </repositories>
20
-
11
+ <url>https://github.com/mguymon/naether</url>
12
+
21
13
  <properties>
22
14
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23
15
  <aetherVersion>1.11</aetherVersion>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.6
5
+ version: 0.3.0
6
6
  platform: java
7
7
  authors:
8
8
  - Michael Guymon
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-28 00:00:00 -05:00
13
+ date: 2011-03-03 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency