代码之家  ›  专栏  ›  技术社区  ›  TinyTheBrontosaurus

如何在React Native应用程序中显示git Descripte?

  •  0
  • TinyTheBrontosaurus  · 技术社区  · 7 年前

    我一般喜欢自动烘焙的结果 git describe --always --dirty 在我开发的任何网站、应用程序等中,我都可以轻松追踪行为。现在,我想不出在React原生应用程序中实现这一点的方法。

    1 回复  |  直到 7 年前
        1
  •  0
  •   TinyTheBrontosaurus    4 年前

    我找到了一种混合使用其他现有答案的方法:

    1. Call git-describe during the build 从gradle访问
    2. Call PackageManager 从Java访问gradle配置
    3. Then use a React NativeModule in Java 从JS访问

    minimal diff 这说明了如何在Android中实现。