为一个开源项目创建dummy Fabric Api键 [英] Creating dummy Fabric Api keys for an open source project
问题描述
问题是什么是向协作者提供虚拟键的最佳方式,而无需解决合并冲突这个属性文件?如果我在没有这个文件的情况下发布项目,它会在构建时崩溃,因为Fabric不会找到需要的键。
我看到的选项:
- 附加一个
fabric.properties
,其中不包含实际应用程序仪表板的预定义API和密钥,所以如果有人(有意或无意)制动分析或其他东西,他们的数据将在一个单独的仪表板。 - 什么都不做,所以如果有人感兴趣,他们必须手动。 >
- 为回购提供真正的钥匙(我认为这不是一个好主意,但如果您有其他经验,请分享它)
-
也许,Fabric有一些虚拟键只是不会在没有它们的情况下让构建失败(我还没有找到它们)?
-
p>
您可以选择的一种方法是禁用初始化Fabric,除非键存在或者在构建时读入值或不存在值。最好的实施将取决于你的具体设置,所以有点模糊的道歉。
I am working on an open-source project (Kotlin, Toothpick, Clean Architecture - nowadays hype themes, but that's not the question :). I am using Fabric's Crashlytics, so I hid the API and secret keys into fabric.properties
, according to the the official docs (and here are some details)
The question is what is the best way to provide some dummy keys to collaborators without needing to solve merge conflicts in this properties file? If I publish the project without this file, it will crash on build because Fabric won't find needed keys.
The options I see:
- Attach a
fabric.properties
with pre-defined API and Secret keys that are not from the actual app dashboard, so if somebody (intentionally or not) brakes analytics or something, their data will be in a separate dashboard. - Do nothing, so if somebody interested they have to do it manually.
- Provide the real keys to the repo (I don't think that it is a good idea, but if you have other experience, share it please)
Maybe, Fabric has some dummy keys just not to fail the build without them (I haven't found them)?
Something else?
Mike from Fabric here. One option you could take is to disable initializing Fabric unless the keys are present or if a value read in at build time is present or not. The best implementation would depend on your specific setup so apologies for being a little vague.
这篇关于为一个开源项目创建dummy Fabric Api键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!