naether 0.3.2-java → 0.3.3-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/lib/naether.rb +34 -5
  3. data/naether-0.3.1.jar +0 -0
  4. data/pom.xml +0 -15
  5. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/lib/naether.rb CHANGED
@@ -85,19 +85,48 @@ class Naether
85
85
  end
86
86
 
87
87
  # Add a dependency in the notation: groupId:artifactId:type:version
88
- def add_dependency( notation )
89
- @resolver.addDependency( notation )
88
+ def add_notation_dependency( notation, scope='compile' )
89
+ @resolver.addDependency( notation, scope )
90
+ end
91
+
92
+ # Add a dependency
93
+ def add_dependency( dependency )
94
+ #@resolver.addDependency( dependency )
95
+ if Naether.platform == 'java'
96
+ @resolver.addDependency( dependency )
97
+ else
98
+ @resolver._invoke('addDependency', 'Lorg.sonatype.aether.graph.Dependency;', dependency)
99
+ end
90
100
  end
91
101
 
92
102
  # Set array of dependencies in the notation: groupId:artifactId:type:version
93
103
  def dependencies=(dependencies)
104
+ @resolver.clearDependencies()
94
105
  dependencies.each do |dependent|
95
- add_dependency( dependent )
106
+ # Hash of notation => scope
107
+ if dependent.is_a? Hash
108
+ key = dependent.keys.first
109
+ add_notation_dependency( key, dependent[key] )
110
+
111
+ # String notation with compile scope
112
+ elsif dependent.is_a? String
113
+ add_notation_dependency( dependent, 'compile' )
114
+ else
115
+ add_dependency( dependent )
116
+ end
96
117
  end
97
118
  end
98
119
 
99
120
  # Get dependencies
100
121
  def dependencies()
122
+ if Naether.platform == 'java'
123
+ return @resolver.getDependencies().to_a
124
+ else
125
+ return @resolver.getDependencies().toArray()
126
+ end
127
+ end
128
+
129
+ def dependenciesNotation()
101
130
  if Naether.platform == 'java'
102
131
  return @resolver.getDependenciesNotation().to_a
103
132
  else
@@ -108,7 +137,7 @@ class Naether
108
137
  # Resolve dependencies, finding related additional dependencies
109
138
  def resolve_dependencies( download_artifacts = true )
110
139
  @resolver.resolveDependencies( download_artifacts );
111
- dependencies
140
+ dependenciesNotation
112
141
  end
113
142
 
114
143
  def deploy_artifact( notation, file_path, url, opts = {} )
@@ -145,7 +174,7 @@ class Naether
145
174
  @project_instance = projectClass.new
146
175
  end
147
176
 
148
- @project_instance.setNotation( notation )
177
+ @project_instance.setProjectNotation( notation )
149
178
 
150
179
  dependencies().each do |notation|
151
180
  @project_instance.addDependency( notation )
data/naether-0.3.1.jar CHANGED
Binary file
data/pom.xml CHANGED
@@ -114,21 +114,6 @@
114
114
  <artifactId>wagon-file</artifactId>
115
115
  <version>${wagonVersion}</version>
116
116
  </dependency>
117
-
118
-
119
- <!-- exclude commons logging -->
120
- <dependency>
121
- <groupId>commons-logging</groupId>
122
- <artifactId>commons-logging</artifactId>
123
- <version>1.1.1</version>
124
- <scope>provided</scope>
125
- </dependency>
126
- <dependency>
127
- <groupId>commons-logging</groupId>
128
- <artifactId>commons-logging-api</artifactId>
129
- <version>1.1</version>
130
- <scope>provided</scope>
131
- </dependency>
132
117
 
133
118
  <!-- Test Scope -->
134
119
  <dependency>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: naether
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.2
5
+ version: 0.3.3
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-03-10 00:00:00 -05:00
13
+ date: 2011-03-14 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency