I've made a 2-module project where one module is completely denoted to a library that I've made and I'm accessing that library from the other module(which contains the MainActivity.java) of the project. Now I want to push only my library to the GitHub so that anyone can use it for their need. I know how to push the entire project to GitHub but How can I extract the library ( module ) from the project and push only that. Thanks in Advance!
Asked
Active
Viewed 906 times
2 Answers
1
Based on my understanding, your root project is already versioned under git. If so then to version your library module as a separate git repo and also use it within other git repo projects, then you need to use git-submodule. The module will be pushed as a separate Android Project. Once that is done, you'll add the library to your app project by using git-submodule
and configuring the settings.gradle
to include the library module for compiling. And finally, add a dependency in your app build.gradle
file to include the library in the app compilation.

ahasbini
- 6,761
- 2
- 29
- 45
-
Can you elaborate more? My library module name is "imagegrad" . Now How can I push it to GitHub? – Abhishek Kumar Feb 12 '18 at 18:27
0
This is so simple, maybe I misunderstand your need
git add <modulename.extension>
git commit -m "added single module"
git push origin master

3pitt
- 899
- 13
- 21