motion-gradle 1.2.1 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39b4a42fbe8c34267f2f47de45c2757d9dbb1951
4
- data.tar.gz: 033579f979e473691b7473e5111608ed9486c31c
3
+ metadata.gz: 16f9c7f8925294bb5446a31de105082f9d799808
4
+ data.tar.gz: cc88f7303a763464318e9be93755a5152de2051f
5
5
  SHA512:
6
- metadata.gz: ae45d3fdf2ca007820c94270b2925caa9452f40aefb372d776e9ce06547d5250a76c5b689b925189b3d8f4c6ce8b80611bc2a3ad819cd12691d5fe48e223ee4b
7
- data.tar.gz: bc48780d63289ab320aee9d106dbe1f87fd2045a759759d4de0f00f3df33a5e5792eca8780a39b7e8ade5bcfe9ded8e5f80a255d5d43209485b76795a5a368a2
6
+ metadata.gz: 145450ef3276d010b5d79ced75ae2cea1e08dc038a9d0699014f56c1d365f02eb394d4f3a94a9c7264e9a9aada1c64a4c1d37161b0c05d836f36fe383b95f949
7
+ data.tar.gz: 491bdec52b3ee2b5fa8ebb291caa2a399781dd45f39dc01957db1ec6ac072117d5d56d9bf68d6fa7d0f3e845cc79c5527bb13217416805978adc18e51324c051
data/README.md CHANGED
@@ -78,11 +78,16 @@ end
78
78
 
79
79
  ## Support for local libraries
80
80
 
81
- app.gradle do
82
- library 'mylib', path: '/Users/joffreyjaffeux/Projects/mylib'
81
+ ```ruby
82
+ Motion::Project::App.setup do |app|
83
+ # ...
84
+ app.gradle do
85
+ library 'mylib', path: '/Users/joffreyjaffeux/Projects/mylib'
86
+ end
83
87
  end
88
+ ```
84
89
 
85
- If you dont specify the path option, the library will be searched in the vendor folder.
90
+ If relative path is used it's relative to your Rakefile, if you don't specify a path it will search in your_app/my_lib.
86
91
 
87
92
 
88
93
  ## Tasks
data/lib/motion-gradle.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'pathname'
1
2
  require 'shellwords'
2
3
  require 'motion/project/gradle'
3
4
  require 'motion/project/version'
@@ -52,7 +52,15 @@ module Motion::Project
52
52
  end
53
53
 
54
54
  def library(library_name, options = {})
55
- @libraries << {name: library_name, path: options.fetch(:path, "../../vendor/#{library_name}")}
55
+ path = options.fetch(:path, library_name)
56
+ unless Pathname.new(path).absolute?
57
+ path = File.join('../..', path)
58
+ end
59
+
60
+ @libraries << {
61
+ name: library_name,
62
+ path: path
63
+ }
56
64
  end
57
65
 
58
66
  def repository(url)
@@ -138,7 +146,7 @@ module Motion::Project
138
146
  def generate_gradle_settings_file
139
147
  template_path = File.expand_path("../settings.erb", __FILE__)
140
148
  template = ERB.new(File.new(template_path).read, nil, "%")
141
- File.open(gradle_build_file, 'w') do |io|
149
+ File.open(gradle_settings_file, 'w') do |io|
142
150
  io.puts(template.result(binding))
143
151
  end
144
152
  end
@@ -155,6 +163,10 @@ module Motion::Project
155
163
  File.join(GRADLE_ROOT, 'build.gradle')
156
164
  end
157
165
 
166
+ def gradle_settings_file
167
+ File.join(GRADLE_ROOT, 'settings.gradle')
168
+ end
169
+
158
170
  def gradle_command
159
171
  unless system("command -v #{@gradle_path} >/dev/null")
160
172
  $stderr.puts("[!] #{@gradle_path} command doesn’t exist. Verify your gradle installation. Or set a different one with `app.gradle.path=(path)`")
@@ -1,5 +1,5 @@
1
1
  module Motion::Project
2
2
  class Gradle
3
- VERSION = '1.2.1'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  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.2.1
4
+ version: 1.3.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-05-21 00:00:00.000000000 Z
11
+ date: 2015-05-22 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.