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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 617e05877b988ee1f537b0adaff8e9cfdade69c3
4
- data.tar.gz: d7228639f466ed173c28e5bdd02945f4501ec01f
3
+ metadata.gz: ac0efdc59361c5d8567a761cd02c6bbffa1ef442
4
+ data.tar.gz: e925d8e61e0c5b6079807352499139df86300446
5
5
  SHA512:
6
- metadata.gz: 5de72870a3a9c756edb92f19f90ca098e60521bbb29f9cef1f3df7d28668b2c12ad47dceeed6ebb0fc425a10e2da2f1ba3fe456db0ed101e029c8d1c202933f9
7
- data.tar.gz: 400569c31a723e7faafd65e521919c1df6bb6abe205e0ae7ef5d231c127e1c98945935bd9bc3bd3859d01e87e9506a7399103beab9afea2b83ebb0ed12846fa8
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
  ```
@@ -1,6 +1,6 @@
1
1
  require 'pathname'
2
2
  require 'shellwords'
3
- require 'motion_gradle/legacy_dependency'
3
+ require 'motion_gradle/dependency'
4
4
  require 'motion_gradle/aidl'
5
5
  require 'motion_gradle/template'
6
6
  require 'motion_gradle/version'
@@ -46,12 +46,8 @@ module Motion::Project
46
46
  @gradle_path = path
47
47
  end
48
48
 
49
- def dependency(name, options = {})
50
- if name.include?(':')
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
- <% if dependency.is_a?(MotionGradle::LegacyDependency) %>
55
- <%= dependency.parse %>
56
- <% else %>
57
- compile '<%= dependency %>'
58
- <% end %>
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
  }
@@ -1,3 +1,3 @@
1
1
  module MotionGradle
2
- VERSION = '1.6.0'
2
+ VERSION = '2.0.0'
3
3
  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.6.0
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-09-26 00:00:00.000000000 Z
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/legacy_dependency.rb
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