简体   繁体   English

如何在我的Android Studio项目的SVN中存储Gradle的外部依赖关系?

[英]How to store the external dependencies of Gradle in SVN for my Android Studio Project?

I have an Android Studio project with many Gradle compile dependencies for Google Play, Android Support Lib, Firebase and some other libs. 我有一个Android Studio项目,其中包含许多Google Play的Gradle编译依赖项,Android支持库,Firebase和其他一些库。

I am not using the built in SVN Support of Android Studio but I added the source files manually to my SVN. 我没有使用Android Studio的内置SVN支持,而是将源文件手动添加到了SVN中。 Now I was wondering that all those source codes or libs of the external dependencies are not available to be stored with my SVN. 现在,我想知道所有这些源代码或外部依赖关系的库都无法与我的SVN一起存储。 That means that my SVN commits do not contain the "complete" source code or source+libs for my project. 这意味着我的SVN提交不包含项目的“完整”源代码或source + libs。

What is the idea behind it? 它背后的想法是什么? Will the external links like com.google.android.gms:play-services-ads:16.0.1 will also work in 10 years from https://maven.google.com so there is now need to store this by myself? 像com.google.android.gms:play-services-ads:16.0.1这样的外部链接在https://maven.google.com上也可以在10年内正常工作,因此现在需要我自己存储它吗? Or should I store some generated lib files? 还是应该存储一些生成的lib文件? But where to find them? 但是在哪里可以找到他们呢?

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:27.1.1'
    compile 'com.google.android.gms:play-services-ads:16.0.1'
    ...
}

Yes, the idea is that Maven repositories will be available forever, and the combination of an artifact ID and version number uniquely identifies a library so that it will never change in the future. 是的,想法是Maven存储库将永远可用,并且工件ID和版本号的组合唯一地标识了一个库,因此将来不会更改。 Storing library files in version control is considered bad practice because it unnecessarily inflates the repository and makes it somewhat harder to update the versions. 在版本控制中存储库文件被认为是不好的做法,因为这不必要地使存储库膨胀,并使得更新版本有些困难。

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

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