motion-gradle 1.3.0 → 1.4.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 +11 -5
- data/lib/motion-gradle.rb +1 -0
- data/lib/motion/project/gradle.erb +3 -7
- data/lib/motion/project/gradle.rb +13 -13
- data/lib/motion/project/legacy_dependency.rb +21 -0
- data/lib/motion/project/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bfa047d9cd237d1a2b521e4b87ecedaf35641b3
|
4
|
+
data.tar.gz: 17377bd105d6a6866313db0586e85d73648dc15d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 323045101d3e05a096e71ff0d6f5fbcccc4ae70ee42a54e496de34c14ff15a12faea2722300312efbd3c08888e5404e7b223c23e3c9abf4a0af792c0da0d80b6
|
7
|
+
data.tar.gz: 08a1e6033cff5945ac5b3cad685b898fbbba1398e5513b59576a96a64b30df3452125613e3a2dc7cc9ce5d22879b4cbb4fa15500b67a4e5867b54ea8404a5904
|
data/README.md
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# motion-gradle
|
2
2
|
|
3
|
-
motion-gradle allows RubyMotion projects to integrate with
|
3
|
+
motion-gradle allows RubyMotion projects to integrate with
|
4
4
|
[Gradle](https://gradle.org/) to manage your dependencies.
|
5
5
|
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
You need to have gradle installed:
|
9
|
+
You need to have gradle installed:
|
10
10
|
|
11
11
|
```
|
12
12
|
$ brew install gradle
|
13
13
|
```
|
14
14
|
|
15
|
-
And the gem installed:
|
15
|
+
And the gem installed:
|
16
16
|
|
17
17
|
```
|
18
18
|
$ [sudo] gem install motion-gradle
|
@@ -24,7 +24,7 @@ Or if you use Bundler:
|
|
24
24
|
gem 'motion-gradle'
|
25
25
|
```
|
26
26
|
|
27
|
-
You also need to install `Extras/Android Support Repository` with the Android SDK Manager gui.
|
27
|
+
You also need to install `Extras/Android Support Repository` and `Extras/Google Repository` with the Android SDK Manager gui.
|
28
28
|
|
29
29
|
![android-sdk-manager](https://raw.githubusercontent.com/jjaffeux/motion-gradle/master/images/android-sdk-manager.png)
|
30
30
|
|
@@ -99,6 +99,12 @@ task:
|
|
99
99
|
$ [bundle exec] rake gradle:install
|
100
100
|
```
|
101
101
|
|
102
|
-
After a `rake
|
102
|
+
After a `rake clean:all` you will need to run the install task agin.
|
103
103
|
|
104
104
|
That’s all.
|
105
|
+
|
106
|
+
|
107
|
+
## Known issues
|
108
|
+
|
109
|
+
* Clunky .aar support, if you can provide failing cases of libs using .aar it would be great
|
110
|
+
* Issue with iconify : http://hipbyte.myjetbrains.com/youtrack/issue/RM-867
|
data/lib/motion-gradle.rb
CHANGED
@@ -30,14 +30,10 @@ dependencies {
|
|
30
30
|
compile project(':<%= library[:name] %>')
|
31
31
|
<% end %>
|
32
32
|
<% @dependencies.each do |dependency| %>
|
33
|
-
<% if dependency.is_a?(
|
34
|
-
|
33
|
+
<% if dependency.is_a?(LegacyDependency) %>
|
34
|
+
<%= dependency.parse %>
|
35
35
|
<% else %>
|
36
|
-
|
37
|
-
compile group: '<%= dependency[:name] %>', name: '<%= dependency[:artifact] %>', version: '<%= dependency[:version] %>', ext: '<%= dependency[:extension]%>'
|
38
|
-
<% else %>
|
39
|
-
compile group: '<%= dependency[:name] %>', name: '<%= dependency[:artifact] %>', version: '<%= dependency[:version] %>'
|
40
|
-
<% end %>
|
36
|
+
compile '<%= dependency %>'
|
41
37
|
<% end %>
|
42
38
|
<% end %>
|
43
39
|
}
|
@@ -46,8 +46,7 @@ module Motion::Project
|
|
46
46
|
if name.include?(':')
|
47
47
|
@dependencies << name
|
48
48
|
else
|
49
|
-
|
50
|
-
@dependencies << normalized_dependency(name, options)
|
49
|
+
@dependencies << LegacyDependency.new(name, options)
|
51
50
|
end
|
52
51
|
end
|
53
52
|
|
@@ -97,7 +96,17 @@ module Motion::Project
|
|
97
96
|
def vendor_aars
|
98
97
|
aars_dependendies = Dir[File.join(GRADLE_ROOT, 'aar/*')]
|
99
98
|
aars_dependendies.each do |dependency|
|
100
|
-
|
99
|
+
main_jar = File.join(dependency, 'classes.jar')
|
100
|
+
if File.exist?(main_jar)
|
101
|
+
vendor_options = {:jar => main_jar}
|
102
|
+
else
|
103
|
+
next
|
104
|
+
end
|
105
|
+
|
106
|
+
# libs/*.jar may contain dependencies, let's vendor them
|
107
|
+
Dir[File.join(dependency, 'libs/*.jar')].each do |internal_dependancy|
|
108
|
+
@config.vendor_project({:jar => internal_dependancy})
|
109
|
+
end
|
101
110
|
|
102
111
|
res = File.join(dependency, 'res')
|
103
112
|
if File.exist?(res)
|
@@ -140,7 +149,7 @@ module Motion::Project
|
|
140
149
|
aars.each do |aar|
|
141
150
|
filename = File.basename(aar, '.aar')
|
142
151
|
system("unzip -o -qq #{aar} -d #{aar_dir}/#{filename}")
|
143
|
-
end
|
152
|
+
end
|
144
153
|
end
|
145
154
|
|
146
155
|
def generate_gradle_settings_file
|
@@ -179,15 +188,6 @@ module Motion::Project
|
|
179
188
|
"#{@gradle_path}"
|
180
189
|
end
|
181
190
|
end
|
182
|
-
|
183
|
-
def normalized_dependency(name, options)
|
184
|
-
{
|
185
|
-
name: name,
|
186
|
-
version: options.fetch(:version, '+'),
|
187
|
-
artifact: options.fetch(:artifact, name),
|
188
|
-
extension: options.fetch(:extension, false),
|
189
|
-
}
|
190
|
-
end
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class LegacyDependency
|
2
|
+
def initialize(name, params)
|
3
|
+
@options = normalized_dependency(name, params)
|
4
|
+
end
|
5
|
+
|
6
|
+
def parse
|
7
|
+
options = @options.delete_if { |_, v| v.nil? }.map {|k, v| "#{k}: '#{v}'"}
|
8
|
+
"compile #{options.join(', ')}"
|
9
|
+
end
|
10
|
+
|
11
|
+
protected
|
12
|
+
|
13
|
+
def normalized_dependency(name, params)
|
14
|
+
{
|
15
|
+
group: name,
|
16
|
+
version: params.fetch(:version, '+'),
|
17
|
+
name: params.fetch(:artifact, name),
|
18
|
+
ext: params.fetch(:extension, nil),
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-gradle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.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-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: motion-gradle allows RubyMotion Android projects to have access to the
|
14
14
|
Gradle dependency manager.
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- lib/motion-gradle.rb
|
23
23
|
- lib/motion/project/gradle.erb
|
24
24
|
- lib/motion/project/gradle.rb
|
25
|
+
- lib/motion/project/legacy_dependency.rb
|
25
26
|
- lib/motion/project/settings.erb
|
26
27
|
- lib/motion/project/version.rb
|
27
28
|
homepage: http://www.rubymotion.com
|
@@ -49,3 +50,4 @@ signing_key:
|
|
49
50
|
specification_version: 4
|
50
51
|
summary: Gradle integration for RubyMotion Android projects
|
51
52
|
test_files: []
|
53
|
+
has_rdoc:
|