• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

HipByte/motion-gradle: Integrate 3rd-party Java dependencies in RubyMotion for A ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

HipByte/motion-gradle

开源软件地址(OpenSource Url):

https://github.com/HipByte/motion-gradle

开源编程语言(OpenSource Language):

Ruby 80.0%

开源软件介绍(OpenSource Introduction):

motion-gradle

motion-gradle allows RubyMotion projects to integrate with Gradle to manage your dependencies.

Installation

You need to have gradle installed:

$ brew install gradle

And the gem installed:

$ [sudo] gem install motion-gradle

Or if you use Bundler:

gem 'motion-gradle'

You also need to install Extras/Local Maven repository for Support Libraries, Extras/Android Support Repository and Extras/Google Repository with the Android SDK Manager gui.

android-sdk-manager

Then, add the following lines to your ~/.profile file

export ANDROID_HOME=~/.rubymotion-android/sdk

(ANDROID_HOME should have same value with RUBYMOTION_ANDROID_SDK)

Setup

Edit the Rakefile of your RubyMotion project and add the following require lines:

require 'rubygems'
require 'motion-gradle'

Dependencies

From version 1.1.0 you can use the same gradle dependency string that Java users use.

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    dependency 'net.sf.ehcache:ehcache:2.9.0'
    dependency 'com.joanzapata.pdfview:android-pdfview:1.0.+@aar'
    dependency 'com.danikula:videocache:2.3.1' do
      exclude module: 'android', group: 'com.google.android'
    end
  end
end

Configuration

If the gradle command is not found in your PATH, you can configure it:

Motion::Project::App.setup do |app|
  # ...
  app.gradle.path = '/some/path/gradle'
end

Repositories :

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    repository 'https://bintray.com/bintray/jcenter'
    repository 'http://dl.bintray.com/austintaylor/gradle'
  end
end

Java libraries

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    library 'mylib', path: '/Users/joffreyjaffeux/Projects/mylib'
   end
end

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.

Plugins

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    plugin 'com.google.gms.google-services'
   end
end

Classpaths

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    classpath 'com.google.gms:google-services:1.3.0-beta1'
  end
end

Aidl

Motion::Project::App.setup do |app|
  # ...
  app.gradle do
    aidl 'com.android.vending.billing', './vendor/IInAppBillingService.aidl'
  end
end

Tasks

To tell motion-gradle to download your dependencies, run the following rake task:

$ [bundle exec] rake gradle:install

After a rake clean:all you will need to run the install task agin.

That’s all.

Known issues




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap