HipByte / motion-maven

Integrate 3rd-party Java dependencies in RubyMotion for Android projects using Maven
MIT License
15 stars 3 forks source link

Allow other repositories #3

Open TigerWolf opened 9 years ago

TigerWolf commented 9 years ago

One of the Libraries I would like to use is on JCenter:

https://bintray.com/bintray/jcenter

It appears to be the default repository that Android Studio uses.

Im not very familiar with maven but it looks like this might help:

http://maven.apache.org/guides/mini/guide-mirror-settings.html

It could be done by the user but it would be great if this gem did this.

jjaffeux commented 9 years ago

Hi Tiger,

yes indeed I've been thinking about it, I don't want to mess with the ~/.m2/settings.xml but I think I can add it to the generated pom.

for future reference : http://stackoverflow.com/questions/71030/can-i-add-maven-repositories-in-the-command-line

jjaffeux commented 9 years ago

Could have this api :

maven.repositories do
  repository 'https://bintray.com/bintray/jcenter'
end
lrz commented 9 years ago

Why not adding a repository method to the current maven block instead?

  app.maven do
    repository 'https://foo.com/bar'
    dependency 'foo'
  end
jjaffeux commented 9 years ago

yes indeed this is what I wanted to write, but it was too early for me probably...

jjaffeux commented 9 years ago

@TigerWolf hey I just pushed 1.1.0 with support for repositories (see README), can you try and tell me if it works for you please ?

TigerWolf commented 9 years ago

Thanks for doing this. I will try it out today.

TigerWolf commented 9 years ago
rake aborted!
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/pom.erb
/Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/maven.rb:57:in `initialize'
/Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/maven.rb:57:in `new'
/Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/maven.rb:57:in `generate_pom'
/Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/maven.rb:50:in `install!'
/Users/a1673450/.rvm/gems/ruby-2.2.0/gems/motion-maven-1.1.0/lib/motion/project/maven.rb:104:in `block (2 levels) in <top (required)>'
/Users/a1673450/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval'
/Users/a1673450/.rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => maven:install
(See full trace by running task with --trace)

Check out: https://github.com/HipByte/motion-maven/blob/master/motion-maven.gemspec#L20

jjaffeux commented 9 years ago

Yes, I forgot to add the erb file, just pushed update, should be good now.

TigerWolf commented 9 years ago

Possibly unrelated but I am not able to download the jar from JCenter.

http://dl.bintray.com/austintaylor/maven/com/uservoice/uservoice-android-sdk/

https://bintray.com/austintaylor/maven/com.uservoice%3Auservoice-android-sdk/view

  app.maven do
    repository 'https://bintray.com/bintray/jcenter'
    # dependency "com.uservoice.uservoice-android-sdk"
    dependency 'com.uservoice', :artifact => 'uservoice-android-sdk'
  end

[ERROR] Failed to execute goal on project dependencies: Could not resolve dependencies for project com.maventest:dependencies:jar:1.0: Failed to collect dependencies at com.uservoice:uservoice-android-sdk:jar:LATEST: Failed to read artifact descriptor for com.uservoice:uservoice-android-sdk:jar:LATEST: Failed to resolve version for com.uservoice:uservoice-android-sdk:jar:LATEST: Could not find metadata com.uservoice:uservoice-android-sdk/maven-metadata.xml in local (/Users/a1673450/.m2/repository) -> [Help 1]

Maybe because its an ARR file?

http://dl.bintray.com/austintaylor/maven/com/uservoice/uservoice-android-sdk/1.2.2/

TigerWolf commented 9 years ago

Its works for dependency 'com.google.android', :artifact => 'support-v4'

jjaffeux commented 9 years ago

yes, I'm investigating concerning uservoice, there might be an issue with .aar file after, but I think there's another issue before

jjaffeux commented 9 years ago

Ok.

if you use :

app.maven do
    repository 'https://bintray.com/bintray/jcenter'
    repository 'http://dl.bintray.com/austintaylor/maven'
    dependency 'com.uservoice', :artifact => 'uservoice-android-sdk', :version => '1.2.2'
end

On bintray, when you are on the code page you have to click on "setup me" to find the right repository to add.

It will mostly work, I say mostly because you will still have an error with com.android.support:appcompat-v7:jar:21. which is not in bintray, but is in your /extras/android/support/v7/appcompat/ folder. Right now RubyMotion doesn't support it, and you will have to add it by hand, there's a ticket that should fix it in the next weeks : http://hipbyte.myjetbrains.com/youtrack/issue/RM-763

TigerWolf commented 9 years ago

Thanks, I will try it out.