motion-maven 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -18
- data/lib/motion/project/maven.rb +10 -2
- data/lib/motion/project/pom.erb +4 -4
- data/lib/motion/project/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64cfbec7cc9b7dff003bdd3216a0ef89e6262805
|
4
|
+
data.tar.gz: 96b6287592769f3ac9a90df9350f5b1ec57af4d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e9310fb126203dfa725c294e10525d5525e3b3a6a327b0d33986b9709fbac21c1bf501d0e6b63c43e9f68866d6622827aada88bffcd704d240abe4f68941d63
|
7
|
+
data.tar.gz: b39339604bc6fb8bb78fdc57817efbe420e5258dcb1c4c9411346cfa3d2acbec81289d804a14dfefd3acec55158c940dae95d3b503fc337ec1104940357ff1ae
|
data/README.md
CHANGED
@@ -37,22 +37,22 @@ gem 'motion-maven'
|
|
37
37
|
|
38
38
|
2. Still in the `Rakefile`, set your dependencies
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
40
|
+
```ruby
|
41
|
+
Motion::Project::App.setup do |app|
|
42
|
+
# ...
|
43
|
+
app.maven do
|
44
|
+
dependency 'com.mcxiaoke.volley', :artifact => 'library', :version => '1.0.10'
|
45
|
+
dependency 'commons-cli'
|
46
|
+
dependency 'ehcache', :version => '1.2.3'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
50
|
|
51
|
-
|
51
|
+
* Other options are: :scope, :type
|
52
52
|
|
53
|
-
|
53
|
+
* :version will default to: LATEST
|
54
54
|
|
55
|
-
|
55
|
+
* :artifact will default to dependency name
|
56
56
|
|
57
57
|
|
58
58
|
## Configuration
|
@@ -70,14 +70,17 @@ You can also add other repositories :
|
|
70
70
|
|
71
71
|
```ruby
|
72
72
|
Motion::Project::App.setup do |app|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
73
|
+
# ...
|
74
|
+
app.maven do
|
75
|
+
repository 'https://bintray.com/bintray/jcenter'
|
76
|
+
repository 'http://dl.bintray.com/austintaylor/maven'
|
77
|
+
dependency 'com.google.android', :artifact => 'support-v4'
|
78
|
+
end
|
78
79
|
end
|
79
80
|
```
|
80
81
|
|
82
|
+
* Other options are: :snapshots (default:true), :releases (default:true)
|
83
|
+
|
81
84
|
## Tasks
|
82
85
|
|
83
86
|
To tell motion-maven to download your dependencies, run the following rake
|
data/lib/motion/project/maven.rb
CHANGED
@@ -42,8 +42,8 @@ module Motion::Project
|
|
42
42
|
@dependencies << normalized_dependency(name, options)
|
43
43
|
end
|
44
44
|
|
45
|
-
def repository(url)
|
46
|
-
@repositories << url
|
45
|
+
def repository(url, options = {})
|
46
|
+
@repositories << normalized_repository(url, options)
|
47
47
|
end
|
48
48
|
|
49
49
|
def install!(update)
|
@@ -78,6 +78,14 @@ module Motion::Project
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
def normalized_repository(url, options)
|
82
|
+
{
|
83
|
+
url: url,
|
84
|
+
releases: options.fetch(:releases, true),
|
85
|
+
snapshots: options.fetch(:snapshots, true)
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
81
89
|
def normalized_dependency(name, options)
|
82
90
|
{
|
83
91
|
name: name,
|
data/lib/motion/project/pom.erb
CHANGED
@@ -21,17 +21,16 @@
|
|
21
21
|
</dependency>
|
22
22
|
<% end %>
|
23
23
|
</dependencies>
|
24
|
-
|
25
24
|
<repositories>
|
26
25
|
<% @repositories.each_with_index do |repository, index| %>
|
27
26
|
<repository>
|
28
27
|
<id>repository-<%= index %></id>
|
29
|
-
<url><%= repository %></url>
|
28
|
+
<url><%= repository[:url] %></url>
|
30
29
|
<releases>
|
31
|
-
<enabled
|
30
|
+
<enabled><%= repository[:releases] %></enabled>
|
32
31
|
</releases>
|
33
32
|
<snapshots>
|
34
|
-
<enabled
|
33
|
+
<enabled><%= repository[:snapshots] %></enabled>
|
35
34
|
</snapshots>
|
36
35
|
</repository>
|
37
36
|
<% end %>
|
@@ -41,6 +40,7 @@
|
|
41
40
|
<plugin>
|
42
41
|
<groupId>org.apache.maven.plugins</groupId>
|
43
42
|
<artifactId>maven-shade-plugin</artifactId>
|
43
|
+
<version>2.3</version>
|
44
44
|
<executions>
|
45
45
|
<execution>
|
46
46
|
<phase>package</phase>
|