HipByte / motion-gradle

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

RubyMotion build should rebuild "library" dependencies #10

Closed buzzware closed 9 years ago

buzzware commented 9 years ago

RubyMotion build (including "rake device" and "rake emulator" should rebuild "library" gradle dependencies from source.

This is to support the scenario where a library is developed together as part of the app, and every change should be included in build for a sane development workflow.

I'm not saying this isn't happening (I haven't been able to test library dependencies yet), just making sure it does happen.

jjaffeux commented 9 years ago

Indeed currently it's not working, not sure how to implement this, will think about it.

jjaffeux commented 9 years ago

I don't think I can have a great solution on this... I can't just rebuild one library or dependency, it's dependencies they are related so everything has to be done together, I could add an option that will rebuild every rake, like app.gradle.rebuild_on_rake = true but it won't just rebuild one lib. I will think more about it, maybe will find find something...

buzzware commented 9 years ago

I think it makes sense to rebuild just the "library" entries. I gather the other "dependency" entries would likely be more static (my Java knowledge is limited).

jjaffeux commented 9 years ago

@buzzware but what if you have dependencies in your libraries ?

jjaffeux commented 9 years ago

your motionstuliod has a build.gradle file

which currently has this has dependencies :

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }

you could add a remote dependency here, and I couldn't only recompile this.

buzzware commented 9 years ago

I didn't put that line in - it came from Android Studio - not sure if its needed. How about a build: true flag available on library (and maybe even dependency) entries ? All I'm suggesting is that something like "rake gradle:install" be done with every "rake device" etc except that there may be a more efficient/quicker way via gradle options that focusses on code it already has that has changed, ignoring 3rd party libraries.

jjaffeux commented 9 years ago

Yes it's android studio generating it, and yes you need it.

I have an idea, I could generate an alternate build.gradle file and give it as a parameter of gradle command, I will see...

buzzware commented 9 years ago

"but what if you have dependencies in your libraries ?" Building a library would happen however its gradle file defines. That's not the responsibility of the top level app. Perhaps look at Android Studio for an example - it builds library modules with the app. My thinking is that library modules are really part of the app (the java part in my case), yet can be shared, easily separated if needed in the future, and serve as a way of organising code. Gems and "dependency" entries are more separate, and can be built separately.

jjaffeux commented 9 years ago

sure they can build builds separately, but if we are using build systems like gradle it's not to hardcode vendor dependencies in each lib, if you have one dependencyA that needs a dependencyB and another dependencyC that also needs dependencyB, you want gradle to resolve it, and only have dependencyB one time in your project.

GantMan commented 9 years ago

@buzzware take a look at my newclear gem.