motion-maven 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/README.md +28 -11
- data/lib/motion/project/maven.rb +8 -60
- data/lib/motion/project/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db808f99383a8d38ad44950c72cc0fed9da9e6e9
|
4
|
+
data.tar.gz: 5518a51db4851714062d8e2a1072d855e808a180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eba08a4c262f80e6d1205ffc803f62ea105153b08616e06169a55067241dea5b8aaf319a452f4bd374e3e86e245a600e618dbc1b6a3f8821ecef0a4bd6620819
|
7
|
+
data.tar.gz: 80ce08c06b67ab3fbefbdc88e28bca55d9710c1e692c5ac76098f7b5b6cbca3387e3bc7e56eef9a6dd9088cbc68f59154291f50e22736355ef28cf2ab6934a6c
|
data/README.md
CHANGED
@@ -6,13 +6,13 @@ motion-maven allows RubyMotion projects to integrate with the
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
You need to have maven installed
|
9
|
+
You need to have maven installed:
|
10
10
|
|
11
11
|
```
|
12
12
|
$ brew install maven
|
13
13
|
```
|
14
14
|
|
15
|
-
And the gem installed
|
15
|
+
And the gem installed:
|
16
16
|
|
17
17
|
```
|
18
18
|
$ [sudo] gem install motion-maven
|
@@ -39,25 +39,25 @@ gem 'motion-maven'
|
|
39
39
|
|
40
40
|
```ruby
|
41
41
|
Motion::Project::App.setup do |app|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
48
|
end
|
49
49
|
```
|
50
50
|
|
51
|
-
* Other options are
|
51
|
+
* Other options are: :scope, :type
|
52
52
|
|
53
|
-
* :version will default to
|
53
|
+
* :version will default to: LATEST
|
54
54
|
|
55
55
|
* :artifact will default to dependency name
|
56
56
|
|
57
57
|
|
58
58
|
## Configuration
|
59
59
|
|
60
|
-
If the `mvn` command is not in your path, you can configure it
|
60
|
+
If the `mvn` command is not in your path, you can configure it:
|
61
61
|
|
62
62
|
```ruby
|
63
63
|
Motion::Project::App.setup do |app|
|
@@ -66,6 +66,18 @@ Motion::Project::App.setup do |app|
|
|
66
66
|
end
|
67
67
|
```
|
68
68
|
|
69
|
+
You can also add other repositories :
|
70
|
+
|
71
|
+
```ruby
|
72
|
+
Motion::Project::App.setup do |app|
|
73
|
+
# ...
|
74
|
+
app.maven do
|
75
|
+
repository 'https://bintray.com/bintray/jcenter'
|
76
|
+
dependency 'com.google.android', :artifact => 'support-v4'
|
77
|
+
end
|
78
|
+
end
|
79
|
+
```
|
80
|
+
|
69
81
|
## Tasks
|
70
82
|
|
71
83
|
To tell motion-maven to download your dependencies, run the following rake
|
@@ -84,3 +96,8 @@ That’s all.
|
|
84
96
|
|
85
97
|
* Improve the pom.xml generated file, if you are a fine Maven connoisseur, feel free to help us.
|
86
98
|
* Improve edge cases.
|
99
|
+
|
100
|
+
|
101
|
+
## Note
|
102
|
+
|
103
|
+
motion-maven does not support android support libraries, RubyMotion might support it out of the box in the future: http://hipbyte.myjetbrains.com/youtrack/issue/RM-763
|
data/lib/motion/project/maven.rb
CHANGED
@@ -26,6 +26,7 @@ module Motion::Project
|
|
26
26
|
@maven_path = 'mvn'
|
27
27
|
@config = config
|
28
28
|
@dependencies = []
|
29
|
+
@repositories = []
|
29
30
|
configure_project
|
30
31
|
end
|
31
32
|
|
@@ -41,6 +42,10 @@ module Motion::Project
|
|
41
42
|
@dependencies << normalized_dependency(name, options)
|
42
43
|
end
|
43
44
|
|
45
|
+
def repository(url)
|
46
|
+
@repositories << url
|
47
|
+
end
|
48
|
+
|
44
49
|
def install!(update)
|
45
50
|
generate_pom
|
46
51
|
system "#{maven_command} -f #{pom_path} clean install"
|
@@ -48,68 +53,11 @@ module Motion::Project
|
|
48
53
|
|
49
54
|
# Helpers
|
50
55
|
def generate_pom
|
56
|
+
template_path = File.expand_path("../pom.erb", __FILE__)
|
57
|
+
template = ERB.new(File.new(template_path).read, nil, "%")
|
51
58
|
File.open(pom_path, 'w') do |io|
|
52
|
-
|
53
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
54
|
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
55
|
-
<modelVersion>4.0.0</modelVersion>
|
56
|
-
<groupId>com.maventest</groupId>
|
57
|
-
<artifactId>dependencies</artifactId>
|
58
|
-
<packaging>jar</packaging>
|
59
|
-
<version>1.0</version>
|
60
|
-
<name>dependencies</name>
|
61
|
-
<url>http://maven.apache.org</url>
|
62
|
-
<dependencies>
|
63
|
-
EOS
|
64
|
-
|
65
|
-
@dependencies.each do |dependency|
|
66
|
-
xml << <<EOS
|
67
|
-
<dependency>
|
68
|
-
<groupId>#{dependency[:name]}</groupId>
|
69
|
-
<artifactId>#{dependency[:artifact]}</artifactId>
|
70
|
-
<version>#{dependency[:version]}</version>
|
71
|
-
EOS
|
72
|
-
|
73
|
-
if dependency[:scope]
|
74
|
-
xml << "<scope>#{dependency[:scope]}</scope>"
|
75
|
-
end
|
76
|
-
|
77
|
-
if dependency[:type]
|
78
|
-
xml << "<type>#{dependency[:type]}</type>"
|
79
|
-
end
|
80
|
-
|
81
|
-
xml << <<EOS
|
82
|
-
</dependency>
|
83
|
-
EOS
|
84
|
-
end
|
85
|
-
|
86
|
-
xml << <<EOS
|
87
|
-
</dependencies>
|
88
|
-
<build>
|
89
|
-
<plugins>
|
90
|
-
<plugin>
|
91
|
-
<groupId>org.apache.maven.plugins</groupId>
|
92
|
-
<artifactId>maven-shade-plugin</artifactId>
|
93
|
-
<executions>
|
94
|
-
<execution>
|
95
|
-
<phase>package</phase>
|
96
|
-
<goals>
|
97
|
-
<goal>shade</goal>
|
98
|
-
</goals>
|
99
|
-
</execution>
|
100
|
-
</executions>
|
101
|
-
<configuration>
|
102
|
-
<finalName>${project.artifactId}</finalName>
|
103
|
-
</configuration>
|
104
|
-
</plugin>
|
105
|
-
</plugins>
|
106
|
-
</build>
|
107
|
-
</project>
|
108
|
-
EOS
|
109
|
-
|
110
|
-
io.puts xml
|
59
|
+
io.puts template.result(binding)
|
111
60
|
end
|
112
|
-
|
113
61
|
system "xmllint --output #{pom_path} --format #{pom_path}"
|
114
62
|
end
|
115
63
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-maven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joffrey Jaffeux
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: motion-maven allows RubyMotion Android projects to have access to the
|
14
14
|
Maven dependency manager.
|