How to include a git submodule into a project?
So I have a git repository for a few related Java classes with a folder structure similar to this:
mylib/LICENSE mylib/README mylib/src/file1.java mylib/src/file2.java mylib/test/tester.java ...
Now, I’m creating an Android app in Eclipse with the traditional folder structure like:
repo/AndroidManifest.xml repo/bin/***** repo/res/***** repo/src/com/mysite/project/activity1.java ...
Now, I’d like to add the java classes to my android project in the folder:
However, if I add it as a git submodule, they are saved to the path:
Also, included is the tester.java, and some other files I don’t want in the Android project.
What is the best way to resolve this? Should I just leave the path as
com/mysite/mylib/src/file1.java? Or should I modify the repo and move the files from
mylib/src up into
mylib and delete the files I don’t want?
One Solution collect form web for “How to include a git submodule into a project?”
The simplest way would be to:
- keep your original (non-Android) repo separate
- add that original repo ‘
src‘ folder as a source folder of your Android Eclipse project (an Eclipse project can defined several
srcfolders, from various origin)
That will sidestep the “submodule” issue entirely, and allow you to select from your original project only the files you need for your Eclipse Android project.