【问题标题】:Can I use the local gradle cache (or something else) to speed up Android library development?我可以使用本地 gradle 缓存(或其他东西)来加速 Android 库的开发吗?
【发布时间】:2016-06-27 21:36:01
【问题描述】:

我正在开发一个 Android 库,我正在寻找有关如何加快开发用于应用程序的库的机制的指导。

在我的生产工作流程中,我将 aar 库发布到私有 maven 存储库。这个aar 库由多个应用程序通过 gradle 检索。这适用于生产。

我正在寻找一个好的开发工作流程来使用库的开发版本。这些是我已经确定的选项,我觉得没有一个完全令人满意:

  1. 将每个开发库版本发布到私有 Maven 存储库。不断地将库的开发版本发布到 maven 存储库并检索它们以在测试应用程序中运行一次非常麻烦,因为这需要为每个开发版本使用新版本,或者在重用相同版本时擦除本地 gradle 缓存。
  2. Copying the source of the library into the source of the project, described in the accepted answer。这似乎违背了拥有图书馆的目的。
  3. Switching the application to use a local file version of the aar library. 导入 aar 库会引入对应用程序构建文件的更改,这些更改在返回到 maven 存储库的生产使用时需要恢复。

有没有办法可以将我的 aar 库的开发版本插入到本地 gradle 缓存中,以便可以在本地检索它们,同时保持生产版本中存在的相同应用程序构建配置?还是有更简单的库开发工作流程?

【问题讨论】:

    标签: maven caching android-studio android-gradle-plugin aar


    【解决方案1】:

    我的库开发解决方案是上传到maven,并清除本地gradle缓存中的相应条目。见Is there a simple way to remove one dependency from the local gradle cache?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-03
      • 1970-01-01
      相关资源
      最近更新 更多