[android-developers] Re: Reusable code organization with Android Studio
On Saturday, January 24, 2015 at 1:29:10 PM UTC-8, Doug wrote: Also, learn the semantics of what having -SNAPSHOT in a maven version string means for referencing build artifacts from a repo. Thanks for the pointer. That looks like the feature I was looking for. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Reusable code organization with Android Studio
You could use a local maven repo, then write yourself a convenience script that automatically builds and installs everything from wherever you like it to live. Also, learn the semantics of what having -SNAPSHOT in a maven version string means for referencing build artifacts from a repo. If you are the only one working on your app and all of its libraries, then just do whatever you want that's most convenient for you and don't worry about development conventions. Just stick everything in one repo and take control of it yourself. IMO conventions are mostly for teams that need to agree how collaborate well together. Doug On Friday, January 23, 2015 at 10:07:58 AM UTC-8, Nobu Games wrote: I set up a *Maven repository for my library modules* and add the needed modules as dependencies to my app project - Very elegant, but... - Every single tiny change in my library code requires rebuilding and deploying the module. - I also fear that I need to increase the version code / build number every single time so the local Maven cache gets updated? I have no experience with this. :-/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Reusable code organization with Android Studio
Thanks for your input! On Friday, January 23, 2015 at 7:39:51 PM UTC-8, Grunthos wrote: - I keep app projects in separate repositories and *I import my custom library modules* - *Importing a module creates a copy of the original * - This means *redundancy* and *code synchronization issues*. I may forget to merge back changes I've done to one of the library modules - Unfortunately this is the official solution provided by the IntelliJ IDEA documentation https://www.jetbrains.com/idea/help/sharing-android-source-code-and-resources-using-library-projects.html#d806616e254 Is this really so bad, or am I missing something? In eclipse I import library projects in their own tree and make changes relating to different projects in different trees. When I view one set of changes is valid/correct/complete, I comit them and import them into my other projects and fix/check/pray as appropriate. I view it as much the same process as incorporating patches from other people. I *assume* this what the IntelliJ approach is...please correct me if I am wrong! That's actually a very good point. I would deliberately allow redundancy to guarantee that a library works within an app project. As soon as the library is ready for prime time I can merge the changes back to the original repository and decide later if I need those changes in other app projects. It just makes the OCD part in me cringe a bit :-D - I set up a *Maven repository for my library modules* and add the needed modules as dependencies to my app project - Very elegant, but... - Every single tiny change in my library code requires rebuilding and deploying the module. - I also fear that I need to increase the version code / build number every single time so the local Maven cache gets updated? I have no experience with this. :-/ Dunno. Don't know Maven, sadly. I'm not sure but I believe this could probably be the ideal solution to satisfy my OCD needs. I would have a central development repository for my library modules and add specific versions of them to my app projects. With Gradle it's just a matter of adding a dependency statement. That way I could also guarantee that my apps do not break when I make changes to my libraries without having to duplicate library code. It's just super cumbersome when I want to develop locally for a while. So I guess I'd start out the way you describe and have library modules as part of the app project. When the library is stable I could merge it back to the originating repository and create a release build for Maven and add that build version as a dependency to the app project. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Reusable code organization with Android Studio
Interesting post, I find myself in a similar posiion re libraries and, more generally, in trying to find realistic best practice guides. On Saturday, January 24, 2015 at 5:07:58 AM UTC+11, Nobu Games wrote: - *I use only a single massive repository *that is basically an Android Studio project that hosts all my Android app modules and custom library modules - This is not going to happen I agree. - I keep app projects in separate repositories and *I import my custom library modules* - *Importing a module creates a copy of the original * - This means *redundancy* and *code synchronization issues*. I may forget to merge back changes I've done to one of the library modules - Unfortunately this is the official solution provided by the IntelliJ IDEA documentation https://www.jetbrains.com/idea/help/sharing-android-source-code-and-resources-using-library-projects.html#d806616e254 Is this really so bad, or am I missing something? In eclipse I import library projects in their own tree and make changes relating to different projects in different trees. When I view one set of changes is valid/correct/complete, I comit them and import them into my other projects and fix/check/pray as appropriate. I view it as much the same process as incorporating patches from other people. I *assume* this what the IntelliJ approach is...please correct me if I am wrong! - I keep app projects in separate repositories and *check out my library modules from a separate repository as a Git submodule http://git-scm.com/book/en/v2/Git-Tools-Submodules* - I *cannot cherry-pick the needed library modules* from the Git repository. Git submodule checks out the whole library repository - It does not play nicely with that one level deep project/module directory structure for Android Studio projects I've never been very fond of the git submodule approach, so yes: I agree. In Eclipse when I use a library I typically create tags in case I need to restore the exact version as built. - I set up a *Maven repository for my library modules* and add the needed modules as dependencies to my app project - Very elegant, but... - Every single tiny change in my library code requires rebuilding and deploying the module. - I also fear that I need to increase the version code / build number every single time so the local Maven cache gets updated? I have no experience with this. :-/ Dunno. Don't know Maven, sadly. - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.