简体   繁体   English

将具有多个模块的Android项目推送到BitBucket

[英]Pushing Android project with multiple module to BitBucket

The problem is the Android Project which I have has in all 3 modules viz. 问题是我在所有3个模块中都拥有的Android项目,即。 1 main & other supporting modules. 1个主要及其他支持模块。
Currently I pushed the whole project to BitBucket which includes the modules too, but I'm confused if I should just push modules in different repos & not in a single repo like I have did. 目前,我将整个项目推送到了也包含模块的BitBucket上,但是我是否应该将模块推送到不同的存储库中而不是像我一样在单个存储库中推送,我感到困惑。
If different repos is the best way to go head, then how should I link all the 3 repos to represent as a single project. 如果最好使用不同的回购协议,那么我应该如何链接所有3个回购协议以代表一个项目。

If it is one Android project then you should probably use submodules . 如果这是一个Android项目,那么您可能应该使用子模块 Read this tutorial to know more about how to create submodules: 阅读本教程,以了解有关如何创建子模块的更多信息:

https://git-scm.com/book/en/v2/Git-Tools-Submodules https://git-scm.com/book/zh/v2/Git-Tools-Submodules

Then you can use 那你可以用

git submodule foreach git pull

To pull all submodules recursively or 递归拉所有子模块或

git pull --recurse-submodules

I recommend you to create another Bitbucket repos for each supporting module then you could use git submodules to link them with your main project or just upload the artifacts to a maven repo like jcenter, sonatype or bintray, then you can compile they as dependencies in build.gradle . 我建议您为每个支持模块创建另一个Bitbucket存储库,然后可以使用git子模块将它们链接到主项目,或者仅将工件上传到Maven存储库(如jcenter,sonatype或bintray),然后可以将其编译为build.gradle依赖项build.gradle I prefer the second option. 我更喜欢第二种选择。

Git submodule: Git子模块:

http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/ http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM