0

I would like to bring in the src directory main in my projects as a Library or dependency.

Using Android Studio/Gradle Flavor setup, it's possible to have multi-app setup with flavors:

app/
  src/
    flavor1/
    flavor2/
    main/

main carrying the base code of all flavors in the project.

I would like to centralize my main code across multiple projects

One way I envision, is to bring the main directory in via git-clone-task or gradle-git

But that would limit the scope to my team only.

Is there is a way or understanding behind centralizing the retrieval and placement of a src directory in Android Studio Projects using Gradle, then I could make the project public without all the ssh/auth stuff needed with the git-clone way.

I really want to bring in the main dir like....

  compile 'com.awesomeprojects.src.main:1.0'

What are some options for this use case?

sirvon
  • 2,547
  • 1
  • 31
  • 55
  • What about using modules? Maybe take a look at here is worthing http://stackoverflow.com/a/17187867/1568429 – Antonio Jose Dec 14 '14 at 03:41
  • The standard solution is to turn the main code into a separate Java or Android library, shared as a Jar or AAR archive. – Peter Niederwieser Dec 14 '14 at 04:32
  • Then how/where do i designate that lib as the main src dir? – sirvon Dec 14 '14 at 04:40
  • I'm missing something fundamental... I use dependencies all the time. It definitely does seem like what I want is to construct a library/SDK. So basically all the "new" code would just reference that lib, like I ref other libs...so basically it doesn't have to be the main src dir? hmmmm #progress – sirvon Dec 14 '14 at 05:02

0 Answers0