为一个开源项目创建dummy Fabric Api键 [英] Creating dummy Fabric Api keys for an open source project

查看:114
本文介绍了为一个开源项目创建dummy Fabric Api键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个开源项目(Kotlin,Toothpick,Clean Architecture - 时下炒作主题,但这不是问题:)。我使用的是Fabric的Crashlytics,所以我根据 fabric.properties 中。安卓/面料/设置/ working-in-teams.html#android-projectsrel =nofollow noreferrer>官方文档(和这里有一些细节



问题是什么是向协作者提供虚拟键的最佳方式,而无需解决合并冲突这个属性文件?如果我在没有这个文件的情况下发布项目,它会在构建时崩溃,因为Fabric不会找到需要的键。



我看到的选项:


  1. 附加一个 fabric.properties ,其中不包含实际应用程序仪表板的预定义API和密钥,所以如果有人(有意或无意)制动分析或其他东西,他们的数据将在一个单独的仪表板。

  2. 什么都不做,所以如果有人感兴趣,他们必须手动。 >
  3. 为回购提供真正的钥匙(我认为这不是一个好主意,但如果您有其他经验,请分享它)

  4. 也许,Fabric有一些虚拟键只是不会在没有它们的情况下让构建失败(我还没有找到它们)?


  5. 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:

  1. 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.
  2. Do nothing, so if somebody interested they have to do it manually.
  3. 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)
  4. Maybe, Fabric has some dummy keys just not to fail the build without them (I haven't found them)?

  5. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆