HipByte / motion-gradle

Integrate 3rd-party Java dependencies in RubyMotion for Android projects using Gradle
MIT License
16 stars 10 forks source link

"library" dependency declaration path should be relative to Rakefile path parent, not vendor path #8

Closed buzzware closed 9 years ago

buzzware commented 9 years ago

In the MotionStudio example from the previous issue, the path is absolute like : library 'motionstudiolib', path: '/Users/gary/repos/MotionStudio/motionstudiolib' which is inconvenient and not portable. Relative paths fail with an error that suggests they are relative to the generated vendor/Gradle/build.gradle.

In Android Studio, "compile project" is relative to the parent of the current project path, so ideally we would be able to use : library 'motionstudiolib', path: 'motionstudiolib' and then we can go one better and make the path default to the first argument so we can just specify : library 'motionstudiolib'

jjaffeux commented 9 years ago

@buzzware Yes I have done this, knowing it wouldn't be the definitive solution, can't make my mind on this, because I'm not sure of the definitive structure people will adopt when using. Currently you are doing :

main_folder

But what if you want to use several external modules ? This structure won't work. So i think, there are two solutions :

ruby_app

or

-> ruby_app -> module_1

buzzware commented 9 years ago

I agree on the two being the main options people would use, I wasn't considering the second. OK, then I recommend the path being relative to the folder of the Rakefile it lives in.

The default would then be either "../{projectname}" (for Android Studio) or "vendor/{projectname}". I'd pick the first one, following the Android Studio/gradle convention (there is no convention yet for RM users). Either way would be fine.

jjaffeux commented 9 years ago

deal.

jjaffeux commented 9 years ago

Ok should be fixed by 1.3.0

buzzware commented 9 years ago

Yes ! It worked - MotionStudio produced "something" in the log. This is a big deal for me.

Before this is closed however, what is the default? library 'motionstudiolib', path: '../motionstudiolib' worked but library 'motionstudiolib' produced FAILURE: Build failed with an exception.

GaryMac:MotionStudioRuby gary$ cat vendor/Gradle/settings.gradle

include 'motionstudiolib' project(':motionstudiolib').projectDir = new File('../../motionstudiolib')

jjaffeux commented 9 years ago

The default is assuming a RubyMotion app structure :

buzzware commented 9 years ago

OK