motion-gradle 1.6.0 → 2.0.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 +3 -0
- data/lib/motion-gradle.rb +1 -1
- data/lib/motion/project/gradle.rb +2 -6
- data/lib/motion_gradle/dependency.rb +16 -0
- data/lib/motion_gradle/templates/build.gradle.erb +6 -5
- data/lib/motion_gradle/version.rb +1 -1
- metadata +3 -3
- data/lib/motion_gradle/legacy_dependency.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac0efdc59361c5d8567a761cd02c6bbffa1ef442
|
4
|
+
data.tar.gz: e925d8e61e0c5b6079807352499139df86300446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0de3923bd24a53138064fd5c754b7d62bf0f528bed9e342223ca69339f3f5a037acb256f3b3339b7c5e221c47f70d8d3547734e20c104b4b4a16d9c493a2c704
|
7
|
+
data.tar.gz: 44a1eb959f3589c09967fad7a71946bec84d9fca8112d24b7a515cb4ca600ca6a85d7be0c62913b281a200424d39b8d88de91f0e508088e2caaae5498efeeb1c
|
data/README.md
CHANGED
@@ -48,6 +48,9 @@ From version 1.1.0 you can use the same gradle dependency string that Java users
|
|
48
48
|
app.gradle do
|
49
49
|
dependency 'net.sf.ehcache:ehcache:2.9.0'
|
50
50
|
dependency 'com.joanzapata.pdfview:android-pdfview:1.0.+@aar'
|
51
|
+
dependency 'com.danikula:videocache:2.3.1' do
|
52
|
+
exclude module: 'android', group: 'com.google.android'
|
53
|
+
end
|
51
54
|
end
|
52
55
|
end
|
53
56
|
```
|
data/lib/motion-gradle.rb
CHANGED
@@ -46,12 +46,8 @@ module Motion::Project
|
|
46
46
|
@gradle_path = path
|
47
47
|
end
|
48
48
|
|
49
|
-
def dependency(name,
|
50
|
-
|
51
|
-
@dependencies << name
|
52
|
-
else
|
53
|
-
@dependencies << MotionGradle::LegacyDependency.new(name, options)
|
54
|
-
end
|
49
|
+
def dependency(name, &block)
|
50
|
+
@dependencies << MotionGradle::Dependency.new(name, &block)
|
55
51
|
end
|
56
52
|
|
57
53
|
def library(library_name, options = {})
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module MotionGradle
|
2
|
+
class Dependency
|
3
|
+
attr_reader :name
|
4
|
+
attr_reader :excludes
|
5
|
+
|
6
|
+
def initialize(name, &block)
|
7
|
+
@name = name
|
8
|
+
@excludes = []
|
9
|
+
instance_eval(&block) if block_given?
|
10
|
+
end
|
11
|
+
|
12
|
+
def exclude(options = {})
|
13
|
+
@excludes << options
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -51,10 +51,11 @@ dependencies {
|
|
51
51
|
compile project(':<%= library[:name] %>')
|
52
52
|
<% end %>
|
53
53
|
<% dependencies.each do |dependency| %>
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
compile '<%= dependency.name %>', {
|
55
|
+
<% dependency.excludes.each do |exclude| %>
|
56
|
+
exclude module: '<%= exclude[:module] %>',
|
57
|
+
group: '<%= exclude[:group] %>'
|
58
|
+
<% end %>
|
59
|
+
}
|
59
60
|
<% end %>
|
60
61
|
}
|
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:
|
4
|
+
version: 2.0.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-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- lib/motion-gradle.rb
|
37
37
|
- lib/motion/project/gradle.rb
|
38
38
|
- lib/motion_gradle/aidl.rb
|
39
|
-
- lib/motion_gradle/
|
39
|
+
- lib/motion_gradle/dependency.rb
|
40
40
|
- lib/motion_gradle/template.rb
|
41
41
|
- lib/motion_gradle/templates/aidl_build.gradle.erb
|
42
42
|
- lib/motion_gradle/templates/android_manifest.xml.erb
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module MotionGradle
|
2
|
-
class LegacyDependency
|
3
|
-
def initialize(name, params)
|
4
|
-
@options = normalized_dependency(name, params)
|
5
|
-
end
|
6
|
-
|
7
|
-
def parse
|
8
|
-
options = @options.delete_if { |_, v| v.nil? }.map { |k, v| "#{k}: '#{v}'" }
|
9
|
-
"compile #{options.join(', ')}"
|
10
|
-
end
|
11
|
-
|
12
|
-
protected
|
13
|
-
|
14
|
-
def normalized_dependency(name, params)
|
15
|
-
{
|
16
|
-
group: name,
|
17
|
-
version: params.fetch(:version, '+'),
|
18
|
-
name: params.fetch(:artifact, name),
|
19
|
-
ext: params.fetch(:extension, nil)
|
20
|
-
}
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|