|
Post by account_disabled on Jan 29, 2024 7:23:23 GMT
Sprout Social 的 Android 移动应用程序是一款功能强大的本机应用程序,可让我们的客户随时随地连接到他们的社交媒体。作为 Android 应用程序的一部分,我们维护着由开源社区管理的超过 35 个依赖项,这些依赖项为我们的应用程序提供了有用的构建块。 我们的依赖项提供了无数的功能,例如用于进行网络调用的框架、异步图像加载、测试工具和其他解决常见 Android 开发挑战的现有解决方案。其中一些依赖项需要利用核心 Android 库,而其他依赖项则有助于解决常见的软件挑战,而无需从头开始编写所有代码。每个依赖项都允许我们利用功能,而无需重新发明轮子。 同时,每个人都有责任保持最新状态,以确保我们了解新的性能、安全性和功能更新。这在纸面上听起来很棒,但正如任何移动开发人员都知道的那样,手动跟踪这些更新可能是一个真正的负担。 Sprout 工程团队的价值观之一是有目的、专注地行动。 本着这种精神,我们决定实施更智能的解决方案,以便我们可以花更多 WhatsApp 数据 时间为客户构建有影响力的功能。为了实现这一目标,我们使用了自动化依赖管理第一方插件 Dependabot。 Dependabot 减少了过时依赖项的数量,简化了更新它们所需的工作,并简化了我们的整体开发流程。 摆脱手动依赖维护 在原生 Android 开发中,依赖项在 build.gradle 文件中声明。通过指定我们需要的版本的依赖关系,Gradle 将从中央存储库解析它并检索它以便我们能够在应用程序中使用。如果 Android 应用程序是多模块的,则每个模块都有自己的 build.gradle 文件,该文件声明该模块的依赖项。 有效地维护这些依赖关系对于顺利开发过程以及为客户提供能够跟上社交速度的有效社交媒体管理应用程序至关重要。但保持依赖项最新成为一项艰巨的任务,需要评估工作、版本兼容性检查、潜在的代码更改和测试。 在 Dependabot 之前,我们有一个手动依赖管理流程。随着应用程序复杂性的增加,我们花在依赖管理上的时间也增加了。 团队花费了大量精力来确定依赖项的需求,然后通过我们的敏捷开发工作流程对其进行处理,以使其具有优先级并保持最新状态。我们经常发现在功能开发过程中依赖项需要更新,这引入了总是令人恐惧的项目范围蔓延。我们需要一种更好的方法。 介绍:Dependabot 依赖管理并不是一个新概念。鉴于管理依赖项所需的大部分工作都是重复且单调的,我们的团队认为这将是自动化的完美候选者(无需陷入必须自己编写自动化的陷阱)。 我们发现 Dependabot 非常适合我们的需求 - 它是 GitHub 第一方工具,可以自动检测较新版本的依赖项并解决升级它们可能导致的任何兼容性问题。它会在任何版本升级可用时显示它们,并创建包含有关升级信息的拉取请求 (PR),我们能够将其无缝集成到我们的正常工程工作流程中。突然之间,我们不必花费大量时间手动确保一切都是最新的。 执行 Dependabot 智能分析我们的 build.gradle 文件以确定我们的依赖关系树,并为任何需要更新的依赖关系创建 PR。
|
|